ip_02_07.m
Upload User: loeagle
Upload Date: 2013-03-02
Package Size: 1236k
Code Size: 0k
Development Platform:

Matlab

  1. % MATLAB script for Illustrative Problem 2.7.
  2. echo on
  3. N=256;                  % number of samples
  4. deltaf=0.1;             % frequency separation
  5. f=[0:deltaf:(N/2)*deltaf, -(N/2-1)*deltaf:deltaf:-deltaf];
  6.                         % Swap the first half.
  7. Sy=1./(1+(2*pi*f).^2);          % sampled spectrum
  8. Ry=ifft(Sy);                % autocorrelation of Y
  9. % Plotting command follows.
  10. plot(fftshift(real(Ry)));