Linear Predictor: Nature of Linear Prediction
Linear Predictor: Nature of Linear Prediction
Linear Predictor: Nature of Linear Prediction
where aks are the linear prediction coefficients and s(n) is the
windowed speech sequence obtained by multiplying short time
speech frame with a hamming or similar type of window which is
given by,
i.e.
a = lpc(x,3);
est_x = filter([0 -a(2:end)],1,x);
e = x-est_x;
[acs,lags] = xcorr(e,'coeff');
subplot(1,2,1)
plot(1:97,x(4001:4097),1:97,est_x(4001:4097),'--' ),grid
title 'Original Signal vs. LPC Estimate'
xlabel 'Sample number', ylabel 'Amplitude'
legend('Original signal','LPC estimate')
subplot(1,2,2)
plot(lags,acs), grid
title 'Autocorrelation of the Prediction Error'
xlabel 'Lags', ylabel 'Normalized value'
Output:
Description
LPC function:
[a,g] = lpc(x,p)
x(n)=a(2)x(n1)a(3)x(n2)a(p+1)x(np)
Algorithm:
Xa=b
where
Filter function:
y = filter(b,a,x)
a(1)y(n)=b(1)x(n)+b(2)x(n1)+
+b(Nb)x(nNb+1)a(2)y(n1)a(Na)y(nNa+1)
if
a = 1;
b = [1 1/2 1/3 1/4];
y(n)=x(n)+1/2*x(n-1)+1/3*x(n-2)+1/4*x(n-3)
Xcorr fuction:
Cross correlation is a standard method of estimating the degree
to which two series are correlated.
The cross-correlation of two complex functions and of a real
variable , denoted is defined by
(1
)
where denotes convolution and is the complex conjugate of . Since convolution is defined by
(2)
it follows that
(3)
(4)
(5)
(6)
If or is even, then
(7)
a = lpc(x,7)
est_x = filter([0 -a(2:end)],1,x)
e = x-est_x
[acs,lags] = xcorr(e,'coeff')
subplot(1,2,1)
plot(1:7,x(1:7),1:7,est_x(1:7),'--'),grid
title 'Original Signal vs. LPC Estimate'
xlabel 'Sample number', ylabel 'Amplitude'
legend('Original signal','LPC estimate')
subplot(1,2,2)
plot(lags,acs), grid
title 'Autocorrelation of the Prediction Error'
xlabel 'Lags', ylabel 'Normalized value'
Output:
Application: In Differential pulse code modulation
Let x(t) be the signal to be sampled and x(nTs) be its samples. In this
scheme the input to the quantizer is a signal
where x^(nTs) is the prediction for unquantized sample x(nTs). This predicted
value is produced by using a predictor whose input, consists of a quantized
versions of the input signal x(nTs). The signal e(nTs) is called the prediction error.
By encoding the quantizer output, in this method, we obtain a modified version of
the PCM called differential pulse code modulation (DPCM).
The receiver consists of a decoder to reconstruct the quantized
error signal. The quantized version of the original input is
reconstructed from the decoder output using the same predictor
as used in the transmitter. In the absence of noise the encoded
signal at the receiver input is identical to the encoded signal at
the transmitter output. Correspondingly the receive output is
equal to u(nTs), which differs from the input x(nts) only by the
quantizing error q(nTs).