how to plot bar overall 1/3 octave by Poctave() as show below(bar color red)?

53 ビュー (過去 30 日間)

採用された回答

Mathieu NOE
Mathieu NOE 2021 年 2 月 26 日
hello
see example below :
Fs = 44.1E3;
xInp = rand(1,2^16);
% Compute the octave spectrum of the same signal, but this
% time, use a A-Weighting filter. Visualize the spectrum.
[P,f] = poctave(xInp,Fs,'FrequencyLimits',[20 20E3],'FilterOrder',6,'BandsPerOctave',3,'Weighting','A');
f = round(f);
figure(1), bar(1:length(f),20*log10(P)+200)
xlabel('Hz');
ylabel('Amplitude (dB(A))');
set(gca,'XTick',1:length(f));
set(gca,'XTickLabel',f);set(xticklabel_rotate([],60),'color',get(gca,'xcolor'));
  10 件のコメント
ngoc quy hoang ngoc quy
ngoc quy hoang ngoc quy 2021 年 2 月 27 日
編集済み: ngoc quy hoang ngoc quy 2021 年 2 月 27 日
ok
but i think the poctave function output is sound power not Sound Pressure so Sound Pressure Level (SPL) does not calculate instead it will calculate sound power level ( LwA) by LwA = 10*log10(P/P0) with P0 = 10e-12 w.
I want to hear your opinion on that matter??
Mathieu NOE
Mathieu NOE 2021 年 3 月 1 日
yeap ! you're right !!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMeasurements and Spatial Audio についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by