|DC offset is a mean amplitude displacement from zero. In Audacity it can be seen as an offset of the recorded waveform away from the center zero point. DC offset is a potential source of clicks, distortion and loss of audio volume.
DC offset is an offsetting of a signal from zero. On the Audacity waveform it would mean that the waveform in default view appears not to be centered on the 0.0 horizontal line, as in the upper track in this image:
The cause is almost always a fixed voltage offset somewhere in the audio chain before the analog signal is converted to digital values. For example, the voltage may be directly caused by a faulty sound card, or may come from some other device that is attached to the card. Any offset is normally so small as to not be noticeable, but with defective or poor quality hardware it may become large enough to be a problem.
|You should check for and remove offset in any audio you are working with before editing it, even if the audio is not your own recording but an audio file you have obtained elsewhere.|
- A sound that has DC offset will not be at its loudest possible volume when amplified or normalized. This is because the offset reduces the headroom between the peak level of the audio and the maximum possible level without clipping. This problem can possibly extend to the mix as a whole, since a sound with DC offset and a sound without DC offset will have DC offset when mixed.
- DC offset can cause inaudible low level distortion. The distortion may become audible when effects that change the frequency content are applied, or when exporting the audio to a size-compressed format like MP3.
- DC offset can cause audible clicks where audio sections are cut and pasted together, and can cause a click on playback at the start and end of the track, even without editing.
- DC offset will become worse if the recording is amplified.
Removing DC offset
Audacity's Normalize Effect
Audacity's DC removal method performs a calculation to make the average positive and negative sample values equal. To perform removal, choose Amplify and Normalize for what Normalize does and when to use it)., with the option checked "Remove any DC offset (center on 0 vertically)". Uncheck the "Normalize maximum amplitude..." box unless you want to run Normalize as well (see
An alternative method is to use dcRemove in the plugin.org.uk suite of LADPSA plug-ins for Windows, Mac or Linux. This uses an example of a High Pass Filter to remove the DC (0 Hz) component from the audio.
Cancel DC offset in sound devices on Windows
Newer Windows PCs may have a DC offset cancellation feature when recording from the built-in sound inputs. To check for or enable this:
- Right-click over the speaker icon in the , or click , then the "Recording" tab;
- Right-click over empty space, show disabled and disconnected devices, then right-click over each device and enable it;
- Right-click or select each device, choose "Properties" then look in the "Enhancements" tab;
- If there is no "Enhancements" tab, look in the sound device's own control panel in "Hardware and Sound".
Limitations of offset removal
Audacity's DC offset removal method could potentially create a new offset and therefore a click in some rare cases. Two cases are noteworthy:
Steve: 31Oct12 I have heard many rumours that asymmetric waveforms can produce DC offset when "corrected", but no actual evidence to support that claim. I think it is a myth and without evidence to the contrary we should not perpetuate this belief. I think that it is worth mentioning asymmetric waveforms somewhere (I'm not sure where yet) as this is a common point of confusion re. DC offset.Gale: 31Oct12 From my trawl to find the "asymmetrical" link I added, the idea that DC offset exists in asymmetric brass waveforms and should be corrected therein is commonplace. Do you agree with that, to begin with? Wherever else we mention asymmetric waveforms I think we must do so here, if only to debunk any myths.
But...I find I have six complaints in my inbox about Audacity's DC offset removal creating clicks in brass and wind recordings. They were sent to me personally, not to mailing lists. There was no evidence by way of audio files, though two of them said dcremove fixed the offset without adding clicks. I've written to these people again today, hopefully someone "may" respond. But where are the online complaints, on -devel or the Forum, and is there not aural evidence there? Also see this public post by yourself where you state unequivocally Audacity's offset correction can create clicks in asymmetrical waveforms. Can we not test this? You play the violin and I understand that can produce asymmetical waveforms too? I am sceptical that there is no problem here.
- Steve: 31Oct12 What can I say, I think I was wrong. At the time I believed that was true, but have repeatedly failed to prove it, nor have I seen any compelling evidence to support it. I have seen some rare cases that appear to support the idea but are actually misleading. Asymmetric waveforms are not uncommon in real world recording, and are easy to synthesize. A high pass filter will often change the shape of a waveform due to phase shifts, and this can add to the illusion and confusion. I've posted a sample on the forum to illustrate. http://forum.audacityteam.org/viewtopic.php?p=195648#p195648
- Gale 06Nov12: ToDo-2 We need to discuss naturally occurring offset recordings as I am sure this wants to be covered here. I asked if Steve agrees that DC offset exists in asymmetric brass waveforms. Does non-constant offset naturally exist in brass waveforms? And since these waveforms frequently "look" offset (even if they are not), does the user need to apply a DC removal tool to them (let's say your Nyquist tool, as that seems without flaw at present)? In other words, is a naturally occurring offset as dangerous as one caused by defective hardware?
- where only part of the audio is offset, for example if absolute silence with no offset has been inserted into an offset recording.
- Steve: 31Oct12 It can be easily demonstrated that the Audacity method of DC offset correction will not perform well if the "bias" is not constant. In audio engineering, "DC offset" is usually taken to mean a constant offset. The method for correcting that is used by the Audacity Normalize effect assumes that this is the case.
- Gale 06Nov12: ToDo-2 If http://forum.audacityteam.org/download/file.php?id=6434 is an example of a file with non-constant offset, or we have another example, this needs IMO to have an image in the description below of "offset is not constant".
- Steve: 01Nov12 The newly updated Nyquist DC offset tool handles non-constant bias better than either the Audacity Normalize effect or the LADSPA effect.
- where the offset is not constant. Strictly speaking this is not DC offset, it is sub-sonic modulation or "slowly changing DC bias", but over a short time period it looks very much like DC offset.
In the case where some sections of the audio are clearly offset and some not, the solution in Audacity is to first carefully select each section of non-offset audio then useto split it a new track. Then remove the offset from the remaining audio, and paste the non-offset audio back. Use before split and paste if the non-offset audio is not absolute silence.
- Steve: 31Oct12 dcremove will generally perform better than "absolute" offset removal in cases where the bias is not constant, though it may not avoid the problem of clicks. In particular it cannot correct DC offset at the very beginning of the selection and it will not remove clicks if the offset suddenly changes.
High Pass DC removal as in LADSPA dcRemove may well remove offset without adding new clicks if the offset is not constant.
|Note: Removing offset after the event does not reinstate the original loss of headroom. Without offset it would have been possible to record louder, so with greater dynamic range and greater signal-to-noise ratio. It is always preferable to try to find and fix the source of the offset in the hardware. Updating the sound device drivers might help, too.|