Time-Frequency Spectral Analysis Object and Template – Short-Time Fourier Transform (STFT) Spectrum

23.08.2021

The Short-Time Fourier Transform (STFT) spectral option furnishes Fourier spectral information for non-stationary data, i.e., for data whose spectral information is affected by time. The STFT is often used to assess whether or not a signal is stationary.

Spectrum Type

The frequency domain information can be output in an variety of formats. In the following table, Re is the real component of a given segment's real (single sided) FFT at a given frequency, Im is the imaginary component, δF is the frequency spacing of the spectrum, n is the data segment size, δX is the sampling interval, and σ² is the data set variance.

Spectrum Type

Formula/Description

Amplitude

sqrt(Re² + Im²) / n

RMS

sqrt((Re² + Im²) / 2) / n

Amplitude²

(Re² + Im²) / n²

dB

20 * log10(sqrt(Re² + Im²) / n / Aref)

Aref = Reference amplitude, which is assigned 0 dB

dB normalized

20 * log10(sqrt(Re² + Im²) / n) - dBmax

dBmax = dB value of the spectral line with maximum amplitude

PSD - Power Spectral Density

(Re² + Im²) / n² / δF / 2

TISA - Time Integral Amplitude²

δX * (Re² + Im²) / n / 2

MSA - Mean Amplitude²

(Re² + Im²) / n² / 2

SSA - Sum Amplitude²

(Re² + Im²) / n / 2

Variance

(Re² + Im²) / (n * σ²) / 2

Magnitude²

Re² + Im²

Magnitude

sqrt(Re² + Im²)

In an amplitude plot, you see the actual amplitude of sine components. In a normalized decibel plot, the highest peak is at 0 dB, a peak at -3 dB would have half the power and a peak at -6 dB 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.

Windows

FlexPro offers a variety of tapering windows to reduce the spectral leakage. The Window adjustment field is used to set the spectral width, and thus the dynamic range, of 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.

The list box Normalization offers two options to normalize after applying the window. Selecting Amplitude normalizes to the gain of the used window function, i.e. the sum of all values is divided by their number. This compensates the damping of the amplitudes caused by applying the window. This is especially useful to measure peaks within the spectrum. If you select Power the loss of power is compensated. The ratio of the sum of the squared data before and after applying the window is used as a normalization factor. The total power within the spectrum therefore always corresponds to the power of the data before applying the window.

Parameters

The length of each of segment, Segment Length, and the amount of overlap, Overlap %, are critical to getting a good STFT spectrum. A high degree of redundancy is generally recommended. With the setting Gap in samples the data continue to be ignored. This setting should only be selected for very long time series with slowly changing spectral content. 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. The default value of 0 sets the segment length to the double of the square root of the data length, rounded up to the next power of two. With the default overlap of 50% this leads to about double as much frequencies than time values.

To accommodate zero padding, the FFT Length can be specified separately. Zero padding occurs when you set the FFT length to a value greater than the segment length. You can enter 0 for the FFT length to set it to the segment length. When a data tapering window is used, then zero-padding causes very little spectral leakage. Zero-padding is especially useful for interpolating peak frequencies with this algorithm, given the loss in resolution incurred by the reduced size of the segments.

Options - Maximum dB Range and Number of Frequencies

The Maximum dB range field is enabled only for the dB and dB normalized formats. A dB limit is used to furnish limits for the automatic scaling of the Y range of the graph as well as to specify the exact Y gradient that will be rendered. Please enter 0 in this field to specify an unlimited dB range.

The value Maximum STFT frequency values is used to set the threshold for decimation by averaging. This decimation is done to maintain a manageable size for the 3D rendering engine. Decimated spectra retain power, although there will be some attenuation of the spectral peaks. The maximum of 10,000 frequencies, allows for an FFT length of 20,000 - 1 with no decimation imposed. Please enter 0 in this field to do not want to reduce the number of frequencies. The size of the STFT grid is the number of frequencies x number of segments.

Options - Set/Clear Reference (Analysis Wizard Only)

This function lets you compare various spectral procedures and settings. You can view a copy of the currently displayed spectrum in the lower pane by pressing Set Reference. Next, you can adjust additional settings that affect the display in the upper pane. With Clear Reference you can remove the copy and the time signal will appear again.

Result

Traditionally, STFT contour plots have frequency as the horizontal variable and the CWT contour plots typically have time as the horizontal variable. In order to make the STFT and CWT comparable, both plot orientations are offered.

Particularly for evaluating run-ups, you can specify a synchronically measured Speed signal to replace the time in the result with the speed. In this case, FlexPro assigns the applicable rotational speed at the time it is captured to each single spectrum. The spectra are automatically sorted in the result according to increasing speed.

Memory Issues

For the STFT, a separate FFT is generated for each segment. As such, the STFT is especially prone to using up available memory. Zero padding results in additional spectral frequencies whose magnitudes must be stored in memory. While FlexPro imposes decimation beyond a specified frequency count, the rendering grid can still be very large and can exhaust system 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 FlexPro permits overlaps as high as 90%, there is usually little benefit beyond 50 to 70%.

FPScript Functions Used

STFTSpectrum

See Also

Analysis Objects

Spectral Analysis Option

Time-Frequency Spectral Analysis Object

STFT Algorithm

Fourier Spectral Analysis

Data Tapering Window

Time-Frequency Spectral Analysis Tutorial

Share article or send as email:

You might be interested in these articles