next up previous print clean
Next: The simple FT code Up: Waves and Fourier sums Previous: Laying out a mesh

INVERTIBLE SLOW FT PROGRAM

Typically, signals are real valued. But the programs in this chapter are for complex-valued signals. In order to use these programs, copy the real-valued signal into a complex array, where the signal goes into the real part of the complex numbers; the imaginary parts are then automatically set to zero.

There is no universally correct choice of scale factor in Fourier transform: choice of scale is a matter of convenience. Equations (8) and (9) mimic the Z-transform, so their scaling factors are convenient for the convolution theorem--that a product in the frequency domain is a convolution in the time domain. Obviously, the scaling factors of equations (8) and (9) will need to be interchanged for the complementary theorem that a convolution in the frequency domain is a product in the time domain. I like to use a scale factor that keeps the sums of squares the same in the time domain as in the frequency domain. Since I almost never need the scale factor, it simplifies life to omit it from the subroutine argument list. When a scaling program is desired, we can use a simple one like scale() [*]. Complex-valued data can be scaled with scale() merely by doubling the value of n.

 

subroutine scale( factor, n, data)
integer i,                n
real factor, data(n)
do i= 1, n
        data(i) = factor * data(i)
return; end



 
next up previous print clean
Next: The simple FT code Up: Waves and Fourier sums Previous: Laying out a mesh
Stanford Exploration Project
12/26/2000