Ok so I have been curious about this ever since I've been messing around with PD:
What does the dB represent?
What is its reference?
Why not use the dBfs scale (0dB is the clipping ceiling and everything below is measured negative) if we're running digital?
What dB value in PD is equivalent to unity gain?
I should have asked this a long time ago but perhaps some insight will come of it.
Regards, Phil
Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs
Le 21 Mai 2005 12:51, Phillip Stearns a écrit :
What does the dB represent? What is its reference?
http://en.wikipedia.org/wiki/Decibels
It is a "dimensionless unit", relative to some 0 dB reference.
Why not use the dBfs scale (0dB is the clipping ceiling and everything below is measured negative) if we're running digital?
What dB value in PD is equivalent to unity gain?
100dB is unity gain in PD: http://www.crca.ucsd.edu/~msp/techniques/latest/book-html/node17.html -- Marc
Phillip Stearns wrote:
Ok so I have been curious about this ever since I've been messing around with PD:
What does the dB represent?
What is its reference?
Why not use the dBfs scale (0dB is the clipping ceiling and everything below is measured negative) if we're running digital?
the most important reason to not use technical dB but dB with an offset is (i think) because of MIDI: MIDI gives us values between 0..127; it is very hard to express negatice numbers with MIDI-values. pd is a child of max (on next-computers) which was the first patcher-language and which was a lot about MIDI (please forgive me...); to stay compatible with old patches (*.pat loader) and (more important) an established paradigm, pd still uses "midi-dB"
another important thing is, that "0" midi-dB means "-infinity" technical dB (this is: absolute silence); "-infinity" is very impractical within a technical system. "100" midi-dB equals "0" technical dB (unity gain), and is a very easy to remember value (something like "100%") (and to talk about real MIDI-values again: you still have a headroom of +27dB for amplification of low signals)
in musical applications -100dB can normally considered to be silent, thus the narrowing of the scale does not really matter.
the conversion is:
{ 100 - dB(midi) : dB(midi)>0
dB(techn) = { { -inf : dB(midi)<=0
{ 100 + dB(techn) : -100<dB(techn)
dB(midi) = { { 0 : -100>=dB(techn)
mfg.a.sdr IOhannes
Le 21 Mai 2005 13:54, IOhannes m zmoelnig a écrit :
Phillip Stearns wrote:
Why not use the dBfs scale (0dB is the clipping ceiling and everything below is measured negative) if we're running digital?
the most important reason to not use technical dB but dB with an offset is (i think) because of MIDI: MIDI gives us values between 0..127; it is very hard to express negatice numbers with MIDI-values.
I believe it has more to do with 16 bits digital audio than MIDI. http://en.wikipedia.org/wiki/Decibels#6_dB_per_bit:
6 dB per bit In digital audio, each bit offered by the system doubles the (voltage) resolution, corresponding to a 6 dB ratio. For instance, a 16-bit (linear) audio format offers a theoretical maximum of (16 x 6) = 96 dB, meaning that the maximum signal (see 0dBFS, above) is 96 dB above the quantization noise.
Since 96 db is near 100 dB, using 100dB as a maximum means that 4 dB would be the level of the quantization noise for 16 bits audio.
Earlier, I should have mentionned this reference from Miller's book: http://www.crca.ucsd.edu/~msp/techniques/latest/book-html/node6.html The first equation, for 16 bits resolution: 20 * log(1/65536) = -96.33 dB But, as Miller explains: "In digital audio a convenient choice of reference, assuming the hardware has a maximum amplitude of one, is a0 = 10^-5 = 0.00001 so that the maximum amplitude possible is 100 dB, and 0 dB is likely to be inaudibly quiet at any reasonable listening level. Conveniently enough, the dynamic range of human hearing--the ratio between a damagingly loud sound and an inaudibly quiet one- is about 100 dB."
-- Marc
Marc Lavallée wrote:
Le 21 Mai 2005 13:54, IOhannes m zmoelnig a écrit :
Phillip Stearns wrote:
Why not use the dBfs scale (0dB is the clipping ceiling and everything below is measured negative) if we're running digital?
the most important reason to not use technical dB but dB with an offset is (i think) because of MIDI: MIDI gives us values between 0..127; it is very hard to express negatice numbers with MIDI-values.
I believe it has more to do with 16 bits digital audio than MIDI.
well, yes: i guess it is, as miller says "conveniently enough" that we want to control a range of (at least) 100dB and MIDI gives us 127 values. the fact that 100dB is just the range that is covered by 16bit audio shouldn't have too much effect on whether we use values between -100 and 0 (which would go neatly with technical dB) or use values 0..100 (which is not very technical) additionally pd has nothing to do with 16bit audio: signals are floating point (well, they are 16bit on pdas...); it is just the audio-card that will convert it to a fixed point format (like 24bit on the hammerfall)
it just turned out to work very simply and intuitively when using midi-dB (i prefer to refer to pd's dB as such) with quite everything (this is: human perception, 16bit audio and MIDI)
mfg.a.dr IOhannes
Le 22 Mai 2005 05:14, IOhannes m zmölnig a écrit :
it just turned out to work very simply and intuitively when using midi-dB (i prefer to refer to pd's dB as such) with quite everything (this is: human perception, 16bit audio and MIDI)
For those not using MIDI (which I believe is the case of most PD users), midi-dB is not that intuitive... And I don't see any reference about midi-dB in Miller's book. I can believe that midi-dB is handy and make sense, but I used MIDI and I don't understand your explanation (and the conversion pseudo code).
If 128 values are used to control a 0-100 dB range, it means that the midi-dB resolution is 0.78 dB. For 16 bits audio, the range is 0-96 dB, so the midi-dB resolution is 0.75. For 24 bits audio, the range is 0-144 dB, so the midi-dB resolution is 1.125 dB. Is that correct? -- Marc
Marc Lavallée wrote:
Le 22 Mai 2005 05:14, IOhannes m zmölnig a écrit :
For those not using MIDI (which I believe is the case of most PD users), midi-dB is not that intuitive... And I don't see any reference about
hmm: i guess a lot of pd-users have no idea about technical dB too. so for them it should be just an abstract "unit", with 100 ("%" ??) being unity gain. i (normally) do not use MIDI and i don't have problems with it; however, i agree that it is confusing, especially if you have some knowledge about technical dB, and try to figure out whether to use "real" dB, "midi" dB or rms.
midi-dB in Miller's book. I can believe that midi-dB is handy and make sense, but I used MIDI and I don't understand your explanation (and the conversion pseudo code).
the pseudo code says: MIDIdB == dBfs + 100 that is all. the only thing that complicates the pseudo-code was, that i tried to express that "0" midi-dB (which is "-100" dBfs) is set to 0.0 rms (which is "-infinity" dBfs) by definition!
If 128 values are used to control a 0-100 dB range, it means that the midi-dB resolution is 0.78 dB. For 16 bits audio, the range is 0-96 dB, so the midi-dB resolution is 0.75. For 24 bits audio, the range is 0-144 dB, so the midi-dB resolution is 1.125 dB. Is that correct?
WHY ?
dB is a relative measure. +1dBfs == +1dB(midi) == +1dB(16bit) == +1dB(32bit) == ~ *1.12 (rms)
128 midi-values are *not* mapped to a 0..100 dB range; instead they are mapped to a -100..+28 dBfs range. this is what i meant by "28dB headroom" for amplifying low signals.
you cannot just map one range to another range.
mfg.asd.r IOhannes
PS: if someone can explain what i mean in a better english i would be greatful.
Le 22 Mai 2005 15:22, IOhannes m zmoelnig a écrit :
dB is a relative measure. +1dBfs == +1dB(midi) == +1dB(16bit) == +1dB(32bit) == ~ *1.12 (rms)
128 midi-values are *not* mapped to a 0..100 dB range; instead they are mapped to a -100..+28 dBfs range. this is what i meant by "28dB headroom" for amplifying low signals.
you cannot just map one range to another range.
I understand now. Thanks! But midi-dB resolution (1dB) is much too small; interpolation is required to smooth volume transitions from the lowest possible value to a certain level of amplification.
MIDI is almost obsolete, but I'm not sure we have a fast enough communication link to directly map the full dynamic range of 24/96 audio cards. Maybe with OSC and a UDP ethernet link... (but that's another question).
Le 22 Mai 2005 15:39, Miller Puckette a écrit :
I didn't have MIDI in mind at all when making the dbtorms, etc., objects.
Marc
hi marc
Marc Lavallée wrote:
I understand now. Thanks! But midi-dB resolution (1dB) is much too
small;
interpolation is required to smooth volume transitions from the lowest possible value to a certain level of amplification.
what do you mean by 'too small'? our ears hardly hear the difference of 1dB. from that point of view, 127 steps are enough. on the other hand, interpolation is needed anyway. it's not only a matter of the stepsize, but also of the time intervalls between different dB-values. depending on what interface (for example: guis in pd) you use, this intervall is too big, so that it's no way to use all steps of the scale.
roman
Le 22 Mai 2005 16:58, Roman Haefeli a écrit :
hi marc
Marc Lavallée wrote:
I understand now. Thanks! But midi-dB resolution (1dB) is much too
small;
interpolation is required to smooth volume transitions from the lowest possible value to a certain level of amplification.
what do you mean by 'too small'? our ears hardly hear the difference of 1dB. from that point of view, 127 steps are enough.
In the good old days when MIDI was hot, I remembered hearing the steps when changing the volume rapidly with a MIDI fader. Maybe I was hearing the difference between a few consecutive steps instead of each steps. I was using consumer-grade equipment, the maximum volume was too high, and I don't know if the scale was linear or logarithmic...
With midi-dB, as explained by IOhannes, the useful range is 0-100, the last 27 steps are reserved to apply some amplification. With 127 steps instead of 100, it gives more precision. I agree that a fader with the full resolution of digital audio is useless, and that 127 steps is enough in most situations. I also use a 127 value slider to change the volume in my audio patches. But when modulating the amplitude of an audio signal with some control data, more rapidely than with a volume fader, 127 steps are not enough.
on the other hand, interpolation is needed anyway. it's not only a matter of the stepsize, but also of the time intervalls between different dB-values. depending on what interface (for example: guis in pd) you use, this intervall is too big, so that it's no way to use all steps of the scale.
Changing the volume smoothly with a low resolution fader works, and with good interpolation its perfect, but not too rapidly because the interpolation must measure the time between each steps.
i usuallly use a square scale, which is somehow betweeen logaritmic and linear scale.
Interesting.
what is a good way? i mean, which scale is used by good mixers like neve?
This article concludes that dBm (electrical power), not dB SPL (Sound Pressure Level, used by Miller) is the one used in the sound recording industry: http://www.modernrecordingtechniques.com/about/excerpt.php
I guess it's only a matter of preferences...
-- Marc
Marc Lavallée wrote:
Le 22 Mai 2005 15:22, IOhannes m zmoelnig a écrit :
dB is a relative measure. +1dBfs == +1dB(midi) == +1dB(16bit) == +1dB(32bit) == ~ *1.12 (rms)
128 midi-values are *not* mapped to a 0..100 dB range; instead they are mapped to a -100..+28 dBfs range. this is what i meant by "28dB headroom" for amplifying low signals.
you cannot just map one range to another range.
I understand now. Thanks! But midi-dB resolution (1dB) is much too small;
yes of course. but that has been a midi-problem for ages. (btw. there are some 9bit MIDI-interfaces out there, so you get 0.25dB resolution which is quite ok) and you get tons of resolution in a range where you don't need it at all (e.g: who cares for 1dB resolution at -90dBfs ??) i think there is a nice [fadtorms] object in the iemlib, which has some very non-linear scale: gives you a lot of resolution around 0dBfs and less resolution at very low or very high values.
interpolation is required to smooth volume transitions from the lowest possible value to a certain level of amplification.
but i think this might heavily depend on what kind of signals you are trying to amplify.
MIDI is almost obsolete, but I'm not sure we have a fast enough communication link to directly map the full dynamic range of 24/96 audio cards. Maybe with OSC and a UDP ethernet link... (but that's another question).
MIDI is definitely not the choice (unless you really love it); i use FUDI most of the time (because i am too lazy to install OSC)
Le 22 Mai 2005 15:39, Miller Puckette a écrit :
I didn't have MIDI in mind at all when making the dbtorms, etc., objects.
That was my impression. Thanks for setting that straight.
yes, good to kow.
anyhow, it really turned out to be "conveniently enough" usable with MIDI.
mfg.a.sdr IOhannes
I didn't have MIDI in mind at all when making the dbtorms, etc., objects. dB as a _gain_ is correctly normalized as 0 dB = unity gain. But dB as an amplitude measure can have any fixed reference point. I simply thought that 0-100 was a convenient range to work in. It's easy to adapt the dbtorms object to use a different range if desired, and perhaps it would be smart to make optional arguments to specify the unity-gain level and the cutoff level in dB (default, 100 and 0).
It turns out that dB is usially not the best a way to range an amplitude control anyway.
cheers Miller
On Sun, May 22, 2005 at 02:17:39PM -0400, Marc Lavalle wrote:
Le 22 Mai 2005 05:14, IOhannes m zmölnig a écrit :
it just turned out to work very simply and intuitively when using midi-dB (i prefer to refer to pd's dB as such) with quite everything (this is: human perception, 16bit audio and MIDI)
For those not using MIDI (which I believe is the case of most PD users), midi-dB is not that intuitive... And I don't see any reference about midi-dB in Miller's book. I can believe that midi-dB is handy and make sense, but I used MIDI and I don't understand your explanation (and the conversion pseudo code).
If 128 values are used to control a 0-100 dB range, it means that the midi-dB resolution is 0.78 dB. For 16 bits audio, the range is 0-96 dB, so the midi-dB resolution is 0.75. For 24 bits audio, the range is 0-144 dB, so the midi-dB resolution is 1.125 dB. Is that correct? -- Marc
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Miller Puckette wrote:
It turns out that dB is usially not the best a way to range an amplitude control anyway.
what is a good way? i mean, which scale is used by good mixers like neve? i usuallly use a square scale, which is somehow betweeen logaritmic and linear scale.
0 - 1 | [t f f] | / [* ] | 0 - 1
i wonder, if there is an *official* usefull scale.
roman