Zero DC Offset — User Guide

Measure and remove constant DC offset from a selected Sound by subtracting the exact mean amplitude independently from every channel — without high-pass filtering, normalization, or peak scaling.

Author: Shai Cohen Affiliation: Department of Music, Bar-Ilan University, Israel Version: 0.1.1 (2026) License: MIT License Repo: Praat AudioTools
Contents:

What this does

Zero DC Offset removes a constant baseline displacement from one selected Sound. For each channel, the script measures the global mean amplitude and subtracts that value from every sample in the same channel.

The operation is intentionally minimal. It does not apply a high-pass filter, does not normalize the result, and does not rescale peaks. The corrected Sound therefore differs from the source only by the removal of the constant per-channel mean.

Core idea: a true constant DC component is the zero-frequency mean of the waveform. Removing it does not require spectral filtering; it can be removed directly and exactly by subtracting the channel mean.

Offset → centered signal

SELECTED SOUND ↓ MEASURE EACH CHANNEL global mean / RMS / peak ↓ CONSTANT DC CORRECTION x_out[c,n] = x_in[c,n] - mean_c ↓ POST-CORRECTION QC residual mean / RMS / peak / dBFS ↓ OPTIONAL MEASUREMENT TABLE ↓ OPTIONAL VISUALIZATION waveform before → waveform after → local-mean trajectory ↓ CORRECTED SOUND <source>_ZeroDC

Quick start

  1. Select exactly one Sound object.
  2. Run Zero_DC_Offset.praat.
  3. Keep Dc_trajectory_window_s at 0.25 s unless you want a finer or coarser local-mean display.
  4. Leave Draw_visualization enabled to compare the waveform before and after correction and inspect the local-mean trajectory.
  5. Leave Create_measurement_table enabled when you want per-channel numeric results for later inspection or export.
  6. The corrected Sound appears as <source>_ZeroDC. The original Sound is preserved.

Method

For channel c, the script first measures the complete-channel mean:

mean_c = mean(x_in[c,n])

It then copies the source Sound and applies:

x_out[c,n] = x_in[c,n] - mean_c

The correction is performed independently for every channel. A stereo file may therefore receive two different DC corrections if its left and right channels have different baseline offsets.

No filter is inserted. Because the operation is a direct subtraction, there is no cutoff frequency, transition band, filter phase response, or low-frequency roll-off.

Controls

ControlDefaultFunction
Dc_trajectory_window_s0.25 sWindow duration used only for the optional local-mean trajectory in the Picture window. It does not change the correction itself.
Draw_visualizationOnDraws waveform before, waveform after, local-mean trajectory, and a compact QC summary.
Create_measurement_tableOnCreates the per-channel Table ZeroDC_Measurements.

Measurements & QC

Before and after correction, the script measures every channel independently. The measurement table contains:

FieldMeaning
DC_before / DC_afterGlobal channel mean before and after correction.
DCpctRMS_before / DCpctRMS_afterAbsolute DC magnitude expressed as a percentage of channel RMS.
RMS_before / RMS_afterRoot-mean-square amplitude before and after correction.
Peak_before / Peak_afterAbsolute peak amplitude before and after correction.
Peak_dBFS_before / Peak_dBFS_afterPeak level converted to dBFS when the peak is non-zero.

The Info window also reports per-channel DC, RMS and peak values, plus the largest residual global DC after correction.

Peak warning: subtracting DC can increase the absolute peak in one polarity. If the corrected peak exceeds ±1, the script warns but deliberately does not normalize or limit the Sound.

Visualization

When Draw_visualization is enabled, the Picture window follows the AudioTools analysis style and shows:

For multichannel Sounds, the displayed waveform is the channel with the largest RMS before correction. The correction itself is still applied independently to every channel.

Why the trajectory matters: the global correction removes one constant value. A changing local mean after correction indicates time-varying baseline drift rather than residual constant DC.

Outputs

OutputWhen createdPurpose
<source>_ZeroDCAlwaysCorrected Sound with exact per-channel mean removed.
ZeroDC_MeasurementsCreate_measurement_table enabledPer-channel before/after DC, RMS, peak and dBFS measurements.
Picture-window QC pageDraw_visualization enabledBefore/after waveform comparison, local-mean trajectory and QC summary.

At the end of the script, the original Sound and corrected Sound are selected together in the Objects window.

What is preserved

Notes & limitations

Citation

Praat AudioTools: Cohen, S. (2026). Praat AudioTools: An Offline Analysis–Resynthesis Toolkit for Experimental Composition.