Confused about dB in MATLAB

조회 수: 9 (최근 30일)
Mohammad
Mohammad 2013년 7월 31일
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

채택된 답변

Daniel Shub
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.
  댓글 수: 1
Mohammad
Mohammad 2013년 7월 31일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by