Confused about dB in MATLAB

9 vues (au cours des 30 derniers jours)
Mohammad
Mohammad le 31 Juil 2013
Hi;
I am fairly new to dB manipulations and I am getting really confused with it.
So if I produce a tone in MATLAB like this:
Fs = 16000;
duration = 60;
level = -2;
freq1 = 500;
t = 0: 1/Fs : duration*(Fs-1)/Fs;
fa1 = 10^(level/20);
y1 = fa1*sin(2*pi*freq1*t)';
sound(y1,Fs);
The dB level the user needs to input is in dB-full scale because the sound is being produced digitally correct?
So if I measure the sound using a dB sound meter, which measures the level in dB-SPL, I should be getting the max dB-SPL at 0 dB-full scale correct?
However, if I go down to -6dB-full scale, the dB-SPL goes down by 10dBSPL.
How can I modify the code such that -6dB-full scale causes the dB-SPL to be reduced by 6dBSPL.
I hope I did not confuse any one lol.
NOTE: my speakers are at MAX level
Thank you very much. Ali

Réponse acceptée

Daniel Shub
Daniel Shub le 31 Juil 2013
Depends what you mean by full scale, but yes. As for what could cause a 6 dB reduction in input to give a 10 dB reduction in output there a a couple of things. Running at full scale for the soundcard and amplifier is probably not a good idea and can lead to nonlinear behaviour. Your sample rate of 16 kHz is unlikely to be the native sample rate of your soundcard. You are making a mono signal, but MATLAB converts it to a stero signal. Can you speaker handle this? Are you using your sound level meter correct?
I would connect the soundcard output to a volt meter and confirm with that.
  1 commentaire
Mohammad
Mohammad le 31 Juil 2013
Hi; Thanks for replying. Yeah the issue is with playing the sound at MAX level. If I play it at half the max it works just fine.
Thanks again.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Measurements and Spatial Audio dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by