How to Apply DC Offset Correction in Ecasound
This article explains how to correct DC offset in an audio signal
using Ecasound. While Ecasound does not have a single dedicated
"dc-offset" command, DC offset correction is natively achieved using the
high-pass filter operator (-efh), as well as through LADSPA
plugin operators (-el). Below is a straightforward guide
detailing which operators to use, how they work, and practical
command-line examples.
Native Correction:
The High-Pass Filter (-efh)
In digital signal processing, DC offset is direct current energy
sitting at 0 Hz. The standard native way to remove DC offset in Ecasound
is by applying a high-pass filter using the -efh
operator:
-efh:cutoff_frequencySetting the cutoff frequency below the human hearing threshold (typically between 5 Hz and 20 Hz) removes the 0 Hz DC bias completely without attenuating the audible bass content of your audio.
Example Usage
To remove DC offset from an input file named input.wav
and output the cleaned audio to output.wav, run:
ecasound -i input.wav -efh:10 -o output.wavIn this command:
-i input.wavdefines the audio source.-efh:10applies a high-pass filter with a cutoff frequency of 10 Hz, blocking the DC offset.-o output.wavdesignates the destination file.
LADSPA DC Correction Operator
(-el)
If your workflow requires an algorithmic DC removal filter rather
than a standard high-pass filter, Ecasound can host LADSPA plugins via
the -el operator:
-el:plugin_label,param1,param2,...Using Steve Harris’s LADSPA plugin set (SW_PLUGINS), you can load the
dedicated DC removal filter (dcRemove):
ecasound -i input.wav -el:dcRemove -o output.wavSummary
- Built-in Operator: Use
-efh:cutoff_frequency(recommended value:10to20) to eliminate DC bias using Ecasound's native filter engine. - Plugin Operator: Use
-el:dcRemoveif you prefer dedicated LADSPA plugin processing.