Removing DC offset adds noise

I am running Audacity 1.3.12-beta on Debian Squeeze using the on-board sound which Alsamixer reports as an ATI IXP card with a Realtek ALC658D chip. I am trying to record some Minidiscs using an analogue cable from the Minidisc headphone out to the computer’s line in. With the Minidisc volume on full, and the line-in capture level very low (everything else muted, of course) the results are surprisingly good. Really very good, in fact, with very little noise or hum indeed. There is only one problem: a small DC offset of around -42dB on both channels. I have never seen on-board sound, or a cheap sound card, where this was did not happen.

Of course I can easily run the recordings through Audacity’s normalize filter to remove this DC bias; it’s small enough that I lose minimal volume (do I mean range? gain? – sorry, I’m not an expert!) by doing so. But the problem is that the DC offset removal (with no normalization) seems to be adding white noise. If I record a few seconds of silence from the line in, then select a chunk in the middle and just remove the DC offset from that, when I play the whole thing back I hear almost complete silence, except in the middle chunk, where there is noticeably higher noise.

Does anyone have any idea what’s going on? I thought the DC offset removal filter would in effect subtract (or add) the same fixed value from every sample in the file, to lower (or raise, depending on the offset) the entire wave a little. How can this add noise?

I’ve tried the alternative high-pass filter method for removing the DC bias and this, too, adds noise, which fades in as the wave curves down from its original offset position to the zero line. Also recording as 16-bit or 32-bit float makes no difference.

I would be very grateful for any ideas on how to overcome this, as frankly the slightly pop at the beginning and end of playback (owing to the DC offset) is preferable in my mind to the noise added by removing it. But I’d obviously rather have neither pops nor hiss!



Try adding a brief fade at the beginning and end of the work. That will suppress the pop if we don’t resolve it any other way.

You’re not losing any significant volume with errors that small. There is a just noticeable shift in volume when you make a 6dB error in signal. That’s half and double.

Dig around in Audacity Preferences and turn off anything with “dithering” in the title.

edit: You might restart Audacity after you do that.


Thanks for the help, Koz. Suppressing the pop the way you suggest works, of course, but I’d rather not do that because obviously it only works when you play the whole track from beginning to end. Stop or start in the middle and you’re ‘jumping in’ to the offset and you still get the pop.

I’m at a different PC now but will try looking for dithering options next time. I know there are some to do with sample rate conversion, but that wouldn’t seem relevant here. I’ll report back. In the meantime, any one else any ideas what’s going on?

What is the “bit format” for your track?
The default is 32 bit float and with that setting there should be absolutely no added noise from using the Normalize effect if you have “DC offset correction” enabled and “Normalize maximum amplitude” disabled. This is irrespective of the dither settings as dither is not applied when processing 32-bit float data.

When audio has a huge DC offset, it cannot get very loud. When audio gets louder, the noise becomes more perceivable. Maybe this is the “problem”?

Try normalizing it, but only remove the DC offset. If that does not cause any problems, then you just have a noisy configuration.

My original post was already quite long, so I simplified one factor which I didn’t think could be relevant. Sorry – it now looks like it is. In fact there are two sound cards in the PC: the on-board Realtek, which I am using for recording as I stated; but there’s also a discrete C-media CMI8738 PCI card, which I am using for playback (just the usual 3.5mm analogue stereo line out: nothing fancy, nothing digital).

When I route output through the C-media card in Preferences > Devices, I hear the bizarre added noise, exactly as described in my original post. When, however, I route the output through the Realtek device (i.e. if I use the same on-board sound for recording and playback, and don’t use the supposedly superior discrete card at all) there is no noise added by the Normalize filter. This is playing back exactly the same file, through the same amp and headphones; just the sound card has changed!

So the Audacity filter is not adding noise. The sections with DC offset and the sections without DC offset sound exactly the same (except for the small ‘pop’ at the beginning and end, of course) through the Realtek chip. But through the C-media chip, the section with the DC offset removed is considerably noisier (as if you were switching Dolby noise reduction on and off on an old tape machine). This is the same file, remember.

My best guess is that there is some wild linearity problem in the DAC of the C-media chip which causes signals nearer the zero crossover to be over-emphasized in comparison with the same signal elsewhere in the range. Or perhaps a bug in the C-media driver that’s not passing quite the correct numbers in to the DAC near the zero crossover? Anyone ever heard of anything like this? Or have any better explanations?

This is a new one for me, though your suggestion of “perhaps a bug in the C-media driver that’s not passing quite the correct numbers in to the DAC near the zero crossover” sounds like the most likely explanation. I’ve seen quite a lot of weird and apparently inexplicable problems that have been due to driver bugs.

One other possibility that comes to mind is if the C-media device is physically located to a source of electrical noise it could be picking up interference that only becomes apparent in the absence of an audio signal. If this is a PCI sound card you could try moving it to a different PCI slot (preferably as far away from the power supply and video card as possible).