The short-time Fourier transform (STFT) is a
Fourier-related transform
This is a list of linear transformations of functions related to Fourier analysis. Such transformations map a function to a set of coefficients of basis functions, where the basis functions are sinusoidal and are therefore strongly localized in t ...
used to determine the sinusoidal frequency and phase content of local sections of a signal as it changes over time. In practice, the procedure for computing STFTs is to divide a longer time signal into shorter segments of equal length and then compute the Fourier transform separately on each shorter segment. This reveals the Fourier spectrum on each shorter segment. One then usually plots the changing spectra as a function of time, known as a
spectrogram
A spectrogram is a visual representation of the spectrum of frequencies of a signal as it varies with time.
When applied to an audio signal, spectrograms are sometimes called sonographs, voiceprints, or voicegrams. When the data are represen ...
or
waterfall plot, such as commonly used in
software defined radio (SDR) based spectrum displays. Full bandwidth displays covering the whole range of an SDR commonly use fast Fourier transforms (FFTs) with 2^24 points on desktop computers.
Forward STFT
Continuous-time STFT
Simply, in the continuous-time case, the function to be transformed is multiplied by a
window function
In signal processing and statistics, a window function (also known as an apodization function or tapering function) is a mathematical function that is zero-valued outside of some chosen interval. Typically, window functions are symmetric around ...
which is nonzero for only a short period of time. The
Fourier transform
In mathematics, the Fourier transform (FT) is an integral transform that takes a function as input then outputs another function that describes the extent to which various frequencies are present in the original function. The output of the tr ...
(a one-dimensional function) of the resulting signal is taken, then the window is slid along the time axis until the end resulting in a two-dimensional representation of the signal. Mathematically, this is written as:
:
where
is the
window function
In signal processing and statistics, a window function (also known as an apodization function or tapering function) is a mathematical function that is zero-valued outside of some chosen interval. Typically, window functions are symmetric around ...
, commonly a
Hann window or
Gaussian window
In signal processing and statistics, a window function (also known as an apodization function or tapering function) is a function (mathematics), mathematical function that is zero-valued outside of some chosen interval (mathematics), interval. T ...
centered around zero, and
is the signal to be transformed (note the difference between the window function
and the frequency
).
is essentially the Fourier transform of
, a
complex function
Complex analysis, traditionally known as the theory of functions of a complex variable, is the branch of mathematical analysis that investigates functions of complex numbers. It is helpful in many branches of mathematics, including algebraic g ...
representing the phase and magnitude of the signal over time and frequency. Often
phase unwrapping
Instantaneous phase and frequency are important concepts in signal processing that occur in the context of the representation and analysis of time-varying functions. The instantaneous phase (also known as local phase or simply phase) of a ''compl ...
is employed along either or both the time axis,
, and frequency axis,
, to suppress any
jump discontinuity
Continuous functions are of utmost importance in mathematics, functions and applications. However, not all Function (mathematics), functions are continuous. If a function is not continuous at a limit point (also called "accumulation point" or "clu ...
of the phase result of the STFT. The time index
is normally considered to be "''slow''" time and usually not expressed in as high resolution as time
. Given that the STFT is essentially a Fourier transform times a window function, the STFT is also called windowed Fourier transform or time-dependent Fourier transform.
Discrete-time STFT
In the discrete time case, the data to be transformed could be broken up into chunks or frames (which usually overlap each other, to reduce artifacts at the boundary). Each chunk is
Fourier transform
In mathematics, the Fourier transform (FT) is an integral transform that takes a function as input then outputs another function that describes the extent to which various frequencies are present in the original function. The output of the tr ...
ed, and the complex result is added to a matrix, which records magnitude and phase for each point in time and frequency. This can be expressed as:
:
likewise, with signal