フィルターのクリア

Why my calculation result is not matrix result?

2 ビュー (過去 30 日間)
ZHU z
ZHU z 2022 年 4 月 10 日
コメント済み: ZHU z 2022 年 4 月 13 日
The result of my matla calculation is a numerical value instead of a matrix result, so I can't draw the relevant graph(figure3):
——The output of AweightedSPL and SPL is a numerical rather than a matrix result,So I can't plot the "frequency-AweightedSPL "spectrum. Input audio has been uploaded
can someone help me see where the code can go wrong?How should I change it?
thanks~
[x,fs] = audioread('123.wav');
L = length(x);
y=fft(x);
f =fs/2.*linspace(0,1,L/2+1);
y = y(1:L/2+1);
plot(f,abs(y),'b');
A= filterA(f);
yweighted = A'.*y;
figure(1);
plot(f,abs(yweighted),'r');
xweighted = ifft(yweighted);
xweighted = real(xweighted);
tempdata = xweighted;
tempL = length(tempdata);
temp1 = fft(tempdata)/tempL*2;
figure(2);
plot(f,abs(temp1),'g');
linelevel =1.8;
preampout = abs(xweighted.*1.8);
preampin = preampout;
pressure = 1000.*preampin./22.78;
pref = 0.00002;
pressure = sqrt(mean(pressure.^2));
AweightedSPL =20.*log10(pressure/pref);
figure(3);
plot(f,AweightedSPL,'b');grid
  8 件のコメント
ZHU z
ZHU z 2022 年 4 月 12 日
thank you @Matt J
Sorry for the long wait, the input file has been uploaded~
ZHU z
ZHU z 2022 年 4 月 13 日
thank you, @Jeffrey Clark
I will go check it

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio Toolbox についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by