% sum of three real Fourier sinusoids plus noise: n = (0:199).' ; s = 4.7*cos(0.12*pi*n - 1.3) + ... 3.8*cos(0.19*pi*n + 0.8) + ... 5.1*cos(0.23*pi*n + 2.4) + ... 2.0*randn(size(n)) ; plot(n,s) S = fft(s) ; bar(n,abs(S)) , grid % same sinusoids, no noise: n = (0:199).' ; s = 4.7*cos(0.12*pi*n - 1.3) + ... 3.8*cos(0.19*pi*n + 0.8) + ... 5.1*cos(0.23*pi*n + 2.4) ; plot(n,s) S = fft(s) ; bar(n,abs(S)) , grid bar(n, angle(S).*(abs(S)>1e-10)) , grid % change above to non-Fourier sinusoids: n = (0:199).' ; s = 4.7*cos(0.12321*pi*n - 1.3) + ... 3.8*cos(0.19642*pi*n + 0.8) + ... 5.1*cos(0.23419*pi*n + 2.4) ; plot(n,s) S = fft(s) ; bar(n,abs(S)) , grid % single complex non-Fourier sinusoid: n = (0:19).' ; f1 = (0 : 0.05 : 0.95).' ; f2 = (0 : 0.001 : 0.999).' ; s = exp(j*0.317*2*pi*n).' ; stem( f1, abs(fft(s)), 'k' ) ; hold plot( f2, abs(fft(s,1000)) ) ;