www.gusucode.com > signal 案例源码程序 matlab代码 > signal/ModifiedDataAndAutocorrelationMatricesExample.m

    %% Modified Data and Autocorrelation Matrices
% Generate a signal composed of three complex exponentials embedded in
% white Gaussian noise. Compute the data and autocorrelation matrices using
% the |'modified'| method.

% Copyright 2015 The MathWorks, Inc.


%%

n = 0:99;
s = exp(i*pi/2*n)+2*exp(i*pi/4*n)+exp(i*pi/3*n)+randn(1,100);
m = 12;
[X,R] = corrmtx(s,m,'modified');

%%
% Plot the real and imaginary parts of the autocorrelation matrix.

[A,B] = ndgrid(1:m+1);
subplot(2,1,1)
plot3(A,B,real(R))
title('Re(R)')
subplot(2,1,2)
plot3(A,B,imag(R))
title('Im(R)')