SpectrogramArray

SpectrogramArray[list]

returns the spectrogram data of list.

SpectrogramArray[list,n]

uses partitions of length n.

SpectrogramArray[list,n,d]

uses partitions with offset d.

SpectrogramArray[list,n,d,wfun]

applies a smoothing window wfun to each partition.

SpectrogramArray[list,n,d,wfun,m]

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

SpectrogramArray[audio,]

returns spectrogram data of audio.

Details and Options

  • SpectrogramArray[list] returns the discrete Fourier transform (DFT) of partitions of list, also known as short-time Fourier transform (STFT).
  • Plot the spectrogram using Spectrogram.
  • SpectrogramArray[list] uses partitions of length n=2^Round[InterpretationBox[{log, _, DocumentationBuild`Utils`Private`Parenth[2]}, Log2, AutoDelete -> True](sqrt(m))+1] and offset d=Round[n/3], where is Length[list].
  • 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 SpectrogramArray[list,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.
  • SpectrogramArray works with numeric lists as well as Audio and Sound objects.
  • For multichannel sound objects, the spectrogram is computed over the sum of all channels.
  • SpectrogramArray accepts the FourierParameters option. The default setting is FourierParameters->{1,-1}.

Examples

open all close all

Basic Examples  (2)

Short-time Fourier transform of a sine wave:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]//MatrixForm=

Short-time Fourier transform of an audio signal:

In[1]:=
Click for copyable input
Out[1]//Short=

Plot the result:

In[2]:=
Click for copyable input
Out[2]=

Scope  (1)

Applications  (2)

Properties & Relations  (2)

Introduced in 2012
(9.0)
|
Updated in 2017
(11.2)