Difference between revisions of "Fourier Transform"
Line 4: | Line 4: | ||
__TOC__ | __TOC__ | ||
− | The Fourier and inverse Fourier transforms convert a time-series into a power spectrum and viseversa. These are well-known transformations that are employed for many applications including | + | The Fourier and inverse Fourier transforms convert a time-series into a power spectrum and viseversa. These are well-known transformations that are employed for many applications including finding and characterizing periodicities in time-series analysis and regression; fast convolution and de-convolution; transfer function modeling in systems analysis; solving systems of differential equations; Bayesian analysis using characteristic functions; and signal filtering. |
− | finding and characterizing periodicities in time-series analysis and regression; fast convolution | ||
− | and de-convolution; transfer function modeling in systems analysis; solving systems of differential | ||
− | equations; Bayesian analysis using characteristic functions; and signal filtering. | ||
− | The discrete Fourier transform involves a time domain (corresponding to an index) and a frequency | + | The discrete Fourier transform involves a time domain (corresponding to an index) and a frequency domain (corresponding to a frequency index). The time points are equally spaced at internals of Δt, and the frequency points are equally spaced at ΔF . Both index have <code>n</code>points. The intervals spacings are related as |
− | domain (corresponding to a frequency index). The time points are equally spaced at internals | ||
− | of Δt, and the frequency points are equally spaced at ΔF . Both index have <code>n</code>points. The intervals spacings are related as | ||
<center><math> | <center><math> | ||
Line 17: | Line 12: | ||
</math></center> | </math></center> | ||
− | The quantity 1/(Δt) is called the sampling frequency, which should be at least twice the smallest | + | The quantity 1/(Δt) is called the sampling frequency, which should be at least twice the smallest frequency that is present in the underlying continuous signal. See FFT on the Analytica Wiki for additional details. |
− | frequency that is present in the underlying continuous signal. See FFT on the Analytica Wiki for | ||
− | additional details. | ||
==FFT(x, t, freq)== | ==FFT(x, t, freq)== | ||
− | Computes the Discrete Fourier Transform (DFT) of the time-series '''x''', indexed by '''t''', and returns | + | Computes the Discrete Fourier Transform (DFT) of the time-series '''x''', indexed by '''t''', and returns the discrete frequency spectrum as a complex array indexed by '''freq'''. It performs this calculation using the Fast Fourier Transform (FFT) algorithm. The indexes t and '''freq''' must have the same length. This is a complex-valued function -- even if '''x''' is real-valued, the result in general will be an array of complex numbers. You can apply the '''[[Abs]]()''' function to the result to obtain the magnitude of the frequency component if you are not interested in the phase. The discrete Fourier transform is defined as |
− | the discrete frequency spectrum as a complex array indexed by '''freq'''. It performs this calculation | ||
− | using the Fast Fourier Transform (FFT) algorithm. The indexes t and '''freq''' must have the same | ||
− | length. This is a complex-valued function -- even if '''x''' is real-valued, the result in general will be an array of complex numbers. You can apply the '''Abs()''' function to the result to obtain the magnitude of the frequency component if you are not interested in the phase. | ||
− | The discrete Fourier transform is defined as | ||
<center><math> | <center><math> | ||
Line 32: | Line 21: | ||
</math></center> | </math></center> | ||
− | The computation is fastest when the length of the indexes is a power of 2. It is also reasonably | + | The computation is fastest when the length of the indexes is a power of 2. It is also reasonably efficient when all the prime factors of the length of the index is small. So, for example, it is fairly efficient when the indexes are a power of 10, since the length factors to powers of 2 and 5, both of which are still small. The computation time increases approximately quadratically with the square of the largest factor. |
− | efficient when all the prime factors of the length of the index is small. So, for example, it is fairly | ||
− | efficient when the indexes are a power of 10, since the length factors to powers of 2 and 5, both of | ||
− | which are still small. The computation time increases approximately quadratically with the square | ||
− | of the largest factor. | ||
'''Library:''' Advanced math | '''Library:''' Advanced math | ||
Line 43: | Line 28: | ||
==FFTInv(x, freq, t)== | ==FFTInv(x, freq, t)== | ||
− | Computes the inverse Discrete Fourier Transform (DFT) using the Fast Fourier Transform (FFT) | + | Computes the inverse Discrete Fourier Transform (DFT) using the Fast Fourier Transform (FFT) algorithm. The frequency spectrum, '''x''', is indexed by '''freq''', and typically consists of complex numbers encoding both the magnitude and phase of each frequency. Returns the time-series with the indicated spectrum, indexed by '''t'''. The indexes '''freq''' and '''t''' must have the same length. |
− | algorithm. The frequency spectrum, '''x''', is indexed by '''freq''', and typically consists of complex numbers encoding both the magnitude and phase of each frequency. Returns the time-series with the indicated spectrum, indexed by '''t'''. The indexes '''freq''' and '''t''' must have the same length. | ||
The inverse DFT is defined as | The inverse DFT is defined as | ||
Line 52: | Line 36: | ||
</math></center> | </math></center> | ||
− | The efficiency of FFTInv is the same as for FFT(), maximally efficient when the length of the | + | The efficiency of [[FFTInv]]() is the same as for [[FFT]](), maximally efficient when the length of the indexes is a power or 2. |
− | indexes is a power or 2. | ||
'''Library:''' Advanced math | '''Library:''' Advanced math | ||
==See Also== | ==See Also== | ||
+ | * [[FFT]]() | ||
+ | * [[FFTInv]]() | ||
<footer>Interpolation functions / {{PAGENAME}} / Sets - collections of unique elements</footer> | <footer>Interpolation functions / {{PAGENAME}} / Sets - collections of unique elements</footer> |
Revision as of 08:37, 15 December 2015
The Fourier and inverse Fourier transforms convert a time-series into a power spectrum and viseversa. These are well-known transformations that are employed for many applications including finding and characterizing periodicities in time-series analysis and regression; fast convolution and de-convolution; transfer function modeling in systems analysis; solving systems of differential equations; Bayesian analysis using characteristic functions; and signal filtering.
The discrete Fourier transform involves a time domain (corresponding to an index) and a frequency domain (corresponding to a frequency index). The time points are equally spaced at internals of Δt, and the frequency points are equally spaced at ΔF . Both index have n
points. The intervals spacings are related as
The quantity 1/(Δt) is called the sampling frequency, which should be at least twice the smallest frequency that is present in the underlying continuous signal. See FFT on the Analytica Wiki for additional details.
FFT(x, t, freq)
Computes the Discrete Fourier Transform (DFT) of the time-series x, indexed by t, and returns the discrete frequency spectrum as a complex array indexed by freq. It performs this calculation using the Fast Fourier Transform (FFT) algorithm. The indexes t and freq must have the same length. This is a complex-valued function -- even if x is real-valued, the result in general will be an array of complex numbers. You can apply the Abs() function to the result to obtain the magnitude of the frequency component if you are not interested in the phase. The discrete Fourier transform is defined as
The computation is fastest when the length of the indexes is a power of 2. It is also reasonably efficient when all the prime factors of the length of the index is small. So, for example, it is fairly efficient when the indexes are a power of 10, since the length factors to powers of 2 and 5, both of which are still small. The computation time increases approximately quadratically with the square of the largest factor.
Library: Advanced math
Examples: For usage examples, please see FFT on the Analytica Wiki.
FFTInv(x, freq, t)
Computes the inverse Discrete Fourier Transform (DFT) using the Fast Fourier Transform (FFT) algorithm. The frequency spectrum, x, is indexed by freq, and typically consists of complex numbers encoding both the magnitude and phase of each frequency. Returns the time-series with the indicated spectrum, indexed by t. The indexes freq and t must have the same length.
The inverse DFT is defined as
The efficiency of FFTInv() is the same as for FFT(), maximally efficient when the length of the indexes is a power or 2.
Library: Advanced math
Enable comment auto-refresher