# Short-time Fourier transform

﻿
Short-time Fourier transform

The short-time Fourier transform (STFT), or alternatively short-term Fourier transform, 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.

STFT

Continuous-time STFT

Simply described, 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 as the window is slid along the time axis, resulting in a two-dimensional representation of the signal. Mathematically, this is written as:

:$mathbf\left\{STFT\right\} left \left\{ x\left(t\right) ight \right\} equiv X\left( au, omega\right) = int_\left\{-infty\right\}^\left\{infty\right\} x\left(t\right) w\left(t- au\right) e^\left\{-j omega t\right\} , dt$

where "w"("t") is the window function, commonly a Hann window or Gaussian "hill" centered around zero, and "x"("t") is the signal to be transformed. "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".

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). 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:

:$mathbf\left\{STFT\right\} left \left\{ x \left[n\right] ight \right\} equiv X\left(m,omega\right) = sum_\left\{n=-infty\right\}^\left\{infty\right\} x \left[n\right] w \left[n-m\right] e^\left\{-j omega n\right\}$

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. Again, the discrete-time index "m" is normally considered to be "slow" time and usually not expressed in as high resolution as time "n".

The magnitude squared of the STFT yields the spectrogram of the function:

:$mathrm\left\{spectrogram\right\} left \left\{ x\left( t \right) ight \right\} equiv left| X\left( au, omega\right) ight|^2$

Inverse STFT

The STFT is invertible, that is, the original signal can be recovered from the transform by the Inverse STFT.

Continuous-time STFT

Given the width and definition of the window function "w"("t"), we initially require the height of the window function to be scaled so that

:$int_\left\{-infty\right\}^\left\{infty\right\} w\left( au\right) , d au = 1.$

It easily follows that

:$int_\left\{-infty\right\}^\left\{infty\right\} w\left(t- au\right) , d au = 1 quad forall t$

and

:$x\left(t\right) = x\left(t\right) int_\left\{-infty\right\}^\left\{infty\right\} w\left(t- au\right) , d au = int_\left\{-infty\right\}^\left\{infty\right\} x\left(t\right) w\left(t- au\right) , d au.$

The continuous Fourier Transform is

:$X\left(omega\right) = int_\left\{-infty\right\}^\left\{infty\right\} x\left(t\right) e^\left\{-j omega t\right\} , dt.$

Substituting "x"("t") from above:

:$X\left(omega\right) = int_\left\{-infty\right\}^\left\{infty\right\} left \left[ int_\left\{-infty\right\}^\left\{infty\right\} x\left(t\right) w\left(t- au\right) , d au ight\right] , e^\left\{-j omega t\right\} , dt$

:::$= int_\left\{-infty\right\}^\left\{infty\right\} int_\left\{-infty\right\}^\left\{infty\right\} x\left(t\right) w\left(t- au\right) , e^\left\{-j omega t\right\} , d au , dt.$

Swapping order of integration:

:$X\left(omega\right) = int_\left\{-infty\right\}^\left\{infty\right\} int_\left\{-infty\right\}^\left\{infty\right\} x\left(t\right) w\left(t- au\right) , e^\left\{-j omega t\right\} , dt , d au$

:::$= int_\left\{-infty\right\}^\left\{infty\right\} left \left[ int_\left\{-infty\right\}^\left\{infty\right\} x\left(t\right) w\left(t- au\right) , e^\left\{-j omega t\right\} , dt ight\right] , d au$

:::$= int_\left\{-infty\right\}^\left\{infty\right\} X\left( au, omega\right) , d au.$

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\left(t\right) = frac\left\{1\right\}\left\{2 pi\right\} int_\left\{-infty\right\}^\left\{infty\right\} X\left(omega\right) e^\left\{+j omega t\right\} , domega,$

then "x"("t") can be recovered from "X"(τ,ω) as

:$x\left(t\right) = frac\left\{1\right\}\left\{2 pi\right\} int_\left\{-infty\right\}^\left\{infty\right\} int_\left\{-infty\right\}^\left\{infty\right\} X\left( au, omega\right) e^\left\{+j omega t\right\} , d au , domega.$

or

:$x\left(t\right) = int_\left\{-infty\right\}^\left\{infty\right\} left \left[ frac\left\{1\right\}\left\{2 pi\right\} int_\left\{-infty\right\}^\left\{infty\right\} X\left( au, omega\right) e^\left\{+j omega t\right\} , domega ight\right] , d au.$

It can be seen, comparing to above that windowed "grain" or "wavelet" of "x"("t") is

:$x\left(t\right) w\left(t- au\right) = frac\left\{1\right\}\left\{2 pi\right\} int_\left\{-infty\right\}^\left\{infty\right\} X\left( au, omega\right) e^\left\{+j omega t\right\} , domega.$

the inverse Fourier transform of "X"(τ,ω) for τ fixed.

Discrete-time STFT

Resolution issues

One of the downfalls of the STFT is that it has a fixed resolution. The width of the windowing function relates to the 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 (said to be compactly supported) gives good time resolution but poor frequency resolution. These are called narrowband and wideband transforms, respectively.

This is one of the reasons for the creation of the wavelet transform (or multiresolution analysis in general), which can give good time resolution for high-frequency events, and good frequency resolution for low-frequency events, which is the type of analysis best suited for many real signals.

This property is related to the Heisenberg uncertainty principle, but it is not a direct relationship. The product of the standard deviation in time and frequency is limited. The boundary of the uncertainty principle (best simultaneous resolution of both) is reached with a Gaussian window functionFact|date=April 2008.

Example

Using the following sample signal $x\left(t\right)$ that is composed of a set of 4 sinusoidal waveforms joined together in sequence. Each waveform is only composed of one of four frequencies (10, 25, 50, 100 Hz). The definition of $x\left(t\right)$ is:

:

Then it is sampled at 400 Hz. The following spectrograms were produced:

The 25 ms window allows us to identify a precise time at which the signals change but the precise frequencies are difficult to identify. At the other end of the scale, the 1000 ms window allows the frequencies to be precisely seen but the time between frequency changes is blurred.

Explanation

It can also be explained with reference to the sampling and Nyquist frequency.

Take a window of "N" samples from an arbitrary real-valued signal at sampling rate "f"s . Taking the Fourier transform produces "N" coefficients. Of these coefficients only the first "N/2" are useful (the others are just a mirror image as this is a real valued signal).

These "N/2" coefficients represent the frequencies 0 to "f"s/2 (Nyquist), meaning that two consecutive coefficients are spaced apart by

:$f_mathrm\left\{s\right\} / 2 over \left(N / 2\right) - 1$ Hz

For large "N" this approximates to $frac\left\{f_mathrm\left\{s\left\{N\right\}$

To increase the frequency resolution of the window the frequency spacing of the coefficients needs to be reduced. There are only two variables, but decreasing "f"s (and keeping "N" constant) will cause the window size to increase — since there are now fewer samples per unit time. The other alternative is to increase "N", but this again causes the window size to increase. So any attempt to increase the frequency resolution causes a larger window size and therefore a reduction in time resolution — and vice-versa.

Application

STFTs as well as standard Fourier transforms and other tools are frequently used to analyze music. The spectrogram can, for example, show frequency on the horizontal axis, with the lowest frequencies at left, and the highest at the right. The height of each bar (augmented by color) represents the amplitude of the frequencies within that band. The depth dimension represents time, where each new bar was a separate distinct transform. Audio engineers use this kind of visual to gain information about an audio sample, for example, to locate the frequencies of specific noises (especially when used with greater frequency resolution) or to find frequencies which may be more or less resonant in the space where the signal was recorded. This information can be used for equalization or tuning other audio effects.

* Time-frequency representation
* Reassignment method

Other time-frequency transforms:

* wavelet transform
* chirplet transform
* fractional Fourier transform
* Newland transform

* [http://tfd.sourceforge.net/ DiscreteTFDs -- software for computing the short-time Fourier transform and other time-frequency distributions]
* [http://www.atmos.ucla.edu/tcd/ssa/ Singular Spectral Analysis - MultiTaper Method Toolkit] - a free software program to analyze short, noisy time series.

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• Fourier transform — Fourier transforms Continuous Fourier transform Fourier series Discrete Fourier transform Discrete time Fourier transform Related transforms The Fourier transform is a mathematical operation that decomposes a function into its constituent… …   Wikipedia

• Fractional Fourier transform — In mathematics, in the area of harmonic analysis, the fractional Fourier transform (FRFT) is a linear transformation generalizing the Fourier transform. It can be thought of as the Fourier transform to the n th power where n need not be an… …   Wikipedia

• Discrete Fourier transform — Fourier transforms Continuous Fourier transform Fourier series Discrete Fourier transform Discrete time Fourier transform Related transforms In mathematics, the discrete Fourier transform (DFT) is a specific kind of discrete transform, used in… …   Wikipedia

• Fourier — (pronEng|ˈfʊərieɪ, French pronunciation IPA2|fuʁie) may refer to:*Charles Fourier (1772–1837), a French utopian socialist thinker *Joseph Fourier (1768–1830), a French mathematician and physicist **Mathematics, physics, and engineering terms… …   Wikipedia

• Time series — Time series: random data plus trend, with best fit line and different smoothings In statistics, signal processing, econometrics and mathematical finance, a time series is a sequence of data points, measured typically at successive times spaced at …   Wikipedia

• Time-frequency analysis — is a body of techniques for characterizing and manipulating signals whose component frequencies vary in time, such as transient signals.Whereas the technique of the Fourier transform can be used to obtain the frequency spectrum of a signal whose… …   Wikipedia

• Fourier analysis — In mathematics, Fourier analysis is a subject area which grew out of the study of Fourier series. The subject began with trying to understand when it was possible to represent general functions by sums of simpler trigonometric functions. The… …   Wikipedia

• Time-frequency representation — A time frequency representation (TFR) is a view of a signal (taken to be a function of time) represented over both time and frequency. Time frequency analysis means analysis of a TFR. TFRs are often complex valued fields over time and frequency,… …   Wikipedia

• Fourier optics — is the study of classical optics using techniques involving Fourier transforms and can be seen as an extension of the Huygens Fresnel principle. The underlying theorem that light waves can be described as made up of sinusoidal waves, in a manner… …   Wikipedia

• Time-Domain Thermoreflectance — is a method by which the thermal properties of a material can be measured, most importantly thermal conductivity. This method can be applied most notably to thin film materials (up to hundreds of nanometers thick), which have properties that vary …   Wikipedia