| Description | The Fourier transform of X is calculated and stored in Y. A Fast Fourier Transform algorithm is used that requires size to be a power of 2. The forward transform is obtained by setting dir = 1, the inverse (or backward) transform by setting dir = -1. As usual, the inverse transform involves scaling the result by the factor 1.0/size (complex FFT) or 2.0/size (real FFT). Since it is sometimes desirable to skip this implicit scaling, VF_FFT offers the possibility to do so: specify dir = -2 in this case.
Complex version: Both X and the output Y are complex vectors.
Real-to-complex version: The input vector X is real. The output vector is complex. As this function can only perform a forward transform, no argument "dir" is needed.
Purely real version: For the forward transform, X is a real vector. The output Y is also defined as fVector, although it consists of complex numbers. These are packed in a special way such as to fit into the same amount of memory as the original real vector X. The order of storage in Y is indicated in the following table (N=size, U is the uncompressed Fourier Transform of X):
| Y0 | Y1 | Y2
| Y3 | .....
| YN-2 | YN-1 |
| U0.Re | UN/2.Re | U1.Re
| U1.Im | .....
| UN/2-1.Re | UN/2-1.Im |
The reason for this packing is the following. If the size real data points of X represent a function of the time, X = g(t), then the forward transform yields a function U = G(f) in the frequency domain. In principle, U consists of size+1 complex data points: size/2 points for positive frequencies, another size/2 points for negative frequencies, and one point at frequency zero.
For the Fourier Transform of a real vector, the symmetry relation G(-f) = |G(f)|* holds (the asterisc denoting the complex conjugate). This means that the points at negative frequencies need not be stored; all information is already contained in the positive frequency half. Moreover, the zeroth and the size2'th element of the transform are both purely real. Therefore, only these two real and size/2-1 complex data points have to be stored - which exactly fit into the same amount of memory as the original size real data points of X. This allows X to be overwritten by its transform, if desired.
For the real version of the inverse transform, X has to be a complex vector packed in the way just described, and a real-valued vector Y is obtained.
About special versions with the prefixes VFp_, VFs_ and VFl_, consult chapter 4.8. |