Short-time FFT

The `dsp.STFT`

object computes the short-time Fourier transform
(STFT) of the time-domain input signal. The object accepts frames of time-domain data, buffers
them to the desired window length and overlap length, multiplies the samples by the window,
and then performs FFT on the buffered windows. For more details, see Algorithms.

Use the STFT to analyze the frequency content of a signal that varies with time.

`stf = dsp.STFT`

`stf = dsp.STFT(window)`

`stf = dsp.STFT(window,overlap)`

`stf = dsp.STFT(window,overlap,nfft)`

`stf = dsp.STFT(Name,Value)`

returns an object,
`stf`

= dsp.STFT`stf`

, that implements the short-time FFT. The object processes the
data independently across each input channel over time.

returns a short-time FFT object with the Window property
set to `stf`

= dsp.STFT(`window`

)`window`

.

returns a short-time FFT object with the `stf`

= dsp.STFT(`window`

,`overlap`

)`Window`

property set to
`window`

and the OverlapLength
property set to `overlap`

.

returns a short-time FFT object with the `stf`

= dsp.STFT(`window`

,`overlap`

,`nfft`

)`Window`

property set to
`window`

, the `OverlapLength`

property set to
`overlap`

, and the FFTLength
property set to `nfft`

.

returns a short-time FFT object with each specified property name set to the specified
value. You can specify additional name-value pair arguments in any order.`stf`

= dsp.STFT(`Name,Value`

)

`y = stf(x)`

Here is a sketch of how the algorithm is implemented:

The time-domain input signal is buffered based on a user-specified window length
(*WL*) and overlap length (*OL*). The hop size,
*R*, is defined as *R* = *WL* –
*OL*. Buffered windows are multiplied by a user-specified window of length
*WL*. The STFT output is the FFT of this product. The number of time-domain
samples required to form a new FFT output is *R*.

Here is an illustration of how a random signal looks like in the original time-domain, after multiplying with the overlapping windows, and after applying FFT on the multiplied windows:

[1] Allen, J.B., and L. R. Rabiner. "A
Unified Approach to Short-Time Fourier Analysis and Synthesis,'' *Proceedings of the
IEEE, Vol. 65,* pp. 1558–1564, Nov. 1977.