Csound Csound-dev Csound-tekno Search About

[Csnd] So scale is there, but how do I automate finding the peak?

Date2009-11-11 00:51
FromTobiah
Subject[Csnd] So scale is there, but how do I automate finding the peak?
The utility that I remember from years ago, had the option of scanning the
file to find the largest sample value and automatically scaling based on
that.  I could easily use a separate utility that reports the peak.  I know they
have existed, but my memory fails, as does a very quick Google search.

R.D.  Has stated twice that it is not prudent to normalize to the maximum
sample value.  As this comes from an obviously most learned individual,
I am quite intrigued.  I've never heard any mention of this idea in any of
my limited surveys of computer music.

The reason stated is that the analog signal might clip at the amplifier.
I can make room for the idea that a properly interpreted digital signal
may have analog values that overshoot the largest digital points.  I find
it quite difficult however to accept that this thought has not crossed the
minds of the makers of DAC's, who one would imagine have allowed for
the maximum possible analog signal to travel the rest of the distance
through their devices unscathed.

I would particularly be interested in downloading a sound file through
which it can be shown that clipping is experienced at full volume, but
not at -3dB.

I've had a few soundcards over the years, who's mixer settings, when
set at full volume, would exhibit some sort of overdrive.  I would have to
suggest that it is possible that the idea of normalizing a soundfile to
less than zero dB was born out of the experience of such an analog
only phenomenon.

Tell me I'm wrong, and I will have learned.

Thanks,

Tobiah


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-11 01:47
FromRichard Dobson
Subject[Csnd] Re: So scale is there, but how do I automate finding the peak?
Tobiah wrote:
> The utility that I remember from years ago, had the option of scanning the
> file to find the largest sample value and automatically scaling based on
> that.  I could easily use a separate utility that reports the peak.  I know they
> have existed, but my memory fails, as does a very quick Google search.
> 
> R.D.  Has stated twice that it is not prudent to normalize to the maximum
> sample value.  As this comes from an obviously most learned individual,
> I am quite intrigued.  I've never heard any mention of this idea in any of
> my limited surveys of computer music.
> 


The simplest example is a full-range digital square wave.  The 
Gibbs-effect spikes at the edges of the square wave (famously seen when 
you make them additively) will exceed the peak value by an appreciable 
margin, which a dac cannot be expected to cope with accurately - digital 
peak may be very close to the width of the rail voltage. You may find 
there is a certain amount of compression going on up there, which you 
may or may not want.

It is an extreme example, but it sets the maximum overshoot a digital 
signal might generate when presented to the dac. It will not of course 
lead to "obvious" clipping, but there will be some distortion 
nevertheless, which might over time cause listeners to feel that classic 
"digital tiredness".

A digital square wave at digital peak is 3dB higher in level than a 
sinewave at digital peak (an rms measure - think "area under the 
curve").  The thing to remember about normalizing as commonly done is 
that raw amplitude scaling gains you very little. if extreme, you will 
simply boost the noise as well.  The track is not in any real sense 
"louder", and you do not get any more dynamic range. Mastering is done 
with compressors, expanders and other stuff to obtain either maximum 
subjective loudness, or maximum dynamic range (or both, somehow). And 
the best noise-shaped dithering for 16bits will gain you more dynamic 
range than a raw scaling by 1.5dB. The ear is much more sensitive to rms 
levels than to amplitude peaks.

I accept this might be a somewhat purist position, and 99% of the time 
you may normalize to very close to 0dBFS to no ill effect (depends on 
the nature of the material of course); but a blanket automatic approach 
where there is significant HF energy might just let a file slip through 
the net into clipping and those tired ears.

Richard Dobson





Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-11-11 02:11
FromMichael Gogins
Subject[Csnd] Re: Re: So scale is there, but how do I automate finding the peak?

My impression, -3 dB is sort of standard.

Mkg

On Nov 10, 2009 8:51 PM, "Richard Dobson" <richarddobson@blueyonder.co.uk> wrote:

Tobiah wrote: > > The utility that I remember from years ago, had the option of scanning the > file ...

The simplest example is a full-range digital square wave.  The Gibbs-effect spikes at the edges of the square wave (famously seen when you make them additively) will exceed the peak value by an appreciable margin, which a dac cannot be expected to cope with accurately - digital peak may be very close to the width of the rail voltage. You may find there is a certain amount of compression going on up there, which you may or may not want.

It is an extreme example, but it sets the maximum overshoot a digital signal might generate when presented to the dac. It will not of course lead to "obvious" clipping, but there will be some distortion nevertheless, which might over time cause listeners to feel that classic "digital tiredness".

A digital square wave at digital peak is 3dB higher in level than a sinewave at digital peak (an rms measure - think "area under the curve").  The thing to remember about normalizing as commonly done is that raw amplitude scaling gains you very little. if extreme, you will simply boost the noise as well.  The track is not in any real sense "louder", and you do not get any more dynamic range. Mastering is done with compressors, expanders and other stuff to obtain either maximum subjective loudness, or maximum dynamic range (or both, somehow). And the best noise-shaped dithering for 16bits will gain you more dynamic range than a raw scaling by 1.5dB. The ear is much more sensitive to rms levels than to amplitude peaks.

I accept this might be a somewhat purist position, and 99% of the time you may normalize to very close to 0dBFS to no ill effect (depends on the nature of the material of course); but a blanket automatic approach where there is significant HF energy might just let a file slip through the net into clipping and those tired ears.

Richard Dobson

Send bugs reports to this list. To unsubscribe, send email sympa@lists.bath.ac.uk with body "u...