DISCRETE FOURIER TRANSFORM (DFT) PROGRAM
Revised:
Authors
Keywords
Purpose
complex function values f(k), where "k" = 1,2,....nn. This DFT program will compute the
complex function "C(n)" where "n" = 1,2,....nn, such that
C(n) = summation of f(k) * exp ^ (-i*k*w0*n) where w0 = 2*pi/nn
This same program can also be used to find the inverse Fourier transform, provided that the
user has to provide the proper values for "factor and isign" (See explanation below).
Input data
if isign = -1 and factor = 1; general_dft = DFT operation is performed.
if isign = +1 and factor = 1; general_dft = Inverse DFT operation is performed
"n" represents the number of time points, which also mean the number of terms used in the
Fourier series (in complex numbers).
Factor to be specified by the user
Input data for DFT in complex format.
For case 1, the user has to input isign = -1 and factor = 1 and the complex vector fk, then
general_dft code will compute complex vector Cn according to equation 11.59.
For case 2, the user has to input isign = +1, factor = 1 and the complex vector Cn (obtained from
case 1; the user input complex vector has to multiply with a factor 1/n before calling general_dft),
then this general_dft code will compute and get back the original complex vector fk according to
equation 11.60.
Case 2 : fcomp = [36.0000-36.0000i -13.6569+5.6569i
-2.3431-5.6569i
This worksheet will work for a data set of your choice. You will need to change the items in the corresponding freal and fimag array.
Example 1
The results of the general_dft subroutine are shown here.
This worksheet will work for a data set of your choice. You will need to change the items in the coerresponding freal and fimag array.
Example 2
The results of the general_dft subroutine
are shown here.