Audio Signal dB levels Matlab

audioMATLABsignal

I am trying to develop a GUI in MATLAB to allow the presentation of a tone.

One of the input parameters is the dB the user wants.

So the way I tried to do this is:

y = factor * sin (2*pi*500*t);

The "factor" parameter is: 10^(x/20).

I tried using the y values and do a mag2db conversion on matlab to see if I am getting the db back. And I do!

However, if I put in 0dB, I am still obtaining a tone.
I have to go down as low as -50dB to not get a tone.

So my question is : Is there some kind of a way to make it such that there is no tone at 0dB and below.

Thank you so much for your help.

Appreciate it!

Note: my PC speakers are at MAX level.

Best Answer

It is not correct to have 0dB represent "off". dB is a relative scale and 0 dB, effectively, means "the same as some reference value", and your reference value can't be silence.

A more common implementation of such a control would be to have 0dB represent maximum volume and negative values represent lower output. This is what you see on all professional audio equipment analog and digital. You would then use -Infinity for no output. Many applications approximate this by making the slider go from 0 at the top to -96 [1] dB or so at the bottom. When the user slides the slider down all the way, the application will turn off the output.

[1] 96 is chosen because that's the approximate dynamic range of 16-bit audio. In the presence of dither, this value has no real special meaning, though, so some applications use an even larger value.

Related Topic