unrecognized function or variable 'helperspe​echSpectro​grams'

3 次查看(过去 30 天)
I am using the helperspeechSpectrogram function in a Speech Emotion Recognition progam, and I have the toolboxes installed required for this function.
I am using another function, helperReadSPData, from the same toolboxes which works without errors. if anyone could help me out with what is going wrong here, it would be a big help.
segmentDuration=60000*(1/16000);
frameDuration=0.046;
hopDuration=0.023;
numBands=128;
epsil=1e-6;
scadts_Train=transform(adsTrain,@(x)helperReadSPData(x))
XTrain=helperspeechSpectrograms(scadts_Train,segmentDuration,frameDuration,hopDuration,numBands);
scadts_Test=transform(adsTest,@(x)helperReadSPData(x));
XTest=helperspeechSpectrograms(scadts_Test,segmentDuration,frameDuration,hopDuration,numBands);
  5 个评论
Rimsha Muzaffar
Rimsha Muzaffar 2022-7-13
should we take another class to define this function or define them in same
this one na
function x = helperReadSPData(x)
% This function is only for use Wavelet Toolbox examples. It may change or
% be removed in a future release.
N = numel(x);
if N > 8192
x = x(1:8192);
elseif N < 8192
pad = 8192-N;
prepad = floor(pad/2);
postpad = ceil(pad/2);
x = [zeros(prepad,1) ; x ; zeros(postpad,1)];
end
x = x./max(abs(x));
end
I am actually confused where to write this
Adam Danz
Adam Danz 2022-7-13
MATLAB has to know that helperReadSPData exists. One way to do that is to put the function in an m-file and store the m-file on your matlab path (perhaps in the same folder you are working in). Another way to do that is to define the function at the end of the m-file you're working in. For more info, see Create Function in Files from the documentation.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Speech Recognition 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by