aspcore.fouriertransform.dft
Methods for discrete Fourier transform
The forward transforms will operate on the last axis, and put the resulting frequency axis first. The inverse transforms will operate on the first axis and put the resulting time axis last. A time domain sample can be accessed as time_signal[…,n] A frequency domain sample can be accessed as freq_signal[f,…]
The motivation is that the methods are build for multichannel audio processing, where the assumption is that only 1-D FFTs are needed. The most common use case is that time domain processing operates directly on the last axis, and frequency domain processing operates on the channel axes, but broadcasts over the frequency axis. This behaviour for the transforms results in much fewer transpositions, and makes the code more readable.
Important
Note the time convention, which is not the same as in the numpy.fft module. This is to achieve consistency with the acoustics literature. The definition of the DFT is u(k) = sum_{n=0}^{N-1} u[n] e^{i 2pi k n / N}, for frequency bins k = 0, 1, …, N-1, and the definition of the Inverse DFT is u[n] = rac{1}{N} sum_{k=0}^{N-1} u(k) e^{-i 2pi k n / N}.
It can be viewed as a direct consequence of choosing the definition of a plane wave propagating in the d direction to be u(r) = e^{i k r^T d}, where k is the wavenumber.
References
Functions
|
Converts an array of angular frequencies to wave numbers |
|
DFT matrix corresponding to the real DFT. |
|
All exponential values to calculate the DFT for a specific frequency bin |
|
Computes the FFT |
|
Converts an array of frequencies to angular frequencies |
|
Converts an array of frequencies to wave numbers |
|
Returns the angular frequencies associated with the sampled frequencies of the DFT |
|
Returns the sampled frequencies in Hz for a discrete Fourier transform |
|
Returns angular frequencies associated with the real frequencies of the DFT |
|
Returns the real sampled frequencies in Hz for a discrete Fourier transform |
|
Get wave numbers associated with the real frequencies of the DFT |
|
Returns the wave numbers associated with the sampled frequencies of the DFT |
|
All exponential values to calculate the IDFT for a specific output time step |
|
Computes the inverse FFT |
|
Inserts the values associated with negative frequencies. |
|
DFT matrix corresponding to the inverse real DFT. |
|
Inverse FFT, and moves the first axis to the last axis |
|
DFT matrix corresponding to the real DFT. |
|
The weighting required for the real DFT to be the same as the complex DFT. |
|
Computes the real FFT |