Error converting Logical to Char (Horzcat Error)

8 次查看(过去 30 天)
afe = audioFeatureExtractor( ...
'SampleRate',fs, ...
'FFTLength',512, ...
'Window',hann(frameSamples,'periodic'), ...
'OverlapLength',frameSamples - hopSamples, ...
'barkSpectrum',true);
numBands = 50;
setExtractorParams(afe,'barkSpectrum','NumBands',numBands,'WindowNormalization',false);
In this line of code, I am receiving an error of converting logical to char (Horzcat error). How to solve this issue?
  4 个评论
Rik
Rik 2021-4-20
fs = 16e3; % Known sample rate of the data set.
segmentDuration = 1;
frameDuration = 0.025;
hopDuration = 0.010;
segmentSamples = round(segmentDuration*fs);
frameSamples = round(frameDuration*fs);
hopSamples = round(hopDuration*fs);
overlapSamples = frameSamples - hopSamples;
FFTLength = 512;
numBands = 50;
afe = audioFeatureExtractor( ...
'SampleRate',fs, ...
'FFTLength',FFTLength, ...
'Window',hann(frameSamples,'periodic'), ...
'OverlapLength',overlapSamples, ...
'barkSpectrum',true);
setExtractorParams(afe,'barkSpectrum','NumBands',numBands,'WindowNormalization',false);
disp('completed without error')
completed without error
Which release are you using?

请先登录,再进行评论。

回答(1 个)

Walter Roberson
Walter Roberson 2021-4-20
编辑:Walter Roberson 2021-4-20
It is a bug in some versions of Audio System Toolbox. In later versions the line
if isscalar([varargin{:}])
has been replaced with
numin = numel(varargin);
if numin==1 && isscalar([varargin{:}])
I will post exact line numbers once I finish installing the old version to check against.
The problem was fixed by no later than R2020b
  7 个评论
Walter Roberson
Walter Roberson 2022-1-20
R2020b was the first release to support WindowNormalization.
In R2020a and before, there is a 'Normalization' parameter that can be set to 'area' or 'bandwidth', but this is not the same thing.
In R2020b, 'Normalization' was renamed to 'FeatureBankNormalization', and 'WindowNormalization' was added.
I do not seem to find any information as to what WIndowNormalization actually does.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by