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 Kommentare

Walter Roberson
Walter Roberson am 31 Mär. 2011
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.
Walter Roberson
Walter Roberson am 31 Mär. 2011
I think you should expand on what you mean by "its not working correctly".
Prince Ankit Singh
Prince Ankit Singh am 20 Feb. 2012
LPC is a technique for compression of data in speech processing. Then hw can we implement it as a speech recognition technique?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

devika asokan
devika asokan am 1 Apr. 2011

0 Stimmen

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 Kommentar

Walter Roberson
Walter Roberson am 1 Apr. 2011
What would happen if the first sample or the last sample in the first segment were zero? What would the error become?

Melden Sie sich an, um zu kommentieren.

Tags

Gefragt:

am 31 Mär. 2011

Bearbeitet:

am 17 Okt. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by