- #1

- 143

- 0

Here is code to take the fourier transform of [tex]cos(2*\pi*x*f_0)[/tex], which should be [tex]\frac{\delta (f + f_0) + \delta (f - f_0)}{2}[/tex]

I can *almost* get it, but not quite. See spikes at +/- .001, when should be at +/- .1 Any help would be appreciated.

Code:

```
x = 0:.1:9.9;
%N=100, T=10
y = cos(x*2*pi/10);
Y = fft(y);
X = (0:99)/1000 - 50/1000;
Y = fftshift(Y);
plot(X,real(Y));
```

Using [tex]H \left( \frac{n}{NT} \right) = \sum_{k=0}^{N-1} h(kT) e^{-i2\pi n k / N} [/tex] for n = 0, ..., N - 1.