Confused about dB in MATLAB
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Daniel Shub
2013-7-31
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!