PeakLab v1 Documentation Contents AIST Software Home AIST Software Support
Fourier Spectral Processing
The Fast Fourier Transform (FFT) decomposes a time-domain signal (which can be a function of time, spatial coordinates, or any time series abscissa) into complex exponentials (sines and cosines). A Fourier transform offers a complete picture of frequency space, but retains no information as to when in time a signal occurs. Thus a signal should either be wide-sense stationary, with a constant mean and variance across broad time segments, or you must care only qualitatively about whether a certain frequency content signal occurs somewhere in the time range being sampled.
The FFT is a fast algorithmic route for producing the Discrete Fourier Transform (DFT). The forward and reverse discrete transforms are defined as follows:
While the DFT is very simple, it is an order n^2 procedure whereas the FFT is an n*log2(n) operation. The difference in processing times is dramatic with large data sets. PeakLab offers four different fast FFT algorithms.
Fourier decompositions are limited in resolution, as the frequencies at which the sines and cosines are computed are equally spaced and fixed in number. For a data set of n points, there will be n complex frequencies. For real data, the negative frequencies mirror the positive ones, and only the positive frequencies are displayed. Thus, n/2+1 frequencies comprise the spectrum. Normalized frequencies range from 0, sometimes referred to as DC, to 0.5, the Nyquist frequency, the maximum frequency that can still be detected given the selected sampling rate. PeakLab displays the actual frequencies. Normalized frequencies are not used.
Continuous Basis Functions
The Fourier decomposition represents a data sequence as a linear combination of a set of sine and cosine basis functions. Although the data and Fourier sequences are each discrete, the basis functions are continuous and infinite in duration. It is thus possible to reconstruct the signal for any time within the range of the original sequence:
The Fourier basis functions can be treated as complex exponentials, zero phase sine and cosine pairs, phase bearing cosines, or phase bearing sines. In PeakLab, the Fourier basis functions are reported as phase bearing sinusoids. In the above equation, A is the amplitude reported, nu is the frequency, and theta is the phase. The signal at any time t can be reconstructed by summing the value of all Nspec sinusoids in the spectrum evaluated at that time. The amplitudes are adjusted so that all power is represented in the positive frequencies.
Spectral leakage is the term used to describe the loss of power of a given frequency to other frequency bins in the FFT. Approximating a finite data stream with an infinite Fourier series assumes the data are fully periodic. Few data sets actually evidence this continuous wraparound property. Instead there are edge effects arising from the discontinuity at the bounds that cause spectral leakage.
Spectral leakage also occurs as a consequence of the linear fixed frequencies used in the FFT. Unless a sinusoidís frequency just happens to correspond with the exact center of an FFT frequency bin, some portion of the signal will leak to other bins. One can expect, therefore, some portion of the adjacent bins to also reflect some measure of this peak. In fact, when a spectral componentís frequency is not centered in a bin, some portion of the variance due to this component may be accounted for by each bin in the spectrum.
This tends to diminish as you get further away from the frequency of interest, although there will be harmonics. A sine and cosine at multiples of the original frequency, for example, would be expected to capture some of the variance as well. From another viewpoint, an FFT can be considered a linear least-squares fit to sine and cosine functions at fixed linearly increasing frequencies. If a single sine wave is fit non-linearly, the parameters can be fully resolved since the amplitude, frequency, and phase can each vary in order to find the optimum. This is not possible in an FFT. While the amplitude and phase can vary, the frequencies cannot. Unless the frequency of the sine wave just happens to fall exactly at one of the FFTís fixed frequencies, the sine component will be smeared across multiple frequencies.
While the spectral leakage attributable to the fixed frequencies is an intrinsic part of a Fourier spectrum, much can be done to eliminate edge effects. To produce the minimum spectral leakage, the data can approximate an infinite sequence by decaying to zero at both endpoints. This is accomplished by using a data tapering window.
Data Tapering Windows
These windows are generally applied in the time domain, even when they are built within the frequency domain. This is because a simple multiplication is all that is needed to implement the tapering in the time domain. PeakLab includes a broad selection of data tapering windows with merit in signal processing.
A rectangular window (no actual window is applied) produces a one-sided bin width of 1.0 in the frequency domain. The data tapering windows in PeakLab vary in Fourier bin width from 1.1 to 6.0. Many popular windows have widths of 2.0, 3.0, and 4.0. When a data set is windowed, portions of the signal nearer the bounds are discarded, and resolution is degraded. A window with a bin width of 2.0 will have only one-half the resolution of its non-windowed counterpart. A window with a bin width of 4.0 will have only one-quarter the resolution.
Although some portion of the dataís influence is discarded or diminished, and despite the loss of resolution, windowed FFTs are often the best course for accurate estimation of spectral components, especially when a high dynamic range is needed. By having the data smoothly vary and decay to zero at the endpoints, spectral leakage is drastically reduced, so much so that a decibel (dB) scale, which is logarithmic, must be used to observe the spectral leakage across the bins in a meaningful way.
When an FFT processes data that have been tapered by a time domain window, each frequency bin effectively becomes wider. This width is sometimes referred to as the order of the window. Hann and Hamming windows spread the signal across 2 bins and are thus order 2 windows. This spreading eliminates much of the spectral leakage associated with being too near an edge of a frequency bin.
While there are a variety of window taper properties, the bin width is certainly the most important since this determines the resolution of the signal as well as the dynamic range the FFT is capable of representing. Each window has a characteristic shape which fixes most of the resolving properties of the resultant frequency spectrum. Some windows have an adjustable parameter, and for all of PeakLabís data tapering windows, this controls the width of the peak in the frequency domain. The control for most adjustable windows has been modified to directly reflect this bin width.
The Chebyshev window is an exception. It produces the narrowest possible peak for a specific side lobe (adjacent harmonic) leakage level. Constructed in the frequency domain, the adjustable control specifies this maximum side lobe level directly.
Certain windows minimize the leakage at adjacent sidelobes, at the cost of low to negligible frequency decay (rolloff) as you move further away from the peak in frequency. These windows give excellent resolution of closely spaced peaks of varying power in the spectrum, but may mask peaks of low power far from the peak frequencies.
Other windows maximize the decay or rolloff of the spectral leakage, but are not as good at minimizing the leakage at nearby frequencies. Two peaks distant in frequency, each of low power, may be well detected, but in the case of two closely spaced peaks, one of greater power may fully mask one of lesser power.
There are thus two key design criteria in selecting a data tapering window. The first is resolution. Select the greatest bin width that offers acceptable resolution. The second involves selecting a window of that order based on whether or not you want to primarily resolve distant peaks of low power (where a maximum rolloff window is selected), or whether a low power peak may be in the shadow of a nearby component of greater power. Often a compromise is chosen. The best-known windows, such as the popular 4-parameter Blackman-Harris, cs4 BHarris min, tend to be those which minimize the adjacent sidelobe spectral leakage.