# How do you show the Discrete Time Fourier Transform of $x[n]=\cos(2\pi f_0n)$ is $\frac{1}{2} \delta(f+f_0) + \frac{1}{2}\delta(f-f_0)$? [duplicate]

How do you show the Discrete Time Fourier Transform of $x[n]=\cos(2\pi f_0n)$ is $\frac{1}{2} \delta(f+f_0) + \frac{1}{2}\delta(f-f_0)$?

Here is my thought process:

The definition of DTFT in my textbook is: $$X(f) = \sum_{n=-\infty}^{\infty} x[n] e^{-j2\pi fn}\quad\text{for}\quad \frac{1}{2} \leq f \leq \frac{1}{2}$$

Therefore for this specific problem we have: $$X(f) = \sum_{n=-\infty}^{\infty} \cos(2\pi f_0n) e^{-j2\pi fn}$$

I know from Euler's identity that $$\frac { e^{i\theta} + e^{-i\theta}}{2} = \cos\theta$$

So we can convert the cosine above into the complex exponential like so: \begin{align} X(f) &= \sum_{n=-\infty}^{\infty} \frac { e^{j2\pi f_0n} + e^{-j2\pi f_0n}}{2} e^{-j2\pi fn}\\ &=\sum_{n=-\infty}^{\infty} e^{-j2\pi n(f-f_0)} + e^{-j2\pi n(f+f_0)} \end{align}

This looks very close to the $\delta(f+f_0) + \frac{1}{2}\delta(f-f_0)$ I'm looking for - but I'm not sure how to get there.

## marked as duplicate by Matt L., MBaz, A_A, Peter K.♦Nov 30 '17 at 15:53

• Here is a useful answer related to your question. – Gilles Nov 29 '17 at 21:12

The signal $x[n] = \cos(\omega_0 n)$ is neither absolutely summable nor square summable, therefore its DTFT formally does not exist; i.e., the DTFT sum does not converge to anything as it diverges to infinity.

However because of the extreme importance of such a signal in the context of both the theory and the practice of the signal processing, we would like to express its DTFT in an adequate and consistent way that is transparent under all formal operations (including FT theorems) of signal processing theory. Such a representation makes use of the impulse function which can be connected to the DTFT from the following observation:

Let $x[n] = 1$ for all $n$ be a discrete-time signal whose DTFT is $X(\omega)$ given by: $$X(\omega) = \sum_{n=-\infty}^{\infty} 1 e^{-j \omega n}$$

In order to evaluate this above sum, we make use of CTFS (continous time Fourier series) remembering the fact that DTFT $X(\omega)$ is a periodic and continuous function of frequency $\omega$. Then the above sum is re-interpreted as a CTFS synthesis relation :

$$X(\omega) = \sum_{n=-\infty}^{\infty} a_n e^{-j \frac{2\pi}{W} n \omega }$$ where $\frac{2\pi}{W}$ is the fundamental frequency with the fundamental period being $W = 2\pi$, and $a_n = 1$ are the continuous-time Fourier series coefficients of the periodic function $X(\omega)$. Now, from continuous time Fourier series (CTFS) pairs it can be seen that the periodic signal $X(\omega)$ whose CTFS coefficents are all $1$, i.e., $a_n = 1$ is the impulse train :

$$X(\omega) = 2\pi \sum_{n=-\infty}^{\infty} \delta(\omega - 2\pi n)$$

and by using the CTFS analysis equation we can see that the coefficients $a_n$ are given as: $$a_n = \frac{1}{2\pi} \int_{-\pi}^{\pi} \left( 2\pi \sum_{n=-\infty}^{\infty} \delta(\omega - 2\pi n) \right) e^{-j \frac{2 \pi}{2\pi} \omega n } d\omega = \frac{1}{2\pi} \int_{-\pi}^{\pi} 2\pi \delta(\omega) e^{-j \omega n } d\omega = 1$$

This last line not only shows that $a_n = x[n] = 1$ for all $n$ but also shows that the DTFT $X(\omega)$ of $x[n]=1$ is $$x[n] = 1 \implies X(\omega) = 2\pi \delta(\omega) .$$

Now what remains is to decompose $x[n] = \cos(\omega_0 n)$ into its complex exponentials and use the following DTFT property:

$$x[n] \leftrightarrow X(\omega) \implies x[n]e^{j\omega_0 n} \leftrightarrow X(\omega - \omega_0)$$

replacing $x[n]$ with $1$ yields: $$1 \leftrightarrow 2 \pi \delta(\omega) \implies 1 \cdot e^{j\omega_0 n} \leftrightarrow 2\pi \delta(\omega - \omega_0)$$

Then finally one can see that: $$x[n] = \cos(\omega_0 n) = 0.5 \left( e^{j \omega_0 n} + e^{-j \omega_0 n} \right) \implies X(\omega) = \pi \left( \delta( \omega - \omega_0) + \delta(\omega + \omega_0) \right)$$

• I hope you teach somewhere so that your explanation skills reach the masses. atleast the DSP masses !!!!! – mark leeds Nov 30 '17 at 3:25
• @markleeds Thanks Mark! I'm glad if I was helpful... – Fat32 Nov 30 '17 at 9:58
• incredibly helpful. – mark leeds Dec 1 '17 at 19:05