t1=[1:256]*2*pi/7; t2=[1:256]*2*pi/8; a1=1; a2=.5; % this gives a frequency that is not one of the FFT freqs x=a1*cos(t1) + a2*cos(t2); subplot(211); plot(x); title('X = cos([1:256]*2*pi/7) + 0.5*cos([1:256]*2*pi/8)') sig=1; x=x+sig*randn(size(x)); subplot(212); plot(x); title(['Y_n=X_n+W_n sigma_W = ',num2str(sig)]); % print -deps ts1