The fourier.dft_slow
function is a plain implementation of discrete Fourier transformation.
The fourier.fft_vectorized
function depends on this function.
Parameter | Description |
---|---|
input_data | Array containing the values to be transformed. |
Returns an array containing the transformed values.
>>> from Asteria import fourier
>>> fourier.dft_slow([1,2,3,4])
array([10.+0.00000000e+00j, -2.+2.00000000e+00j, -2.-9.79717439e-16j, -2.-2.00000000e+00j])
The fourier.fft_vectorized
function is a vectorized, non-recursive version of the Cooley-Tukey FFT
Gives the same result as fourier.dft_slow
but is many times faster.
Parameter | Description |
---|---|
input_data | Array containing the values to be transformed. |
Returns an array containing the transformed values.
>>> from Asteria import fourier
>>> fourier.fft_vectorized([1,2,3,4])
array([10.+0.00000000e+00j, -2.+2.00000000e+00j, -2.-9.79717439e-16j, -2.-2.00000000e+00j])
This function computes the inverse of the one-dimensional n-point discrete Fourier transform computed by fft
Parameter | Description |
---|---|
input_data | Input array, can be complex. |
>>> from Asteria import fourier
>>> fourier.ifft([0,4,0,0])
array([ 1.+0.j, 0.+1.j, -1.+0.j, 0.-1.j])