DSP Blockset | ![]() ![]() |
Compute and display the short-time FFT of each input signal.
Library
Description
The Spectrum Scope block computes and displays the magnitude-squared FFT of the input. The input be a 1-D vector or a 2-D matrix of any frame status.
When the input is a 1-by-N sample-based vector or M-by-N sample-based matrix, you must select the Buffer input check box. Each of the N vector elements (or M*N matrix elements) is then treated as an independent channel, and the block buffers and displays the data in each channel independently.
When the input is frame-based, you can leave the input as is, or rebuffer data by checking the Buffer input check box and specifying the new buffer size. In the latter case, you can also specify an optional Buffer overlap.
Buffering 1-D vector inputs is recommended. In this case, the inputs are buffered into frames (the length of which are specified in the Buffer size parameter), where each 1-D input vector becomes a row in the buffered outcome. If a 1-D vector input is left unbuffered, you will get a warning because the block is computing the FFT of a scalar; though the scope window appears, it is unlikely you will be able to see the plot, and a warning is also displayed on the scope itself. It is not recommended that you leave 1-D inputs unbuffered.
The number of input samples that the block buffers before computing and displaying the magnitude FFT is specified by the Buffer size parameter, Mo. The Buffer overlap parameter, L, specifies the number of samples from the previous buffer to include in the current buffer. The number of new input samples the block acquires before computing and displaying the magnitude FFT is the difference between the Buffer size and Buffer overlap, Mo-L.
The display update period is (Mo-L)*Ts, where Ts is the input sample period, and is equal to the input sample period when the Buffer overlap is Mo-1. For negative Buffer overlap values, the block simply discards the appropriate number of input samples after the buffer fills, and updates the scope display at a slower rate than the zero-overlap case.
When the FFT length check box is cleared and the input is buffered, the block uses the buffer size as the FFT size. If the check box is cleared and the input is not buffered, the block uses the input size as the FFT size. When the check box is selected, the FFT length parameter, Nfft, is enabled, and specifies the number of samples on which to perform the FFT. The block zero pads or truncates every channel's buffer to Nfft before computing the FFT.
The number of spectra to average is set by the Number of spectral averages parameter. Setting this parameter to 1 effectively disables averaging; See Short-Time FFT for more information.
In order to correctly scale the frequency axis (i.e., to determine the frequencies against which the transformed input data should be plotted), the block needs to know the actual sample period of the time-domain input. This is specified by the Sample time of original time series parameter, Ts.
When the Inherit sample time from input check box is selected, the block computes the frequency data from the sample period of the input to the block. This is valid when the following conditions hold:
One example when these conditions do not hold, is such as when the input to the block is not the original signal, but a zero-padded or otherwise rate-altered version. In such cases, you should specify the appropriate value for the Sample time of original time-series parameter.
The Frequency units parameter specifies whether the frequency axis values should be in units of Hertz or rad/s, and the Frequency range parameter specifies the range of frequencies over which the magnitudes in the input should be plotted. The available options are [0..Fs/2], [-Fs/2..Fs/2], and [0..Fs], where Fs is the time-domain signal's actual sample frequency. If the Frequency units parameter specifies Hertz, the spacing between frequency points is 1/(NfftTs). For Frequency units of rad/sec, the spacing between frequency points is 2/(NfftTs).
Note that all of the FFT-based blocks in the DSP Blockset, including those in the Power Spectrum Estimation library, compute the FFT at frequencies in the range [0,Fs). The Frequency range parameter controls only the displayed range of the signal.
For information about the scope window, as well as the Display properties, Axis properties, and Line properties panels in the dialog box, see the reference page for the Vector Scope block.
Dialog Box
The number of spectra to average. Setting this parameter to 1
effectively disables averaging. See Short-Time FFT for more information. Tunable.
Supported Data Types
To learn how to convert to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.
See Also
FFT |
DSP Blockset |
Vector Scope |
DSP Blockset |
Also see the following topics:
![]() | Sort | Stack | ![]() |