The short-time Fourier transform (STFT) is a Fourier-related transform 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 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).
Forward STFT
Continuous-time STFT Simply, in the continuous-time case, the function to be transformed is multiplied by a window function which is nonzero for only a short period of time. The Fourier transform (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:
𝐒𝐓𝐅𝐓{x(t)}(τ,ω)≡X(τ,ω)=∫−∞∞x(t)w(t−τ)e−iωtdt where w(τ) is the window function, commonly a Hann window or Gaussian window centered around zero, and x(t) is the signal to be transformed (note the difference between the window function w and the frequency ω). X(τ,ω) is essentially the Fourier transform of x(t)w(t−τ), a complex function representing the phase and magnitude of the signal over time and frequency. Often phase unwrapping is employed along either or both the time axis, τ, and frequency axis, ω, to suppress any jump discontinuity 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 t. 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 transformed, 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:
𝐒𝐓𝐅𝐓{x[n]}(m,ω)≡X(m,ω)=∑n=−∞∞x[n]w[n−m]e−iωn likewise, with signal x[n] and window w[n]. In this case, m is discrete and ω is continuous, but in most typical applications the STFT is performed on a computer using the fast Fourier transform, so both variables are discrete and quantized. The magnitude squared of the STFT yields the spectrogram representation of the power spectral density of the function:
spectrogram{x(t)}(τ,ω)≡|X(τ,ω)|2 See also the modified discrete cosine transform (MDCT), which is also a Fourier-related transform that uses overlapping windows.
Sliding DFT If only a small number of ω are desired, or if the STFT is desired to be evaluated for every shift m of the window, then the STFT may be more efficiently evaluated using a sliding DFT algorithm.
Inverse STFT The STFT is invertible, that is, the original signal can be recovered from the transform by the inverse STFT. The most widely accepted way of inverting the STFT is by using the overlap-add (OLA) method, which also allows for modifications to the STFT complex spectrum. This makes for a versatile signal processing method, referred to as the overlap and add with modifications method.
Continuous-time STFT Given the width and definition of the window function w(t), we initially require the area of the window function to be scaled so that
∫−∞∞w(τ)dτ=1. It easily follows that
∫−∞∞w(t−τ)dτ=1∀ t and
x(t)=x(t)∫−∞∞w(t−τ)dτ=∫−∞∞x(t)w(t−τ)dτ. The continuous Fourier transform is
X(ω)=∫−∞∞x(t)e−iωtdt. Substituting x(t) from above:
X(ω)=∫−∞∞[∫−∞∞x(t)w(t−τ)dτ]e−iωtdt =∫−∞∞∫−∞∞x(t)w(t−τ)e−iωtdτdt. Swapping order of integration:
X(ω)=∫−∞∞∫−∞∞x(t)w(t−τ)e−iωtdtdτ =∫−∞∞[∫−∞∞x(t)w(t−τ)e−iωtdt]dτ =∫−∞∞X(τ,ω)dτ. So the Fourier transform can be seen as a sort of phase coherent sum of all of the STFTs of x(t). Since the inverse Fourier transform is
x(t)=12π∫−∞∞X(ω)e+iωtdω, then x(t) can be recovered from X(τ,ω) as
x(t)=12π∫−∞∞∫−∞∞X(τ,ω)e+iωtdτdω. or
x(t)=∫−∞∞[12π∫−∞∞X(τ,ω)e+iωtdω]dτ. It can be seen, comparing to above that windowed "grain" or "wavelet" of x(t) is
x(t)w(t−τ)=12π∫−∞∞X(τ,ω)e+iωtdω. the inverse Fourier transform of X(τ,ω) for τ fixed. An alternative definition that is valid only in the vicinity of τ, the inverse transform is:
x(t)=1w(t−τ)12π∫−∞∞X(τ,ω)e+iωtdω. In general, the window function w(t) has the following properties:
(a) even symmetry: w(t)=w(−t); (b) non-increasing (for positive time): w(t)≥w(s) if |t|≤|s|; (c) compact support: w(t) is equal to zero when |t| is large.
Resolution issues
One of the pitfalls of the STFT is that it has a fixed resolution. The width of the windowing function relates to how the signal is represented—it determines whether there is good frequency resolution (frequency components close together can be separated) or good time resolution (the time at which frequencies change). A wide window gives better frequency resolution but poor time resolution. A narrower window gives good time resolution but poor frequency resolution. These are called narrowband and wideband transforms, respectively.
… excerpt ends here. Continue reading the full article.





