0

I'm currentyl building something like a tiny software audio synthesizer on Window 7 in c++. The core engine is running and upon receiving midi events it plays notes, changes programmes, etc. What puzzles me at the moment is where to put the 0 db reference sound pressure level of the output channels.

Let's say the synthesizer produces a sinewave with 440 Hz with an amplitude of |0.5f| . In order to calculate the sound level in db I need to set the reference level (0 db). Does anyone know something like a default for this?

codencandy
  • 1,701
  • 1
  • 10
  • 20

2 Answers2

3

When decibel relative to full scale is in question, AKA dBFS, zero dB is assigned to the maximum possible digital level. A quote from Wiki:

0 dBFS is assigned to the maximum possible digital level.[1] for example, a signal that reaches 50% of the maximum level at any point would peak at -6 dBFS i.e. 6 dB below full scale. All peak measurements will be negative numbers, unless they reach the maximum digital value.

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • Note that 0 dB full scale is not the same thing as 0 dB SPL (Sound Pressure Level). – Paul R Oct 10 '11 at 14:10
  • @Paul, sure you are correct. Additionally to this, I would suggest to consider loudness level metric as specified by EBU R 128 specification http://tech.ebu.ch/loudness. – Roman R. Oct 10 '11 at 15:46
1

First you need to be clear about units. dB on its own is a ratio, not an absolute value. As @Roman R. suggested, you can just use 0 dB to mean "full scale" and then your range will be 0 dB (max) to some negative dB value which corresponds to the minimum value that you are interested in (e.g. -120 dB). However this is just an arbitrary measurement which doesn't tell you anything about the absolute value of the signal.

In your question though you refer to dB SPL (SPL = Sound Pressure Level), which is an absolute unit. 0 dB SPL is typically defined as 20 µPa (RMS), which is around the threshold of human hearing, and in this case the range of interest might be say -20 dB SPL to say +120 dB SPL. However if you really do want to measure dB SPL and not just an arbitrary dB value then you will need to calibrate your system to take into account microphone gain, microphone frequency response, A-D sensitivity/gain, and various other factors. This is non-trivial, but essential if you actually want to implement some kind of SPL measuring system.

Paul R
  • 208,748
  • 37
  • 389
  • 560
  • thanks for your precise answer. I know most of this out of working with acustical measurement systems. The term dBFS which is what I really meant didn't come to mind so I asked here. – codencandy Oct 10 '11 at 15:20