MATLAB: The coefficients of the 3rd-order predictor

fir predictor

hello everyone :
i am working on an FIR predictor
i got the following sequence x(n)=[-1 -3 5 2]
and this is the code to get the autocorrelation:
x=[-1 -3 5 2];
P=length(x)-1;
rxx=xcorr(x)
N=[-P:P];
stem(N,rxx);
xlabel('Index');
ylabel('rxx');
title('The autocorrelation of x');
##############################################
and the result sequence is rxx = [-2.0000 -11.0000 -2.0000 39.0000 -2.0000 -11.0000 -2.0000]
Q/ how can i Find the coefficients of a third-order predictor???
thanx for help

Best Answer

Hey Ashmed
You might find this code useful if you are thoroughly familiar with the literature that you are studying; else this code might be difficult to grasp as it contains some serious mathematical formulations. Be advised that this is not a solution to your problem, but a guide to walk you through. The code solves a linear prediction problem with just two coefficients, i.e the coefficient vector of x is [-0.95 0.90], it is valid for any size of vector x. You can also use the matlab built in function called lpc (read about it) to solve your problem. Ask me any question if you get stuck.