Contents Previous Next Subchapters

The Centered Finite Fourier Transform
Syntax fft(z)
See Also ifft , fft2d , dft , lombft

Description
Returns a complex matrix containing the centered finite Fourier transform of z, where z is an integer, real double-precision or complex matrix. If N is the number of rows in z, the (k,j)-th element of the return value is equal to
       N
     -----                  __
     >      z   exp[-2 pi \/-1 (i - N/2 - 1) (k - N/2 - 1) / N]
     -----   i,j
     i = 1
for k between 1 and N and j between 1 and the number of columns in z.

Example
The Fourier transform of a function h(t) is defined as follows:
             +infinity
            /                  __
     H(f) = | h(t) exp(-2 pi \/-1 f tdt
            /
             -infinity
If the function h(t) is the rectangular window function
            /  1, if -T < t < T
     h(t) = {
            \  0, otherwise
The Fourier transform of h(t) is given by the following:
            sin(2 pi T f)
     H(f) = -------------
                pi f
The following program plots an approximation for the transform that defines H(f), where T = 1/2, there are 2^10 points in the finite Fourier transform, of which 2^6 points are between -T and +T. The names dt and df are used for the spacing in the time and frequency grids.

clear
N   = 2^10
M   = 2^6
T   = .5
dt  = 2 * T / M
df  = 1. / (N * dt)
f   = (seq(N) - N / 2 - 1) * df
t   = (seq(N) - N / 2 - 1) * dt
h   = int( abs(t) <=  T )
H   = fft(h) * dt
gxaxis("linear", -5, +5)
gtitle("H(f)")
gplot(f, real(H))