Introduction
In previous modules have seen that a Fourier transform can be used to calculate the frequency distribution of a signal. Various Fourier transforms have been discussed, each for a different type signal. In this section we will introduce again another Fourier transform: The Discrete Fourier Transform (DFT). The main advantage of the DFT is that this transform, in contrast to almost all other Fourier transforms, can be calculated on a computer. In this section we will give a conceptual view of the DFT. In the first subsection we show how the DFT equation can be related, in different intermediate steps, to the Fourier Transform for Continuous time signals (FTC). In the second subsection we will discuss the periodic behaviour of the DFT. In order to calculate the frequency distribution on a computer, we will explain in the last subsection how the DFT can extract frequencies of a signal.
Screencast video [⯈]
Module overview
This module will cover the following topics:
- From FTC to DFT - This section will describe the process of deriving the DFT starting from the FTC. From this derivation it is now possible to derive the frequency distribution of a sampled discrete-time signal.
- The DFT [⯈] - This section will go into more depth and describe how the DFT actually extract frequencies.
- DFT properties [⯈] - Just like with the FTC, there are several properties which greatly simply calculations. These properties will be derived in this section.
- Convolution implementation - The DFT can be implemented using a simple convolution operation, which means that an FIR-filter can extract the frequency distribution of a signal.
- Length of the DFT [⯈] - The resolution of the frequency distribution depends on the length of the signal. However, by appending zeros to the signal, this resolution can be increased.
- DFT for continuous signals - In practice the DFT, or its efficient version the FFT, is often used to calculate the frequency content of (non periodic) continuous time signals. This will always result in an approximation from which the various causes of errors are shown in this section.
Summary
Definition: $$ \boxed{ \begin{eqnarray*} \text{DFT: } X_p[k] = \sum_{n=0}^{N-1} x_p[n] e^{-j\frac{2 \pi}{N} k n} \hspace{3mm} \color{red}{\bf \forall k} \qquad \text{IDFT: } x_p[n] = \frac{1}{N} \sum_{k=0}^{N-1} X_p[k] e^{j\frac{2 \pi}{N} k n} \hspace{3mm} \color{red}{\bf \forall n} \end{eqnarray*}} $$
- Both DFT and IDFT discrete and periodic.
- Periodic extension (PE): $\\ \qquad$ Choose $N$ succeeding samples of $x[n]$ (usually for $n=0,1, \cdots, N-1$) and repeat these samples. This results in the periodic signal $x_p[n]= x[(n \cdot \text{mod(N)})]$.
DFT properties:
- DFT summation property: With twiddle factor $W_N=e^{j\frac{2 \pi}{N}}$
$$ \boxed{ S[k]= \sum_{n=0}^{\color{red}{N}-1} \left \{ W_{\color{red}{N}}^k \right \} ^n = \sum_{n=0}^{\color{red}{N}-1} \left \{ \text{e}^{j \frac{2\pi}{\color{red}{N}} k } \right \} ^n = \color{red}{N} \delta [\color{blue}{k} \text{ mod}(\color{red}{N})] } $$
- Linearity: $$ a x_{p,1}[n]+bx_{p,2}[n] \hspace{2mm} \circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ \hspace{2mm} a X_{p,1}[k] + b X_{p,2}[k] $$
- Circular shift: \begin{eqnarray*} \text{Time shift:} \hspace{8.5mm} x_p[n-n_0] &\circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ& e^{-j\frac{2 \pi}{N} k n_0} \cdot X_p [k] \newline \text{Frequency shift:} \hspace{3mm} e^{j\frac{2 \pi}{N} n k_0} \cdot x_p[n] &\circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ& X_p[k-k_0] \end{eqnarray*}
- Circular convolution: $$ x_p[n] \circledast h_p[n] =\sum_{i=0}^{N-1} x_p[i] h_p[n-i]= \sum_{i=0}^{N-1} x_p[n-i] h_p[i] \hspace{2mm} \circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ \hspace{2mm} X_p[k] \cdot H_p[k] $$ $$ x_p[n] \cdot h_p[n] \hspace{2mm} \circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ \hspace{2mm} X_p[k] \circledast H_p[k] $$
- Complex conjugation: $$ x_p^\ast[n] \hspace{2mm} \circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ \hspace{2mm} X_p^\ast[N-k] $$ $$ x[n] \text{ real } \Rightarrow \text{ } X_p[k]=X^\ast_p[N-k] $$
- Preserve energy (Parceval): $$ \sum_{n=0}^{N-1} |x_p[n]|^2 = \sum_{k=0}^{N-1} | X_p[k]|^2 $$
Linear by circular convolution:
- Convolution two finite duration signals:
If signal $x[n]$ consists of $N_1$ samples and $h[n]$ of $N_2$ samples the result of the linear convolution $y[n] = x[n] \star h[n]$ can be obtained from a circular convolution $y_p[n]=x_p[n] \circledast h_p[n]$ in which both periodic extended $x_p[n]$ and $h_p[n]$ are padded with zeros up to a length of $N \geq N_1 + N_2 -1$ samples.
- Convolution infinite duration with finite duration signal:
The overlap-add procedure is as follows:
- Split $x[n]$ in length $M \geq 1 (L)$ non-overlapping segments
- Calculate $y_i[n]=h[n] \star x_i[n]$ (efficiently with FFT's)
- Add last $L-1$ samples previous segment with first samples current segment
- $y[n]= \sum_{i=0}^{\infty} y_i[n-Mi]$
The overlap-save procedure is as follows:
- Split $x[n]$ in length $M \geq L-1$ overlapping segments, overlap $L-1$
- Calculate $y_i[n]=h[n] \star x_i[n]$ (efficiently with FFT's)
- Construct $\tilde{y}_i[n]$: Discard first $L-1$ samples, last $N=M-L+1$ are correct
- $y[n]= \sum_{i=0}^{\infty} \tilde{y}_i[n-Mi]$
How choose DFT length $N$
- Periodic signals: With integer $\lambda$, if DFT length $N$ $\neq \lambda \times \#$ samples in one period $\Rightarrow$ Artefacts during PE $\Rightarrow$ Use windowing.
- Signals of finite duration $M \leq N$:
DFT coefficients sampled version of FTD: $X[k]= X(e^{j\theta})\mid_{\theta = k \cdot \frac{2 \pi}{N}}$
Note: For $N>M$:Zero padding with $N-M$ zeros:- Increase resolution spectral plot
- No extra spectral information of underlying signal
- Non periodic infinite length signals:
The DFT of an infinite duration signal is always an approximation. Exact spectral content can only be obtained by an FTD.
DFT for continuous signals: Time- bandwidth product constant $\Rightarrow$ $T \cdot \Delta \omega = 2 \pi /N$