Fourier Transform and Filtering

Fourier transforms of the data are obtained using the commands described below. These routines are rarely used for filtering noise from data, with the one exception of cases where some stray corrugation (usually from 60 Hz noise) is present in the data. As long as this frequency is well separated from any other true frequency components in the data, it can be effectively eliminated by appropriate filtering. The procedure is to take the Fourier transform (rewriting the data array with the magnitude of the transform), and then make an image of the transform and display it in order to determine the locations of the offending frequency components. One then goes back to the raw data and uses TR/f to eliminate these components.

A second application of the Fourier transforms is for straightening out corrugation rows which may be curved due to STM drift. So long as those rows are very well defined in the data, with a measurable frequency component in each row of data, the command CD can be used to precisely align them along the vertical direction. Again, the procedure is to take the transform, view it to determine the appropriate frequency component, and then go back to the raw data and use CD to perform the distortion correction.

A third application of the Fourier transforms is for surface or interface roughness analysis, as described in Roughness Analysis.


Correct Distortion
arguments: frequency (integer)
Used to straighten out corrugation rows which may be slightly curved due to hysterisis or drift. Each row of data is fourier analyzed, and the phase of the fourier component at frequency is obtained. Each row is shifted by a specific amount such that the phases in all the rows are identical (problems arising from the modulo 2*pi on the phase are hopefully dealt with properly).

TRansform
arguments: rewrite data type (-1=no,0=cmplx,1=real,2=imag,3=mag,4=phase,5=2d sum) (integer)
Performs a fast fourier transform on the data array. The result is overwritten into the data array according to rewrite data type. The origin (0,0) of the transform is located in the first data element of the first row of data (i.e. lower left corner of an image). A general property of Fourier transform on discrete sets of data is that upper halves of the frequency space can equivalently be viewed as negative frequency components. Also, for a transform of real data, the magnitude of the transform will possess inversion symmetry.

TRansform/e
arguments: rewrite data type (-1=no,0=cmplx,1=real,2=imag,3=mag,4=phase,5=2d sum) (integer)
Same as above, but multiples data first by an "envelope function" consisting of a (1-cos(2*pi*x/Lx))*(1-cos(2*pi*y/Ly)) function with 0<x<Lx and 0<y<Ly. This function eliminates edge effects when computing correlation functions. To compute a correlation function, first use TR/B, then square the data with SQU, and then invert the transform using TR.

TRansform/1 or TRansform/1e
arguments: rewrite data type (-1=no,0=cmplx,1=real,2=imag,3=mag,4=phase,5=2d sum) (integer)
Same as above, but transform is performed only in the x-direction, line by line.

TRansform/f
arguments: no. regions (integer)
                   xmin,xmax (integers)  | repeat for each region
                   ymin,ymax (integers)  |
           no. poles, cut-off frequency (integers)
           rewrite data type (0=transform,1=invert transform) (integer)
Performs a fast fourier transform of the data array, does the specified filtering operations, and overwrites the data array with the inverted transform as specified by rewrite data type. Filtering is performed either by specifying the limits (xmin,xmax,ymin,ymax) of rectangular regions in the transform which are set to zero, or by performing a low-pass filter centered at (0,0) frequency with the specified no. poles and cut-off frequency. For setting specific regions equal to zero, it is important to include regions at both positive and negative frequency (done automatically with /g option below).

TRansform/g
arguments: no. regions (integer)
                   xmin,xmax (integers)  | repeat for each region
                   ymin,ymax (integers)  |
           no. poles, cut-off frequency (integers)
           rewrite data type (0=transform,1=invert transform) (integer)
Same as above, but for the regions specified they are automatically repeated at the negative frequency parts of the spectrum.