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

조회 수: 2 (최근 30일)
ZHU z
ZHU z 2022년 5월 14일
편집: ZHU z 2022년 5월 15일
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);

채택된 답변

VBBV
VBBV 2022년 5월 14일
편집: VBBV 2022년 5월 14일
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
ZHU z
ZHU z 2022년 5월 14일
Okay, thanks, I'll check again.
thank you~ @VBBV
ZHU z
ZHU z 2022년 5월 15일
thanks @VBBV, I solved the problem, I deleted the "/2".

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Octave에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by