Discrete Fourier Transform (DFT)¶
This document offers a brief reference guide to the use of the Discrete Fourier Transform (DFT).
Theory¶
The DFT is the only not strictly data-driven decomposition present in MODULO. In fact, the temporal basis \(\mathbf{\psi}_F\) is the Fourier basis, computed a priori. This reads:
in which \(f_r=r\Delta f\) is the frequency of the \(r\)-th Fourier mode, \(\Delta f=f_s/n_t\) is the frequency resolution, and \(n_t\) is the number of time samples. The term \(\frac{1}{\sqrt{n_t}}\) is a normalization factor, which ensures that the Fourier basis is orthonormal, e.g. \(\|\mathbf{\psi}_F\|^2=1\).
Considering the DFT of the signal at one specific location \(\mathbf{x}_i\), the Fourier coefficients are computed as:
that effectively projects the signal onto the Fourier basis. For each of these projections, one can compute the norm as:
that leads to the normalized projected fields:
that are the spatial structure of the DFT. This completes the DFT decomposition, presented here as a matrix factorization:
where \(\mathbf{\Sigma}_F\) is a diagonal matrix containing the modal amplitudes \(\sigma_F\).
Example in MODULO¶
An example of the usage of the mPOD routine, extracted from the examples folder is reported below.
import numpy as np
from modulo_vki.modulo import ModuloVKI
from modulo_vki.utils import plot_mPOD
FOLDER_DFT_RESULTS=FOLDER+os.sep+'DFT_Results_Jet'
if not os.path.exists(FOLDER_DFT_RESULTS):
os.mkdir(FOLDER_DFT_RESULTS)
# We perform the DFT first
# --- Remove the mean from this dataset (stationary flow )!
D,D_MEAN=ReadData._data_processing(D,MR=True)
# We create a matrix of mean flow (used to sum again for the videos):
D_MEAN_mat=np.array([D_MEAN, ] * n_t).transpose()
# --- Initialize MODULO object
m = ModuloVKI(data=D)
# Compute the DFT
Phi_F, Psi_F, Sigma_F = m.DFT(Fs)