c06ea calculates the discrete Fourier transform of a sequence of real data values. (No extra workspace required.)
Syntax
C# |
---|
public static void c06ea( double[] x, int n, out int ifail ) |
Visual Basic |
---|
Public Shared Sub c06ea ( _ x As Double(), _ n As Integer, _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void c06ea( array<double>^ x, int n, [OutAttribute] int% ifail ) |
F# |
---|
static member c06ea : x : float[] * n : int * ifail : int byref -> unit |
Parameters
- x
- Type: array<System..::..Double>[]()[][]An array of size [n]On entry: if x is declared with bounds in the method from which c06ea is called, then must contain , for .On exit: the discrete Fourier transform stored in Hermitian form. If the components of the transform are written as , and if x is declared with bounds in the method from which c06ea is called, then for , is contained in , and for , is contained in . (See also [] in the C06 class Chapter Introduction and [Example].)
- n
- Type: System..::..Int32On entry: , the number of data values. The largest prime factor of n must not exceed , and the total number of prime factors of n, counting repetitions, must not exceed .Constraint: .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
Given a sequence of real data values
, for , c06ea calculates their discrete Fourier transform defined by
(Note the scale factor of in this definition.) The transformed values are complex, but they form a Hermitian sequence (i.e., is the complex conjugate of ), so they are completely determined by real numbers (see also the C06 class).
To compute the inverse discrete Fourier transform defined by
this method should be followed by a call of c06gb to form the complex conjugates of the .
c06ea uses the fast Fourier transform (FFT) algorithm (see Brigham (1974)). There are some restrictions on the value of (see [Parameters]).
References
Brigham E O (1974) The Fast Fourier Transform Prentice–Hall
Error Indicators and Warnings
Errors or warnings detected by the method:
- At least one of the prime factors of n is greater than .
- n has more than prime factors.
On entry, .
- An unexpected error has occurred in an internal call. Check all method calls and array dimensions. Seek expert help.
Accuracy
Some indication of accuracy can be obtained by performing a subsequent inverse transform and comparing the results with the original sequence (in exact arithmetic they would be identical).
Parallelism and Performance
None.
Further Comments
The time taken is approximately proportional to , but also depends on the factorization of . c06ea is faster if the only prime factors of are , or ; and fastest of all if is a power of .
On the other hand, c06ea is particularly slow if has several unpaired prime factors, i.e., if the ‘square-free’ part of has several factors.
For such values of , (C06FAF not in this release) (which requires additional real workspace) is considerably faster.