# Normalize and DC offset correction

Currently “Normalize” and “DC offset correction” are bundled into the same effect (“Effect menu > Normalize”).

There are currently two wiki proposal pages concerning these effects.

In order to move these proposals forward (and realising that not all users have accounts on the wiki) I’ve started this topic for discussion about these features.
If you have any thoughts or preferences regarding these effects, here’s an opportunity to put your views forward.

Actually there is a third proposal in the Wiki (which) in the interests of fairnessI include here:

Personally I do not support this proposal, as it blinds users with poor sound cards to the fact that they have DC offset on their signal.

WC

That appears to be available as standard for Vista/Win7 users through the sound “enhancements”. Rather than pushing that as an Audacity feature we should perhaps mention this Windows feature in the documentation.

It’s possibly not required on Mac if their reputation for decent quality recording is true, so between Vista, Win 7 and Mac OS X that’s about 95% of users that don’t need the feature, then of the other 5% many will have hardware that does not produce any significant offset.

I notice that proposal has no “backers” listed - does anyone really want it or can we discount that proposal?

There is more than one way to achieve DC offset correction.

The two usual methods are:

1. Make the average of positive sample values equal to the inverse of the sum of negative sample values.
2. Limit the frequency range to greater than zero.

These two methods do not have identical results, and each has its pros and cons.

Method 1 is mathematically correct but it cannot cope with “DC drift”. If the offset is not constant then after “correction” there will still be an offset throughout most of the track. In this test wave there is a gradually increasing offset:

Method 1 correction produces this:

The average offset is now zero, but there is a large negative offset at the beginning of the track and a large positive offset at the end of the track. This is the method that Audacity uses.

Method 2 is achieved by using a low frequency high-pass filter. The result on the same test wave is like this:

In some situations this second method is clearly preferable.

Does this mean that I should be re-thinking my current lack of support for Option 3 above???

Peter.

A default HP filter on all input will introduce phase shift in the entire audible band. No worse, of course, than putting a capacitor in series with the input in a real circuit, but probably something we should avoid doing behind the user’s back.

My first impression is that http://wiki.audacityteam.org/wiki/Proposal_Normalize_%26_Amplify_Consolidation is confusing, with two value boxes that may or not be interlinked, and two distinct behaviours for the two effects. I can see why Amplify and Normalize became separate effects - the user chooses the one appropriate to their need. As an aside, is Normalize one of those effects that came in with Cleanspeech? It is useful in chains, where Amplify is not.

Thus I think we need to get DC offset removal right, either be defaulting to a HP filter, or fixing the calculation. The case of DC drift is so rare that I think we can deal with that on the forum as a very special case - I can only remember one post in the past 2 years where it was an issue, and IIRC it had to do with ADPCM decoding, not real DC drift in an analog circuit.

– Bill

I’ll take that as a no then Bill

Support for option 3 still witheld

Peter.

Ha, I remember that - the offset was climbing a stairway to heaven
Yes such an extreme offset is rare, but I don’t think that it is particularly rare for there to be some (much less severe) drift in the offset voltage. If offset drift does occur then it’s likely to be fairly small, but then on a not-totally-rubbish sound card the DC offset is likely to be small. If “Offset Correction” was available as an effect in its own right (in its own name) then I think that a high-pass option would be a useful addition. (Cool Edit Pro offered both “absolute” DC offset correction and high-pass offset correction).

+1
but can anyone confirm that this option is “usually” (or “always”) available in Windows sound enhancements? It was available in the last two Vista machines that I looked at.

+1

Thinking about it some more, I remember seeing faults in analog circuits where they produce a very slowly varying DC offset - in effect sub-sonic AC (well below 1 Hz). So I would support a separate DC offset removal tool that offers the two options of calculation or HP filter. The question remains how we inform the user of the more appropriate choice.

– Bill

In most cases I’d expect the “conventional” DC offset to be the best choice, so that would need to be the default.
The “alternative” method (hp filter) would be documented in the manual (context sensitive help would be nice but we don’t have that yet).

There is a downside to using a hp filter for offset removal - with an ordinary (say 10 Hz) high-pass filter, any offset at the start of the selection will be “missed” (though this “limitation” also has a silver lining - more later but I need to go out now).

Edgar-rft commented in this thread that he could not think of any cases where normalizing would be required without DC offset correction. (He also said that he would be hesitant to remove it as an option).

Thinking about this I can only think of non-audio examples where it might be desirable to normalize without DC offset removal, so is there really a case for retaining “DC offset removal” as an option or would it be better if Normalize always removed DC offset? (the latter would probably be simpler for novice users).

For non-audio signal processing additional (non-audio) effects can be supplied by optional plug-ins, but as Audacity is intended for audio, perhaps it is best if built in effects are optimised for audio.