Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet


Discussion Groups

Discussion Groups | Matlab DSP | AR modeling again

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

AR modeling again - M J - Apr 25 8:49:43 2006



Nishit, Amit and Blessy
   
  At first, thank you for your quick reply!
  I suppose that my problem about input signal wasn't enough clear. In the meantime I managed
to solve it by avoiding to use input signal at all and therefore partly using solution that
Nishit suggested.
  I'm sending now how this look like. 
  Thanks again.
  Regards,
  Miljana!
   
  %Generating autocorrelation function according to AR(p) model
eps=0.000000001;
fm=50;
fs=1000;
N=200;
%Generating autocorrelation function according to Jakes' model
for p=1:N
    vector(p)=besselj(0,2*pi*fm*(p-1)/fs);
end
%Generating Toeplitz Matrix
%P is model order
%Adding a small bias, eps, to the autocorrelation matrix to overcome
...the ill conditioning of Yule-Walker equations
autocorr_mat=toeplitz(vector(1:P))+eye(P)*eps;
AR_parameters=-inv(autocorr_mat)*vector(2:P+1)';
%Generating autocorrelation function
autocorr_ar(1:P+1)=vector(1:P+1);
for k=P+2:N
    s=0;
    for m=1:P
        s=s-AR_parameters(m)*autocorr_ar(k-m);
    end 
end
plot([0:N-1]',autocorr_ar);



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )