Fast Fourier Transforms


Description . For many purposes it is useful to think of h(t) and H(f) as being two different representations of the same function. One can go back and forth between the two representations by means of the Fourier transform equations,

and

operations for N points. Corresponding FFT takes Nlog2(N).

Algorithms

Double Precision FFT of Vector of Complex Numbers

where X is the input vector of double precision complex numbers and A is the output vector of double precision complex numbers.


2-D Double Precision FFT of a Matrix of Complex Numbers

where X is the input matrix of double precision complex numbers and A is the output matrix of double precision complex numbers.

Double Precision Sine or Cosine FFT of Vector of Real Numbers

The forward Fourier Transform of V(j) can be expressed as a cosine series:

The inverse FFT is given by,


Double Precision Complex FFT of Vector of Real Numbers

where X is the input vector of double precision real numbers and A is the output vector of double precision complex numbers.

Math<Toolkit> provides a set of classes to generate forward and inverse fourier transformations. The classes provided are

           os_vec_dcomplex_fft          transformation of a vector of double complex numbers
           os_vec_dreal_fft                 transformation of a vector of double real numbers
           os_mat_dcomplex_fft          transformation of a matrix of double complex numbers
           os_vec_dreal_cosine_fft      cosine transformation of a vector of double real numbers
           os_vec_dreal_sine_fft         sine transformation of a vector of double real numbers

The example code below shows the usage of the above classes to generate fourier transformations.

Example <ospace/math/examples/doublefft.cpp>
#include <ospace/math.h>


int
main()
  {
  os_math_toolkit math_init;

  double vec_data[ 5 ] = { 1, 2, 1, 3, 4 };
  os_num_vector< double > vec( 5 );

  for ( int i = 0; i < 5; i++ )
    {
    vec[ i ] = vec_data[ i ];
    }

  os_vec_dreal_fft fft;

  cout << "forward = \n" << fft.forward( vec ) << endl;
  cout << "inverse = \n" << fft.inverse( vec ) << endl;


  return 0;
  }
 

Copyright©1994-2013 Recursion Software LLC
All Rights Reserved - For use by licensed users only.