Help - Search - Members - Calendar
Full Version: Volume denormalization
Hydrogenaudio Forums > Lossless Audio Compression > Lossless / Other Codecs
jhenderson
Hi -

Unfortunately, I have ripped a substantial number of my CDs to FLAC format with volume normalization enabled. For classical music, this causes the noise floor to change noticably between tracks, which I find noisome.

So, I'd like to reverse the normalization. But, I haven't found a utility to accomplish this. If I proceed and write one, shouldn't it be possible to open the FLAC, parse the audio information into a buffer and calculate the minimum amplitude value within the buffer and use that as a scalar value to be subtracted from each sample within the buffer to effectively denormalize back to zero?

To elaborate, here's why I think it should be possible:

During the normalization process, the track is scanned in its entirety to determine the maximum amplitude present - call this Tmax. The maximum amplitude that a 16-bit Redbook track can contain is 2^16 or 65535 - call this RBmax. One only needs to add the scalar value of (RBmax-TMax) to each sample in the track to effect the normalization. Isn't this correct?

To undo this process, why couldn't I scan the track to determine the minimum amplitude present - call this Tmin. I should only need to subtract the scalar value of (Tmin) from each sample in the track to effect the denormalization.

What's wrong with this approach?

Thanks,
Jim
Sunhillow
QUOTE (jhenderson @ Jun 17 2005, 11:03 PM)
During the normalization process, the track is scanned in its entirety to determine the maximum amplitude present - call this Tmax. The maximum amplitude that a 16-bit Redbook track can contain is 2^16 or 65535 - call this RBmax. One only needs to add the scalar value of (RBmax-TMax) to each sample in the track to effect the normalization.  Isn't this correct?
*


No, it isn't, unfortunately. During normalisation, each value is multiplied with a factor to achieve max values of ~32767. Let's say it is factor 2. The minimum amlitude value of 0, multiplied by 2 will still be zero.

If you want the exact values, the best thing would be to rip the CDs again. Another possibility would be to determine the max volume of each track and correct the volume of your ripped tracks accordingly - but sure won't save any time.

You complained about the noise floor changing from track to track. Did you already try to bring it to a constant level? But again, this won't save much time, and the results will never be accurate.
jhenderson
QUOTE (Sunhillow @ Jun 17 2005, 04:02 PM)
QUOTE (jhenderson @ Jun 17 2005, 11:03 PM)
During the normalization process, the track is scanned in its entirety to determine the maximum amplitude present - call this Tmax. The maximum amplitude that a 16-bit Redbook track can contain is 2^16 or 65535 - call this RBmax. One only needs to add the scalar value of (RBmax-TMax) to each sample in the track to effect the normalization.  Isn't this correct?
*


No, it isn't, unfortunately. During normalisation, each value is multiplied with a factor to achieve max values of ~32767. Let's say it is factor 2. The minimum amlitude value of 0, multiplied by 2 will still be zero.

If you want the exact values, the best thing would be to rip the CDs again. Another possibility would be to determine the max volume of each track and correct the volume of your ripped tracks accordingly - but sure won't save any time.

You complained about the noise floor changing from track to track. Did you already try to bring it to a constant level? But again, this won't save much time, and the results will never be accurate.
*



Are you saying that normalization is implemented as a scalar multiply instead of an add? If so, why is this done when a simple addition of the delta value I discussed initially would have sufficed?

If normalization were implemented as an addition, the process would introduce no signal degradation, and would still permit the loudest passage of all tracks to play at a consistent level (32767). It would be perfectly reversable.

A scalar multiply would munge the track dynamics - it would effectively be a simple expander. Is that the case?
ChiGung
@jhenderson - Youre not making sense there. Its pretty fundamental that you need to multiply or divide to change the volume without distorting. All the levels must remain the same in relation to each other to avoid distortion, which multiplying by the same amount satisfies.

If the noise floor of all the tracks was the same before normalising , it would be possible to write code to find and calculate the strength of the noise floors and use that to rescale the tracks.

*Just a bit above the tracks ~1/8thofA second minimum volume/gross travel^[?]
jhenderson
Thanks, I understand now.
ChiGung
QUOTE (jhenderson @ Jun 18 2005, 05:29 AM)
Thanks, I understand now.

I forget what scalar means wacko.gif ..better take a break wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.