clg t1=[0:255]*2*pi/7; % t1 gives a frequency that is not one of the FFT freqs t2=[0:255]*2*pi/8; a1=1; a2=.5; x=a1*exp(i*t1) + a2*exp(i*t2); subplot(211); plot([0:255],real(x(1:256))); v=axis; axis([0 256 v(3) v(4)]); title('Re(X) Time Series'); axis; subplot(212); y=fft(x); plot([1:256],2*log10(abs(y))); v=axis; axis([0 256 v(3) v(4)]); xlabel('Frequency index j'); ylabel('LOG_10(ABS(Y^2))'); axis; title('Periodogram of X with N=256'); %gtext('X = exp(i*[1:256]*2*pi/7) + 0.5*exp(i*[1:256]*2*pi/8)'); print -deps pgram3