Computes the signal energy distribution in the joint time-frequency domain by using the short-time Fourier transform (STFT) algorithm.
Configuration of the FFT size of the STFT. This input determines the number of columns in the output STFT spectrogram.
A Boolean that determines whether to coerce the frequency bins to a power of 2. If this input is True and the frequency bins is not a power of 2, this node sets the frequency bins to the nearest power of 2.
True | Coerces the frequency bins to a power of 2. |
False | Does not coerce the frequency bins to a power of 2. |
Default: True
A Boolean that determines whether to exclude the energy at the Nyquist frequency from the output STFT.
True | If the FFT size of the STFT is even and this input is True, the output STFT does not include the energy at the Nyquist frequency. |
False | Includes the energy at the Nyquist frequency. |
If the FFT size of the STFT is odd, this node ignores this input.
Default: True
Input time-domain signal.
The density to use to sample the signal in the joint time-frequency domain and to define the size of the resulting 2D time-frequency array.
Number of samples to shift the sliding window. When this input is less than or equal to zero, this node adjusts this input automatically so that no more than 512 rows exist in output STFT.
Performance Considerations
If you specify a small value for time steps, the node might return a large spectrogram, which requires a long computation time and more memory. NI recommends you set time steps so that the number of rows in STFT spectrogram does not exceed 512. If you need a small sampling rate to observe more details and the signal length is large, divide the signal into smaller segments and compute the spectrogram for each segment.
Default: -1
FFT size of the STFT. If this input is less than or equal to zero, this node sets the input to 512. If this input is 1, this node coerces the input to 2.
Default: 512
Information about the window to use to compute the STFT.
Type of window to use to compute the STFT.
Name | Value | Description |
---|---|---|
Rectangle | 0 | |
Hanning | 1 | |
Hamming | 2 | |
Blackman-Harris | 3 | |
Exact Blackman | 4 | |
Blackman | 5 | |
Flat Top | 6 | |
4 Term B-Harris | 7 | |
7 Term B-Harris | 8 | |
Low Sidelobe | 9 | |
Blackman Nuttall | 11 | |
Triangle | 30 | |
Bartlett-Hanning | 31 | |
Bohman | 32 | |
Parzen | 33 | |
Welch | 34 | |
Kaiser | 60 | |
Dolph-Chebyshev | 61 | |
Gaussian | 62 | |
Force | 64 | |
Exponential | 65 |
Default: Hanning
Length of the window in samples. If this input is less than or equal to zero, this node sets the input to 64.
Default: 64
A value that affects the output coefficients when window type is Kaiser, Gaussian, or Dolph-Chebyshev.
If window type is any other type of window, this node ignores this input.
This input represents the following information for each type of window:
Default: NaN—Causes this node to set beta to 0 for a Kaiser window, the standard deviation to 0.2 for a Gaussian window, and s to 60 for a Dolph-Chebyshev window
Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.
Default: No error
A Boolean that determines whether to scale the STFT spectrogram so that the energy in the joint time-frequency domain equals the energy in the time domain.
True | Scales the STFT spectrogram so that the energy in the joint time-frequency domain equals the energy in the time domain. |
False | Does not scale the STFT spectrogram so that the energy in the joint time-frequency domain equals the energy in the time domain. |
Default: True
A 2D array that describes the time waveform energy distribution in the joint time-frequency domain.
To compute the output STFT Spectrogram, this node completes the following process.
The following figure shows the procedure this node uses to compute the STFT.
If the input force freq bins to power of 2? is True and the input frequency bins is not a power of 2, then the following equation holds true:
where $\left[\right]$ is the nearest operation.
Otherwise, K is equal to frequency bins.
If the result of the STFT is the matrix $\text{STFT}\left\{X\right\}$, then the size of $\text{STFT}\left\{X\right\}$ is M-by-K, where the following are true:
You can use the $\text{STFT}\left\{X\right\}$ to approximate the energy in the joint time-frequency domain using the following expression:
This result almost equals the energy in the time domain, as shown in the following expression:
After computing the STFT of X, this node computes the STFT spectrogram of X. This node calculates the STFT spectrogram as the magnitude square of the elements in $\text{STFT}\left\{X\right\}$. Because the FFT returns symmetric results, this node calculates the STFT spectrogram only on the left half of $\text{STFT}\left\{X\right\}$, as shown in the following equation:
where the following are true:
Where This Node Can Run:
Desktop OS: Windows
FPGA: Not supported