![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/532494/image.png)
how to plot bar overall 1/3 octave by Poctave() as show below(bar color red)?
47 次查看(过去 30 天)
显示 更早的评论
采纳的回答
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'));
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/532494/image.png)
10 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Octave 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!