Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Re: Questions about dB opcodes

Date2008-04-29 18:25
FromMichael Gogins
Subject[Csnd] Re: Re: Re: Questions about dB opcodes
Decibels are a relative logarithmic measure of energy (any energy, not just sound).

The value of 0 dBfs in Csound (and in audio in general) is simply the MAXIMUM level of sound: "as loud as it can get in this setup." Hence the term, "full scale," i.e. full scale on the meter, the meter being deliberately calibrated to hit its maximum at that point. Then, the negative dB values represent decreasing levels of energy from 0 dB. In other words, decibels are a relative measure, not an absolute measure. You have to establish the energy level for 0 dB yourself.

Then to complicate matters, if there is "headroom," that is energy above the posulated MAXIMUM and is colored red on VU meters, etc. In such a context 0 dB is the energy at which the gear begins to misbehave and distort. But you can still record on tape above 0 dB, perhaps usefully for another 6 to 12 dB above 0 dB.

So, dynamic range is the number of decibels in between when the gear misbehaves because of noise at low energy, and when it misbehaves because of distortion at high energy.

In digital audio, "as loud as it can get in this setup" is simply the maximum sample amplitude, i.e. the maximum value of the sample word.

Of course, that introduces another level of relativity, because once you hit your maximum sample word, how much sound energy there actually is depends on how far up you turn your amplifier knob.

In measuring actual sound, i.e. not in AUDIO but in ACOUSTICS, another use of "dB" is as follows. We start from 0 dB as the MINIMUM level of sound: "as quiet as it can get in this setup." This is always something more than zero energy because of one sort or another of noise. (Of course just to complicate matters again, in digital audio there is no noise floor, perfectly quiet really is perfectly quiet.)  

Usually, we start by defining 0 dB as just below the quietest sound a young person can hear in a perfectly quiet room. Units defined this way are called dB(SPL) for sound pressure level. Believe me, this ain't much energy -- a few extra air molecules hitting the eardrum. There is another variant of dB(SPL) called dB(A) for A-weighted dB, which factors in the varying sensitivity of the human ear at different frequencies. 

Then we count dB(SPL) up from 0 dB to whatever. That's why you hear that room noise is 60 dB, jet engines are 140 dB, and so on. 

The dynamic range of a young person's ear from quietest to the threshold of pain is about 130 dB(A).

Professional microphones have a noise floor (self noise) of maybe 5 dB, a maximum energy of maybe 140 dB, giving a dynamic range of maybe 135 dB, which is just slightly better than the human ear. In practice it is roughly the same. That is why with training we can learn to hear every flaw in the recording process. But the best microphones are getting quieter. At the high end of the dynamic range, the ears are actually becoming injured, the microphone diaphragm is flapping in nonlinear ways, and so on.

Obviously 130 dB is within the 144 dB dynamic range of a 24 bit soundfile. There are other reasons to use floats or something with even more dynamic range, but you can be confident that if you are careful with your levels, a 24 bit soundfile or better can capture more than the sharpest ears can hear.

Hope this helps,
Mike

-----Original Message-----
>From: David Akbari 
>Sent: Apr 29, 2008 12:19 PM
>To: csound@lists.bath.ac.uk
>Subject: [Csnd] Re: Re: Questions about dB opcodes
>
>Thank you gentlemen for your clarifications regarding dBFS and how it
>is implemented in Csound 5.
>
>I'm still confused by the unit of measurement used in the ampdb()
>opcode, however. One way I could ask this question more clearly is:
>
>What is the reference equivalent value assigned to 0 dB in the ampdb()
>opcode ... is it assumed to be 20 µPascals (ie. a measure of sound in
>air)? If not, do the "non-fs" dB family of opcodes still reference the
>value defined by the 0dbfs opcode? What formulae might someone use to
>convert from specifically from decibels in Full Scale to Sound
>Pressure Level?
>
>You have all done a great job at establishing that the 0dbfs opcode
>sets the reference value for the 'fs' family opcodes, but what about
>ampdb()? Does this opcode also use the value defined by 0dbfs as its
>chosen reference value for amplitude scaling?
>
>I'm sorry for all of the questions, but I am very interested in these
>values specifically as I plan to use Csound to implement Adaptive
>Forced Choice procedures in experiments involving hearing research. I
>need to know these values so I can understand how to better approach
>the calibration of the testing equipment [software].
>
>
>Thank you for your time and consideration,
>
>David Akbari
>
>
>Send bugs reports to this list.
>To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"