フィルターのクリア

Undefined function or method 'minus' for input arguments of type 'struct'

2 ビュー (過去 30 日間)
aliha wasim
aliha wasim 2016 年 6 月 28 日
編集済み: Stephen23 2016 年 6 月 28 日
I am working on speech recognition.I have saved the coefficients of 4 audio files in a matrix in mat file. Now I want to compare those with a test audio file but I keep getting on this error Undefined function or method 'minus' for input arguments of type 'struct' . Can someone please guide me about how can I subtract the coefficients of tested audio sample from all the coefficients in mat file. code is below.
d=load ('Database.mat')
% line 1 loads the Database
[s1,fs] = wavread('x1.wav'); % Reading new file x1.wav
B = [1 -0.95];
s1 = filter(B,1,s1);%first order filter
[c]=melcepst(s1,fs);
n=corrcoef(c) ;% Finds the correlation coefficients
n=n(:); % writing all values in one column
n=abs(n);
dtw(1,1) = dist(1,1); % dynamic time wraping technique to see similarity between input signal and data base
dtw(d,n) = min (dtw(d-1, n-1), dtw(d-1, n), dtw(d, n-1)) + dist(d,n);

回答 (1 件)

Image Analyst
Image Analyst 2016 年 6 月 28 日
You can't use min like that, like min(num1,num2,num3). It only takes an array so enclose arguments in brackets: min([num1,num2,num3])
dtw(d,n) = min ([dtw(d-1, n-1), dtw(d-1, n), dtw(d, n-1)]) + dist(d,n);
  2 件のコメント
aliha wasim
aliha wasim 2016 年 6 月 28 日
Thank you. I have corrected my previous mistake in the code but the problem still remains as it is.
Image Analyst
Image Analyst 2016 年 6 月 28 日
We can run the debugger, if you can't do it, if you upload 'database.mat' and 'x1.wav'. I can't run your code without those two files of yours. You can speed things up if you think of these things in advance.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSignal Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by