# IDFT - Inverse Discrete Fourier Transform

Calculates the inverse discrete Fourier transform, recovering the time series.

## Syntax

IDFT(Amp, Phase, N)

Amp
is an array of the amplitudes of the Fourier transformation components (a one-dimensional array of cells (e.g. rows or columns)).
Phase
is an array of the phase angle (radian) of the Fourier transformation components (a one-dimensional array of cells (e.g. rows or columns)).
N
is the original number of observations used to calculate the Fourier transform. If missing, N is assumed to be twice the size of the amplitude/phase array.

## Remarks

1. The input time series may include missing values (e.g. #N/A, #VALUE!, #NUM!, empty cell) at either end, but they will not be included in the calculations.
2. The input time series must be homogeneous or equally spaced.
3. The first value in the input time series must correspond to the lowest frequency component.
4. The output time series is returned in ascending order, i.e. first observation corresponds to the earliest date.
5. The frequency component order, $k$, must be a positive number less than $N$, or an error (#VALUE!) is returned.
6. The DFT returns the phase angle in radians; i.e. $0 \lt \phi \lt 2 \times \pi$.
7. The discrete Fourier transformation (DFT) is defined as follows:

$$X_k = \sum_{j=0}^{N-1} x_j e^{-\frac{2\pi i}{N} j k}$$.

Where:
• $k$ is the frequency component
• $x_0,...,x_{N-1}$ are the values of the input time series
• $N$ is the number of non-missing values in the input time series
8. The Cooley-Tukey radix-2 decimation-in-time fast Fourier transformation (FFT) algorithm divides a DFT of size N into two overlapping DFTs of size $\frac{N}{2}$ at each of its stages using the following formula:

$$X_{k} = \begin{cases} E_k + \alpha \cdot O_k & \text{ if } k \lt \dfrac{N}{2} \\ E_{\left (k-\frac{N}{2} \right )} - \ \alpha \cdot O_{\left (k-\frac{N}{2} \right )} & \text{ if } k \geq \dfrac{N}{2} \end{cases}$$
Where:
• $E_k$ is the DFT of the even-indicied values of the input time series, $x_{2m} \left(x_0, x_2, \ldots, x_{N-2}\right)$
• $O_k$ is the DFT of the odd-indicied values of the input time series, $x_{2m+1} \left(x_1, x_3, \ldots, x_{N-2}\right)$
• $\alpha = e^{ \left (-2 \pi i k /N \right )}$
• $N$ is the number of non-missing values in the time series data
9. The unit frequency of the DFT is $\frac{2\pi}{N}$, where $N$ is the number of non-missing observations.

## Examples (Inverse Discrete Fourier Transform)

Example 1:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
A B C D
Frequency Amplitude Phase IDFT
1 1.171 2.497 0.145
2 2.625 3.708 -0.040
3 1.136 0.097 -0.150
4 2.325 0.067 -0.199
5 1.408 1.839 -0.035
6 1.092 1.074 0.065
7 0.391 2.413 0.232
0.444
0.533
0.379
0.124
0.046
0.216
0.365
0.191
10.248
-0.566
-0.475
-0.105
0.169