- #1

- 199

- 0

## Homework Statement

From what I understand, the array output of the FFT of a function in time represents the frequency contributions of different frequencies with the first output coming from 0 freqeuncy, 2nf from the 1st fundamental frequency and so on.. if so, then why does this code(which is for plotting the fft against frequency) give contributions from various frequencies to the cosine function when we learned in Fourier theory that the only frequency contributiong to a sinusoid are those of its own frequency:

t = -20:20;

x= cos (6*pi*t/13+pi/3);

y = fft(x);

tn = (-length(y)+1)/2 : (length(y)-1)/2;

stem (tn, y);