DC offset and Audio Filtering
- On April 20, 2019
- Audio distortion, Audio filtering, DC offset
In this post we describe a phenomena called “DC offset” in audio signal and its impact on the quality of audio filtering like noise reduction, echo cancellation and automatic gain control. We say that a signal has a DC offset distortion when the mean amplitude of its waveform is not zero. A normal voice is a symmetric sine signal, where the high peak equals to the low peak. In case there is a DC offset, the sine signal is not symmetric and the average over time is not zero. Furthermore, the signal is not zero also during silence periods. It is very easy to notice a DC offset when looking at the waveform of an audio signal. In the following waveform sample, you can see that the signal with the DC offset seems to be a little below the middle both during speech areas and during silence areas.
What is causing a DC offset?
In many cases a DC offset is caused by the analogue parts of the system that add a DC current to the audio signal. Such analogue parts might be any analogue component that is part of the audio path like: the sound cards or the microphone. Other possible causes for a DC offset might be the interface between two different hardware components, each with a different ground level.
Why should we care?
Now that we understand the DC offset distortion and its cause, the next question is why this type of distortion to the audio signal should bother us? If we just listen to the audio signal AS-IS, then we may not always notice the existence of a DC offset, we may hear it as some ambient noise, or hear unclean saturated signal or maybe hear it as a click sound during start/stop. However, when audio with a DC offset is being processed, for example for noise reduction, echo cancellation or gain control, the DC offset might cause significant issues and undesirable results.
Let’s look at few examples:
- Amplifying the signal may have two undesirable results: (a) The signal will not be amplified to the required level because of the headroom that the DC offset takes that is leading to miscalculation of the highest peak (b) The increase in the DC offset will lead to higher ambient noise.
- Compressing the signal or performing any other process that uses the absolute signal levels may lead to distortions and other non-desirable results.
- Noise calculation that is based on estimating the level of ambient noise will not work properly.
- Any editing of the audio signal may lead to irregularities and click sounds because of the possible inconsistencies in the DC level.
What should be done?
As we have seen DC offset can cause significant damage to the audio signal especially during signal processing. Therefore, the DC offset should be eliminated, preferable before any manipulation is done on the audio signal. Removal of DC offset is not a constant addition to the audio signal since DC offset tends to change over time due to changes in temperature or pressure. The DC offset should be removed with caution. A simple high pass filters is tricky to use because some of the zero Hz signal (which is the DC) might be actually part of the original signal.
There are special offline tools that can remove a DC offset. Audacity, for example, enables removal of a DC offset as part of its Normalization utility. However this is done on offline audio files only. Doing such processing on on-line volatile DC offset is much trickier.
SoliCall’s audio filtering is equipped with a built-in mechanism that identifies and eliminates DC offset. This mechanism also handles cases in which the DC offset is changing over time. Therefore, the output after SoliCall’s audio processing is free of any DC offset.
Although at a first glance the DC offset distortion may not seems to be a big problem, as we have seen in this post the DC distortion may introduce significant audio quality issues in the system once the audio is being processed, compressed etc. Therefore, since most audio systems have analogue components that can introduce a DC offset, you should make sure your system has a signal processing component that is capable of eliminating in real-time any volatile DC offset.