Short-Time FFT - Nonparametric estimate of spectrum using short-time fast Fourier transform (STFT)
method - Simulink ([original](https://www.mathworks.com/help/dsp/ref/shorttimefft.html)) ([raw](?raw))
Main Content
Nonparametric estimate of spectrum using short-time fast Fourier transform (STFT) method
Libraries:
DSP System Toolbox / Transforms
Description
The Short-Time FFT block computes a nonparametric estimate of the spectrum. The block buffers, applies a window, and zero pads the input signal. The block then takes the FFT of the signal, transforming it into the frequency domain.
Examples
Ports
Input
Specify the time-domain input signal as a vector or a matrix. If the input is a matrix, the block treats each column as an independent channel. The input can be a variable-size signal. That is, the frame size of the signal can change while the simulation is running. The number of channels must remain the same.
If the input is fixed point, it must be a signed integer or a signed fixed point value with a power-of-two slope and zero bias.
Data Types: single
| double
| int8
| int16
| int32
| fixed point
Complex Number Support: Yes
Connect your single-channel analysis window to the w[n] port. For the Analysis window length parameter, enter the length of the analysis window W. The block buffers the input signal such that it has a frame length of_W_.
If the window vector is fixed point, it must be a signed integer or signed fixed point with a power-of-two slope and zero bias.
Data Types: single
| double
| int8
| int16
| int32
| fixed point
Output
The block outputs the complex-valued single-channel or multichannel short-time FFT at this port.
Data Types: single
| double
| int8
| int16
| int32
| fixed point
Complex Number Support: Yes
Parameters
Specify the frame length of the analysis window as a positive integer greater than 1. The block buffers the input into overlapping window segments using the specified window length and overlap length, and then multiplies each overlapped segment by the window.
Specify the number of samples by which consecutive windows overlap in each frame of the input signal as a nonnegative integer. The window overlap reduces artifacts at the data boundaries.
Enter the length up to which the block pads the input signal as a positive integer greater than or equal to 2. After the block buffers and windows the signal, it zero-pads the signal before computing the FFT. This parameter determines the length of the short-time fast Fourier transform output (number of rows). The FFT length must be greater than or equal to the window length.
Block Characteristics
Data Types | double | fixed point | integer | single |
---|---|---|---|
Direct Feedthrough | no | ||
Multidimensional Signals | no | ||
Variable-Size Signals | no | ||
Zero-Crossing Detection | no |
More About
The following diagram shows the data types used within the Short-Time FFT subsystem block for fixed-point signals.
The values of the fixed-point parameters of the Array-Vector Multiply block in this diagram are:
- Rounding Mode —
Floor
- Saturate on integer overflow —
Wrap
- Product output —
Inherit via internal rule
- Accumulator —
Inherit via internal rule
- Output —
Same as first input
The values of the fixed-point parameters of the FFT block in this diagram are:
- Rounding Mode —
Floor
- Saturate on integer overflow —
Wrap
- Sine table —
Same word length as input
- Product output —
Inherit via internal rule
- Accumulator —
Inherit via internal rule
- Output —
Inherit via internal rule
See the FFT and Array-Vector Multiply block reference pages for more information.
References
[1] Quatieri, Thomas E.Discrete-Time Speech Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, 2001.
Extended Capabilities
Usage notes and limitations:
- Generated code relies on the
memcpy
ormemset
function (string.h
) under certain conditions. - When the FFT length is not a power of two, the executable generated from this block relies on prebuilt dynamic library files (
.dll
files) included with MATLAB®. Use thepackNGo
function to package the code generated from this block and all the relevant files in a compressed zip file. Using this zip file, you can relocate, unpack, and rebuild your project in another development environment where MATLAB is not installed. For more details, see How To Run a Generated Executable Outside MATLAB.
When the FFT length is a power of two, you can generate standalone C and C++ code from this block.
Version History
Introduced before R2006a