mercredi 12 décembre 2018

Matlab Gaussian Process

I need your help to calculate with Matlab the autocorrelation of a process x, that has been inside a filter h. Let's call the output from the filter y

  1. x is a GAUSSIAN process not a signal, a process with endless realization, but for Matlab we can set N=1000 realization for ex. The process is white inside the band 1Khz but white PROCESS (not signal or noise) DOESN'T mean: mean = 0 but just that the autocorrelation will be something like
    k*sinc(Bt) + mean^2
  2. h = filter = exp(-t/0.1)

that's what I've tried:

   % declaring time and frequency axis
   Fs = 10000;
   t = 0 : 1/Fs : 1-1/Fs; 
   L = length(t);
   dF = Fs/L; 
   Freq = -Fs/2 : dF : Fs/2-dF; 

   % N realization
   N=1000; 
   % mean (for ex 3)
   med = 3;
   % standard deviation (for ex 10)
   dev = 10; 
   % process
   p = randn(N,L)*dev + med;


   % filter
   filter = exp(-t/0.1);


  % y = out from the filter 
  for i=1:N
      y = conv( p(i,:) , filter );  
      plot(y)
      hold on
  end

 % autocorrelation
 for i=1:N
      autocorr = xcorr( y(i,:) , y(i,:) );  
      plot(autocorr)
      hold on
  end

I don't get why it doesn't work. Please some of you can help me?




Aucun commentaire:

Enregistrer un commentaire