Generate/SPEC22.gif Short-Time Fourier Transform Spectrum


The Short-Time Fourier Transform Spectrum option in the Spectral menu or the Spectral toolbar furnishes Fourier spectral information for non-stationary data. Much as in the Fourier Spectra of Segmented Data option, the STFT is based upon a series of segmented and overlapped FFTs that occur across the data stream. In the STFT, the individual FFTs from these multiple segments are rendered as either a 3D surface plot (or a 2D contour plot). Both give a good indication of the time-frequency properties of the data series. The STFT can thus be used to assess whether or not a signal is stationary.

In this option, windowing is almost always used to sharpen the resolution in time as well as to reduce spectral leakage. For each individual FFT, the time assigned is that of the center of the segment (the peak of the data tapering window). In the STFT, the goal of the overlapping segments is not to produce an average spectrum with a reduced variance for the estimated power, but rather to produce a time-frequency representation for the data. A high degree of redundancy (overlap) can result in a more accurate time-frequency spectrum.

Since the STFT is based upon the FFT, there is a fixed resolution between frequencies. The frequency resolution is set mainly by the size of the segment, although some benefits may be derived from using a higher count (zero-padded) FFT, especially when using small segment sizes. The segment size also determines the percent of the overall data stream processed in a single FFT. Thus the time resolution is also fixed by the segment size (and to a much lesser extent by the sharpness of the data tapering window). The segment size thus controls the tradeoff between frequency resolution and time resolution, and it will be constant everywhere in the time-frequency spectrum. Optimizing the STFT usually involves (1) finding an appropriate segment size, (2) setting the density in time by adjusting the amount of redundancy or overlap between the segments, (3) zero-padding the FFT for small segment sizes to better render spectral maxima, and (4) choosing an appropriate data tapering window.

The STFT is thus classified as a fixed or single resolution method for time-frequency analysis. Optimizing the STFT can require some effort. In many instances, a multiresolution analysis is simpler to use and more robust. At high frequencies, a short time segment is often sufficient to capture the necessary spectral information. On the other hand, at low frequencies it is usually better to use a longer time segment to gather sufficient information about the oscillation. The ability to adjust this time-frequency resolution tradeoff in this manner is an integral part of wavelet analysis. In general, continuous wavelet spectra will offer a better overall picture of time-frequency space than the STFT.

The STFT does have an advantage when it comes to rendering powers. It is possible to integrate a 3D wavelet spectrum in order to get power just as it is possible to integrate the STFT and extract power information from the volume under the surface. The multiresolution property of wavelet analysis makes it impossible, however, to get relative powers directly from the magnitude of the 3D peaks in the wavelet spectrum. The STFT does offer this property where the power is linearly proportional to the height of the peaks. It is also a simple matter for the STFT to offer an amplitude plot option.

Transform

For this procedure, AutoSignal constrains the FFT algorithm to the Best Exact N option (there is no algorithm selection).

Window

AutoSignal offers a broad selection of data tapering windows to minimze spectral leakage. The adj field is used to set the parameter for adjustable windows. This field will be disabled for fixed windows.

This procedure normally employs a data tapering window to reduce spectral leakage and improve the resolution in time. The high redundancy that arises from a significant overlap compensates for the loss of information at the bounds of each taper.

Generate/8953.gif The Explore Data Tapering Windows option is available to assist with data window selection and adjustment. This option plots a discrete FFT in a problem designed to illustrate the frequency widths of each window as well as the rolloff vs. maximum sidelobe tradeoff. Up to four windows can be inspected simultaneously and key window properties are empirically determined.

When a data window is used, each segment's spectrum is normalized so that its power is equivalent to the non-windowed case.

Segments

The length of each of segment, Seg n, and the amount of overlap, overlap %, are critical to getting a good STFT spectrum. A high degree of redundancy is generally recommended. The segment size should be as small as possible to maximize the resolution in time, and as large as possible to maximize the resolution in frequency. The time-frequency resolution tradeoff will be readily apparent when working with the STFT.

To accommodate zero padding, the actual N of the FFT, FFT n, is also specified. When a data tapering window is used, very little spectral leakage arises from the zero-padding. Zero-padding is especially useful for interpolating peak frequencies with this algorithm, given the loss in resolution that is incurred when using small segment sizes. The Sections informational field will display the number of FFTs used to produce the STFT. This will be the number of time nodes in the spectrum.

While zero padding cannot sharpen the frequency response, it can interpolate the segment spectra so that peak maxima are better detected and plotted. For performance and memory reasons, the bicubic spline interpolant used by the 3D graphing engine directly renders the spectrum only when there are fewer than 16384 nodes in the grid. This means that an FFT of 1024 (513 spectral points) should use no more than 31 total segments in order for direct rendering to occur. The following table may assist:

FFT      Spectra n      Max Segments
32      17            963
64      33            496
128      65            252
256      129            127
512      257            63
1024      513            31
2048      1025            15
4096      2049            7
8192      4097            3

When more than 16384 nodes would occur from the spectra size*segments, an averaging decimation is used with each individual FFT. Decimated spectra retain power, although performance is slower, and there will be some attenuation of the spectral peaks.

Unlike multiresolution wavelet analysis, the STFT's adjustments are not going to automatically generate a good representation of time-frequency space. For example, the Generate Signal option with sample3.sig.produces a 1024 point data set with four sequential sinusoids of random amplitudes, frequencies, and phases. The generated signal was modified slightly to generate amplitudes of 100, 120, 80, and 120. When the segment length is 70, the overlap 50%, and the FFT length is set to 512, the STFT spectrum accurately renders these amplitudes:

Generate/HELP16.jpg

The amplitudes are rendered quite poorly if the STFT uses a 256 segment length with 50% overlap and a 256 length FFT:

Generate/HELP17.jpg

Memory Issues

For the STFT, a separate FFT is generated for each segment. For memory reasons, AutoSignal limits the number of STFT segments (time snapshots) to a maximum that will be in the vicinity of 512.

The STFT is especially prone to using up available memory. Zero padding results in additional spectral frequencies whose magnitudes must be stored in memory. The spectral data is fitted to a bicubic B-spline for 3D rendering and surface integration. AutoSignal limits the total rendering grid to 16,384 elements. If the spectral grid is larger than this, an averaging decimation is used. The STFT surface is then stored as a grid of B-spline coefficients that consumes yet more memory.

The amount of physical memory (RAM) free for AutoSignal's use is shown in the main status window in the Mem field. When dealing with large data sets, particularly WAV files, it is not difficult to exhaust this memory. When this happens, Windows uses the hard disk for memory operations. Excessive disk activity and extremely slow processing and procedure closure times will result if the physical memory is insufficient.

To best conserve memory resources with the STFT, zero pad the segments only when absolutely necessary, and do so only to the extent this is needed for frequency resolution. Further, avoid high overlap settings which result in such a large number of segments. The relation with overlap is not linear. A modest increase in overlap may significantly increase the number of segments and the amount of memory required. Although AutoSignal permits overlaps as high as 90%, there is usually little benefit beyond 50-70%.

If these guidelines are insufficient to prevent the hard disk thrashing and drastically diminished performance that results from exhausting physical memory, you can try breaking up the large data stream into smaller separate data sets. Given the relatively low cost of RAM, upgrading to 64, 96, or 128 Mb may be a good investment if you will be doing a good deal of non-stationary analysis of large data streams using the STFT.

Plot

The frequency domain information can be plotted in a variety of formats. In the following table, Re is the real component of a given segment's FFT at a given frequency, Im is the imaginary component, n is the segment size, dx is the sampling interval, and var is the variance of the data series.

· Magnitude, sqrt(Re*Re+Im*Im)

· Amplitude, 2.0*sqrt(Re*Re+Im*Im)/n

· Phase, sine-based, Pi/2+atan(Im/Re)

· dB, decibels, 10.0*log10(Re*Re+Im*Im)

· dB Norm, decibels, normalized to 0 for frequency channel with maximum power

· Int=PSD SSA, Surface Integral is Sum Squared Amplitude Power, 2.0*(Re*Re+Im*Im)/n

· Int=PSD MSA, Surface Integral is Mean Squared Amplitude Power, 2.0*(Re*Re+Im*Im)/n/n

· Int=PSD TISA, Surface Integral is Time-Integral Squared Amplitude Power, 2.0*dx*(Re*Re+Im*Im)/n

In an amplitude plot, you see the actual amplitude of sine components. In a normalized decibel plot, the highest peak is at 0dB, a peak at -3dB would have half the power, and a peak at -6dB would have half the amplitude. The PSD TISA (time-integral squared amplitude power) is the actual integral under the curve defined by the square of the raw data.

The dBlim field is active only when the dB or dB Norm formats are used. A dB limit is used to furnish limits for the automatic scaling of the z range of the graph as well as to specify the exact z-gradient that will be rendered. The automatic z-scaling is not based directly upon the spectrum since there are often some very low valued elements in the STFT which would produce too great a z-range.

The dBlim value also specifies the exact z-range of the color gradients in the 3D rendering. The default of 24, in conjunction with the default Spectrum 24 3D Graph Type means that a different color will be used for each 1dB delta in the spectrum. Since the 3D Graph Types consist of 24, 32, and 48 color gradients, it it often convenient to select a dBlim value that produces meaningful differentiations. For example, if the Spectrum 48 gradient graph is used, a dBlim of 12 would result in a separate color for each 1/4 dB delta in the spectrum. At the lower threshold of the dB range, the surface is truncated even if the z-scaling would allow additional surface to be rendered at the limit color.

3D Graph Profile

AutoSignal offers four different profiles for viewing 3D surfaces. By default, the Contour profile displays a 24-gradient contour where the colors vary as in light spectra, the lowest power to highest power varying from red, through orange, yellow, green, blue, and violet (magenta). The Contour,Data profile displays a 32 gradient contour from blue to red with an overlay of the data. The Gradient profile offers a true 3D surface rendering with 24 z-gradients and a default 60x60 mesh rendering. The Shaded profile offers a 32-gradient surface plot whose colors are shaded by angular illumination with a default 120x120 mesh rendering.

These four profiles are fully customizable and can be set to any surface type, orientation, and format desired. The four profiles are automatically saved across sessions for each procedure implementing them.

3D Graph Options

The following options are available for 3D surface graphs:

3D Graph Type

3D Graph View

3D Graph Scaling

3D Graph Animation

3D Graph Titles

3D Graph Font

3D Graph Colors

3D Graph Points

3D Graph Copy

3D Graph Print

List

Generate/8943.gif The List Data option lists the index, time, frequency, and the spectral quantity currently plotted. The listing uses the AutoSignal text viewer facility.

Copy

Generate/8941.gif The Copy Data to Clipboard option copies the time, frequency and the spectral quantity currently plotted to the clipboard. Formats include full precision binary (for spreadsheets such as Excel) and ASCII (for pasting into text editors). You can generally find a Paste As option in most applications if you want specific control over the format imported.

Save

Generate/8942.gif The Save Data to Disk option writes the time, frequency and and the spectral quantity currently plotted to a supported file format. These formats include ASCII, Excel 97, Excel 95, Lotus WK3, Lotus WK1, SPSS, or Systat.

Production Facility

Generate/8946.gif The AutoSignal Automation facility allows unattended processing of large numbers of data sets. The data sets can be consolidated in an Excel file or acquired using a DLL. The numeric summaries and graphs can be exported to an MS Word RTF file, while the extended data summaries or the current spectra can be exported to an Excel 95 or Excel 97 file.

Numeric Summary

Generate/8949.gif The Numeric Summary offers an STFT report. The report optionally includes a peak map where the three highest frequencies at each time are listed.

Rich-Text Format Export

Generate/8971.gif The Export Numeric Summary and Graph to RTF File option writes the numeric summary and spectral plot to an RTF file. The numeric portion of the file is based upon the current settings in the Numeric Summary option. The text data will be written to portrait orientation pages. The graph uses the current settings and size of the spectral plot, and is inserted as a Windows Metafile. The graph always uses a landscape orientation. Beyond a certain size, the graph utilizes a full landscape page.

Surface Interpolant

The surface is rendered for display and integration using a Bicubic B-Spline interpolant. It will exactly interpolate the STFT spectrum. Note that the STFT spectrum will be decimated if the number of nodes determined by spectrum size * segments would be greater than 16384. Thus the B-spline surface is never constructed of more than 16384 nodes in the grid.

Evaluate 3D Surface

Generate/8958.gif The Evaluation offers a full-featured numeric evalation of the surface, partial derivatives, roots, and volumes as well as offering a means for generating a table or file of any size using a generated XY grid or by importing XY data from supported file formats. You can use this option to integrate any portion of the time-frequency surface in order to determine the power present.

Fast 3D Evaluation

Generate/8959.gif The Quick Evaluation offers the means to evaluate the Z of the surface at any X,Y. It also reports the X,Y,Z representing the surface minimum and maximum.

Spectrum Power Evaluation

The Pwr and Data information fields reflect two TISA (time-integral squared amplitude) measurements. Both are made for the range of time present in the STFT. This will be shorter than the time range of the data since the center of the first and last FFT segment will be in from the edges of the data. The Data value computes the TISA power for the raw data while the Pwr value computes the spectrum's power as the integral of the 3D time-frequency surface (this is the volume under the spectral surface). The two values should be in good agreement, but will not be exact since it is the bivariate B-spline interpolant that is being integrated.

Local Options

A local option changes the data set for the duration of the current procedure only. The main data table is not altered. AutoSignal offers four local options in most of the spectral procedures.

Generate/8930.gif Section the data to isolate specific regions for processing.

Generate/8955.gif Detrend for removing mean or subtracting a least-squares trend model.

Generate/8931.gif Fourier Filtration for isolating spectral components by frequency.

Generate/8954.gif Eigendecomposition Filtration for isolating spectral components by signal strength.

Generate/8912.gif The Reset button restores the data to its state when first entering the procedure. Note that if you implement sequential local procedures, all of the revisions are discarded upon reset. If an Automation Session is in progress, the Reset button can be used to terminate the automated processing.



INDEX Numeric Summary (EigenAnalysis) Numeric Summary (STFT)