i have the following code for speech recognition using lpc parameters but its not working correctly:
b = wavrecord(Nseconds*Fs, Fs, 'double');
P = n1; % Prediction order
P1 = P+1;
q = length(b);
% Length of the input speech
N = 250;
% Length of each segment is 250
betold = zeros(1,P1); % Set to zero the initial reverse prediction errors
for seg = 1:q/N, % Loop whole speech
s = b((seg-1)*N+1:seg*N); % s is for one particular segment
r = zeros(1,P1); % Set to zero the initial autocorrelation
for m = 1:P1, % Loop to compute autocorrelation
for n = 1:N-m+1,
r(m) = r(m) + s(n)*s(n+m-1);
end
end % End of the autocorrelation loop
a(1) = 0; % Beginning of Durbin's recursive method
error = r(1);
for p = 1:P,
aold = a;
q = r(p+1);
for m=1:p-1,
q = q - a(m)*r(p-m+1);
end
if(error==0)
error=1;
end
K(p) = q/error; % Reflection coefficients
error = error*(1.- K(p)*K(p));
a(p) = K(p);
for m=1:p-1,
a(m) = aold(m) - K(p)*aold(p-m);
end
end
f=q;
fw(i,:) = f;
display(fw);

3 Comments

Please edit your question, select your code and click on the 'Code {}' button. That will reformat your code so that it appears like a program to the readers.
I think you should expand on what you mean by "its not working correctly".
LPC is a technique for compression of data in speech processing. Then hw can we implement it as a speech recognition technique?

Sign in to comment.

Answers (1)

devika asokan
devika asokan on 1 Apr 2011
showing a divide by 0 warning and coefficients all coming nearly equal.also the spoken word is not being correctly recognized.
q = length(b); % Length of the input speech
N = 250;
% Length of each segment is 250
betold = zeros(1,P1);
% Set to zero the initial reverse prediction errors
for seg = 1:q/N, % Loop whole speech
s = b((seg-1)*N+1:seg*N); % s is for one particular segment
r = zeros(1,P1); % Set to zero the initial autocorrelation
for m = 1:P1,
% Loop to compute autocorrelation
for n = 1:N-m+1,
r(m) = r(m) + s(n)*s(n+m-1);
end
end % End of the autocorrelation loop
a(1) = 0; % Beginning of Durbin's recursive method
error = r(1);
for p = 1:P,
aold = a; q = r(p+1);
for m=1:p-1,
q = q - a(m)*r(p-m+1);
end
K(p) = q/error;
% Reflection coefficients
error = error*(1.- K(p)*K(p));
a(p) = K(p);
for m=1:p-1,
a(m) = aold(m) - K(p)*aold(p-m);
end
end
f=q;
fw(i,:) = f;
display(fw);

1 Comment

What would happen if the first sample or the last sample in the first segment were zero? What would the error become?

Sign in to comment.

Tags

Asked:

on 31 Mar 2011

Edited:

on 17 Oct 2013

Community Treasure Hunt

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

Start Hunting!