%% Frequency Content of Complex Exponentials
% Find the frequency content in a signal composed of three complex exponentials in noise. Use the modified covariance method to estimate the correlation matrix used by the eigenvector method. Reset the random number generator for reproducible results.

rng default
n = 0:99;   
s = exp(1i*pi/2*n)+2*exp(1i*pi/4*n)+exp(1i*pi/3*n)+randn(1,100);

X = corrmtx(s,12,'mod'); 
[W,P] = rooteig(X,3)

% Copyright 2015 The MathWorks, Inc.