## Illustration of the Discrete Fourier Tranform DFT

Mathematica 8:

Do[
nn = i;
Print[MatrixForm[Transpose[Table[{1}, {n, 1, nn}]]]]
Print[MatrixForm[
Table[Table[Cos[-2*Pi*(n – 1)*(k – 1)/nn], {k, 1, nn}], {n, 1,
nn}]]]
Print[MatrixForm[
Chop[N[Table[
Total[Table[Cos[-2*Pi*(n – 1)*(k – 1)/nn], {k, 1, nn}]], {n, 1,
nn}]]]]]
, {i, 1, 12}]

Signal or time domain

$\left( \begin{array}{c} 1 \end{array} \right)$

Dicrete Fourier Cosine Transform

$\left( \begin{array}{c} 1 \end{array} \right)$

Spectrum or frequency domain

$\left( \begin{array}{c} 1. \end{array} \right)$

Signal or time domain

$\left( \begin{array}{cc} 1 & 1 \end{array} \right)$

Dicrete Fourier Cosine Transform

$\left( \begin{array}{cc} 1 & 1 \\ 1 & -1 \end{array} \right)$

Spectrum or frequency domain

$\left( \begin{array}{c} 2. \\ 0. \end{array} \right)$

Signal or time domain

$\left( \begin{array}{ccc} 1 & 1 & 1 \end{array} \right)$

Dicrete Fourier Cosine Transform

$\left( \begin{array}{ccc} 1 & 1 & 1 \\ 1 & -\frac{1}{2} & -\frac{1}{2} \\ 1 & -\frac{1}{2} & -\frac{1}{2} \end{array} \right)$

Spectrum or frequency domain

$\left( \begin{array}{c} 3. \\ 0. \\ 0. \end{array} \right)$

Signal or time domain

$\left( \begin{array}{cccc} 1 & 1 & 1 & 1 \end{array} \right)$

Dicrete Fourier Cosine Transform

$\left( \begin{array}{cccc} 1 & 1 & 1 & 1 \\ 1 & 0 & -1 & 0 \\ 1 & -1 & 1 & -1 \\ 1 & 0 & -1 & 0 \end{array} \right)$

Spectrum or frequency domain

$\left( \begin{array}{c} 4. \\ 0. \\ 0. \\ 0. \end{array} \right)$

Signal or time domain

$\left( \begin{array}{ccccc} 1 & 1 & 1 & 1 & 1 \end{array} \right)$

Dicrete Fourier Cosine Transform

$\left( \begin{array}{ccccc} 1 & 1 & 1 & 1 & 1 \\ 1 & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) \\ 1 & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) \\ 1 & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) \\ 1 & \frac{1}{4} \left(-1+\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1-\sqrt{5}\right) & \frac{1}{4} \left(-1+\sqrt{5}\right) \end{array} \right)$

Spectrum or frequency domain

$\left( \begin{array}{c} 5. \\ 0. \\ 0. \\ 0. \\ 0. \end{array} \right)$

Signal or time domain

$\left( \begin{array}{cccccc} 1 & 1 & 1 & 1 & 1 & 1 \end{array} \right)$

Dicrete Fourier Cosine Transform

$\left( \begin{array}{cccccc} 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & \frac{1}{2} & -\frac{1}{2} & -1 & -\frac{1}{2} & \frac{1}{2} \\ 1 & -\frac{1}{2} & -\frac{1}{2} & 1 & -\frac{1}{2} & -\frac{1}{2} \\ 1 & -1 & 1 & -1 & 1 & -1 \\ 1 & -\frac{1}{2} & -\frac{1}{2} & 1 & -\frac{1}{2} & -\frac{1}{2} \\ 1 & \frac{1}{2} & -\frac{1}{2} & -1 & -\frac{1}{2} & \frac{1}{2} \end{array} \right)$

Spectrum or frequency domain

$\left( \begin{array}{c} 6. \\ 0. \\ 0. \\ 0. \\ 0. \\ 0. \end{array} \right)$

Signal or time domain

$\left( \begin{array}{ccccccc} 1 & 1 & 1 & 1 & 1 & 1 & 1 \end{array} \right)$

Dicrete Fourier Cosine Transform

$\left( \begin{array}{ccccccc} 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] \\ 1 & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] \\ 1 & -\text{Cos}\left[\frac{\pi }{7}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] \\ 1 & -\text{Cos}\left[\frac{\pi }{7}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] \\ 1 & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] \\ 1 & \text{Sin}\left[\frac{3 \pi }{14}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Cos}\left[\frac{\pi }{7}\right] & -\text{Sin}\left[\frac{\pi }{14}\right] & \text{Sin}\left[\frac{3 \pi }{14}\right] \end{array} \right)$

Spectrum or frequency domain

$\left( \begin{array}{c} 7. \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \\ 0 \end{array} \right)$