Difference between revisions of "Fourier Transform"

m
 
(10 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:Analytica User Guide]]
+
[[Category: Analytica User Guide]]
<breadcrumbs>Analytica User Guide > More Array Functions > {{PAGENAME}}</breadcrumbs>
+
[[Category: Array Functions]]
 +
 
 +
<breadcrumbs>Analytica User Guide > Array functions > {{PAGENAME}}</breadcrumbs>
  
 
__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 vice versa. These are well-known functions used for many applications including finding and characterizing periodicities in time-series analysis and regression, fast convolution and de-convolution, transfer functions for 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 and a frequency domain, each with a corresponding index. The points in the time index are equally spaced at intervals of  ''&Delta;t''. The points in the frequency index are equally spaced at ''&Delta;F'' . Both indexes have <code>n</code>points. The interval spacings are related as:
domain (corresponding to a frequency index). The time points are equally spaced at internals
 
of  &Delta;t, and the frequency points are equally spaced at &Delta;F . Both index have <code>n</code>points. The intervals spacings are related as
 
  
<center><math>\Delta t =\frac{1}{n \Delta t}</math></center>
+
::<math>
 +
\Delta t =\frac{1}{n \Delta t}
 +
</math>
  
The quantity 1/(&Delta;t) is called the sampling frequency, which should be at least twice the smallest
+
The quantity 1/(&Delta;t) is termed the sampling frequency. It should be at least twice the smallest frequency that is present in the underlying continuous signal. See [[FFT]] 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 ([[FFTInv#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>
+
::<math>
 
H_k = \sum_{t=0}^{n-1} x_{t}e^{2j\pi t k /n}
 
H_k = \sum_{t=0}^{n-1} x_{t}e^{2j\pi t k /n}
</math></center>
+
</math>
 +
 
 +
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.
  
The computation is fastest when the length of the indexes is a power of 2. It is also reasonably
+
'''Examples:''' For usage examples, please see [[FFT]].
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
+
==FFTInv(x, freq, t)==
 +
Computes the inverse Discrete Fourier Transform ([[FFTInv#The_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. See [[FFTInv]]().
  
'''Examples:''' For usage examples, please see [[FFT]] on the Analytica Wiki.
+
The inverse DFT is defined as
  
==FFTInv(x, freq, t)==
+
::<math>
Computes the inverse Discrete Fourier Transform (DFT) using the Fast Fourier Transform (FFT)
+
H_t = \sum_{k=0}^{n-1} x_{k}e^{-2j\pi t k /n}
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.
+
</math>
  
 +
The efficiency of [[FFTInv]]() is the same as for [[FFT]](), maximally efficient when the length of the indexes is a power or 2.
  
The inverse DFT is defined as
 
 
==See Also==
 
==See Also==
 +
* [[FFT]]()
 +
* [[FFTInv]]()
 +
* [[Transforming functions]]
 +
 +
 
<footer>Interpolation functions / {{PAGENAME}} / Sets - collections of unique elements</footer>
 
<footer>Interpolation functions / {{PAGENAME}} / Sets - collections of unique elements</footer>

Latest revision as of 17:40, 18 July 2018


The Fourier and inverse Fourier transforms convert a time-series into a power spectrum and vice versa. These are well-known functions used for many applications including finding and characterizing periodicities in time-series analysis and regression, fast convolution and de-convolution, transfer functions for solving systems of differential equations, Bayesian analysis using characteristic functions, and signal filtering.

The discrete Fourier transform involves a time domain and a frequency domain, each with a corresponding index. The points in the time index are equally spaced at intervals of Δt. The points in the frequency index are equally spaced at ΔF . Both indexes have npoints. The interval spacings are related as:

[math]\displaystyle{ \Delta t =\frac{1}{n \Delta t} }[/math]

The quantity 1/(Δt) is termed the sampling frequency. It should be at least twice the smallest frequency that is present in the underlying continuous signal. See FFT 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

[math]\displaystyle{ H_k = \sum_{t=0}^{n-1} x_{t}e^{2j\pi t k /n} }[/math]

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.

Examples: For usage examples, please see FFT.

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. See FFTInv().

The inverse DFT is defined as

[math]\displaystyle{ H_t = \sum_{k=0}^{n-1} x_{k}e^{-2j\pi t k /n} }[/math]

The efficiency of FFTInv() is the same as for FFT(), maximally efficient when the length of the indexes is a power or 2.

See Also


Comments


You are not allowed to post comments.