This is an example of peak normalization (correct me if I am wrong)..

We have a song in a (stereo 16bit)wavfile called mysong.wav

we scan the wav files and find these values..(they are fake of course)

MaxRightSample = 16000;
MinRightSample = -8000;

MaxLeftSample = 15876;
MinLeftSample = -10000;


We then choose the loudest sample from either side..

LeftTotal = MaxLeftSample;

if( abs(MinLeftSample) > MaxLeftSample)
  LeftTotal = abs(MinLeftSample);

RightTotal = MaxLeftSample;

if( abs(MinRightSample) > MaxRightSample)
  RightTotal = abs(MinRightSample);

 Now we calc the am factors

Leftampfactor = (double)65535 / (double)LeftTotal ;
Reftampfactor = (double)65535 / (double)RightTotal ;

Now we go back through the wav file and multiply the ampfactor to all 
the samples (left and right).


-David Swigger



-----Original Message-----
From:   Mark Stephens [SMTP:[EMAIL PROTECTED]]
Sent:   Monday, January 17, 2000 1:12 PM
To:     [EMAIL PROTECTED]
Subject:        RE: [MP3 ENCODER] Normalization routine?

Howdy

You mentioned the limited value of normalization that only looks at peak
levels to normalize, especially if there are just a couple of loud passages
in a song.  If you first applied peak limiting, the loud passages would be
compressed to be just a little louder than the normal passages.  Second,
apply normalization to it to bring the loudest passage up to the maximum
level.

As you may know, normalization just brings the loudest portion of the wav
file up to maximum level (or whatever level you specify) and adjusts
everything else equally.  Normalization is like turning up the volume, no
dynamic range is lost.  The difference between the quietest sounds and the
loudest sound is the same.  If you change the difference (dynamics) of the
music then you are either compressing or expanding.  By letting the peaks
clip, you are using distortion to reducing the dynamic range of the music.
Peak limiting just reduces the output for any waveform above a threshold
that you set, without adding clipping distortion.

AFAIK many classical radio stations use peak limiting compression during
broadcast to reduce the output of the loud passages without effecting the
quiet ones.  POP stations tend to use broadband compression, and you can
hear it during quiet passages when it sounds like someone is turning up the
volume and you hear all the background noise.  Of course, with todays super
quiet digital equipment it isn't really that noticeable any more.

mark stephens



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Richard A. Smith
Sent: Monday, January 17, 2000 12:55 PM
To: [EMAIL PROTECTED]
Subject: RE: [MP3 ENCODER] Normalization routine?


On Mon, 17 Jan 2000 11:03:57 -0500, Mark Stephens wrote:

>Wouldn't that be compression, instead of normalization?

I don't really know.  I don't have much experience with compressors.
Will a compressor boost a quiet waveform and allow it to clip?

>I still have an old DBX compressor/expander box where I can choose to
>compress over the whole range, or set it to peak limiting mode and only
>compress over a certain threshold.  It sounds like it might be valuable to
>have a routine that can do peak limiting, and then normalize the result.

I don't understand what you mean by peak limiting and why it would be
necessary if you are going to normalization.



--
Richard A. Smith                         Bitworks, Inc.
[EMAIL PROTECTED]               501.846.5777
Sr. Design Engineer        http://www.bitworks.com


--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to