returns the short-time Fourier transform (STFT) of data as a ShortTimeFourierData object.


uses partitions of length n.


uses partitions with offset d.


applies a smoothing window wfun to each partition.


pads partitions with zeros to length m prior to the computation of the transform.

Details and Options

  • The short-time Fourier transform (STFT) is a time-frequency representation of a signal and is typically used for transforming, filtering and analyzing the signal in both time and frequency.
  • ShortTimeFourier[data] computes the discrete Fourier transform (DFT) of partitions of data and returns a ShortTimeFourierData object.
  • Use Spectrogram on data or on the resulting ShortTimeFourierData object to plot the spectrogram.
  • ShortTimeFourier[data] uses partitions of length and offset , where is Length[data].
  • The partition length n and offset d can be expressed as an integer number (interpreted as number of samples) or as time or sample quantities.
  • If necessary, fixed padding is used on the right to make all the partitions the same size.
  • In ShortTimeFourier[data,n,d,wfun], the smoothing window wfun can be specified using a window function that will be sampled between and or a list of length n. The default window is DirichletWindow, which effectively does no smoothing.
  • The data can be any of the following:
  • listarbitrary rank numerical array
    audioan Audio or Sound object
  • For multichannel audio objects, the spectrogram is computed over the sum of all channels.
  • ShortTimeFourier accepts the FourierParameters option. The default setting is FourierParameters->{1,-1}.


open all close all

Basic Examples  (2)

Short-time Fourier transform of a sine wave:

Click for copyable input

Short-time Fourier transform of an audio signal:

Click for copyable input

Plot the result:

Click for copyable input

Scope  (6)

Options  (3)

Applications  (6)

Properties & Relations  (2)

Introduced in 2019