Question about the inability to display 16k octave bands(1/3 oct band)?

1 Ansicht (letzte 30 Tage)
I use matlab vslm toolkit, the octave plot after analyzing audio can't show 16k octave band, if I want to show 16k octave band, how do I modify the code? I added "16k" to the fctxt, but it didn't work.
How should I change the code?
The VSLM toolkit is attached and the relevant code is as follows~
thanks a lot~
figure1.Missing 16k octave band
This is the code for octave,The cause of the problem may have been found, can anyone tell me how to change it?
switch handles.band.type
case 'oct'
fcb=1000*2.^((-6:1:4));
tstring=sprintf('%s Weighted Octave Band LEQ computed using ANSI Filters',handles.weighting);
dstring='Please Wait Analyzing Data Using ANSI Octave Bands';
tickmarks=1:length(fcb);
otherwise
fcb=1000*2.^((-19:1:13)/3);
tstring=sprintf('%s Weighted 1/3 Octave Band LEQ computed using ANSI Filters',handles.weighting);
dstring='Please Wait Analyzing Data Using ANSI 1/3 Octave Bands';
tickmarks=2:3:length(fcb);
end
J= fcb<(fs/2/sqrt(2)); % this may be causing the problem ————————————————@VBBV
fc=fcb(J); % here the number of elements changes again ————————————————@VBBX
Hd=zeros(length(fc));
% Divide spectrum by Nseg to convert from sum to average over all segments
% note: apply no weighting for NC/RC computations
Pxx=SB./Nseg;
% generate the octave band center frequencies from 16-8khz (or 4 kHz for
% a sampling rate of 22050 Hz
if fs==22050
fc=1000*2.^((-6:1:2));
fctxt={'16','32','63','125','250','500','1k','2k','4k'};
else
fc=1000*2.^((-6:1:4));
fctxt={'16','32','63','125','250','500','1k','2k','4k','8k','16k'};
end
% compute the upper and lower 1/3 octave band frequencies
fl=fc*2^(-1/2);
fu=fc*2^(1/2);

Akzeptierte Antwort

VBBV
VBBV am 14 Mai 2022
Bearbeitet: VBBV am 14 Mai 2022
if fs==22050
fc=1000*2.^((-6:1:2));
fctxt={'16','32','63','125','250','500','1k','2k','4k'};
else
fc=1000*2.^((-6:1:4)); % change this
fctxt={'16','32','63','125','250','500','1k','2k','4k','8k','16k'}; % 11 elements
end
in the 2nd condition, you have 11 elements
  5 Kommentare
ZHU z
ZHU z am 14 Mai 2022
Okay, thanks, I'll check again.
thank you~ @VBBV
ZHU z
ZHU z am 15 Mai 2022
thanks @VBBV, I solved the problem, I deleted the "/2".

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by