# The Inverse Discrete Fourier Transform

Learn how to get back to the time domain from a frequency-domain signal.

## We'll cover the following

Complex sinusoids act as building blocks for all signals. This is similar to the $x$, $y$, and $z$ dimensions that define any point in 3-D space and the red, green, and blue colors that combine to form any color.

## The DFT

We derive the DFT that takes a time-domain signal into the frequency domain. For a signal of $N$ length, $x[n]$, we have:

$X[k]=\sum_{n=0}^{N-1}x[n]e^{-j2\pi\frac{k}{N}n}, \qquad k =0,1,\cdots,N-1$

In other words, a time-domain signal is correlated with $N$ complex sinusoids having frequencies as integer multiples of $1/N$. A larger correlation output implies that the contribution of that sinusoid to that signal formation is large.

## Going back into the time domain

The **inverse discrete Fourier transform (IDFT)** is defined as:

$x[n]=\frac{1}{N}\sum_{n=0}^{N-1}X[k]e^{+j2\pi\frac{k}{N}n}, \qquad n =0,1,\cdots,N-1$

Although the expression looks similar to the DFT, there are some fundamental differences.

- The signal of interest on which the operations are performed is $X[k]$.
- The plus sign in $e^{+j2\pi\frac{k}{N}n}$ implies counterclockwise rotation. This is a beautiful mathematical expression for the idea that the signal $x[n]$ on the left-hand side is made up of complex sinusoids, each of them with a complex contribution factor of $X[k]$.
- The scaling by $1/N$ is due to the fact that a single complex sinusoid magnitude is scaled up by $N$ during a DFT operation. On the other hand, the correction by $1/N$ produces the original amplitude.

Let’s run this code to see how the inverse DFT brings the frequency-domain signal back into the time domain.

Get hands-on with 1200+ tech skills courses.