({{, (RefLink[ShortTimeFourierData, paclet:ref/ShortTimeFourierData])[assoc] 
represents the result and properties of a short-time Fourier transform (STFT) of a signal.}})

OpenersNotesSection(Spacer1)Details

Use (RefLink[ShortTimeFourier, paclet:ref/ShortTimeFourier]) to create a (RefLink[ShortTimeFourierData, paclet:ref/ShortTimeFourierData]) object from a list or an audio signal.

Use (RefLink[InverseShortTimeFourier, paclet:ref/InverseShortTimeFourier]) to reconstruct the original signal from the STFT data.

For a short-time Fourier data object stft, the following properties can be obtained using stft["prop"]:

All properties of stft can be modified except for "PartitionSize".

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Short-time Fourier transform of an audio signal:

audio=Import["ExampleData/rule30.wav"];

stft=ShortTimeFourier[audio]

Show the spectrogram:

Spectrogram[stft]

Inverse short-time Fourier transform:

InverseShortTimeFourier[stft]

OpenersExampleSection1(Spacer1)Scope  (6)

OpenersExampleSubsection0(Spacer1)Data  (2)

Short-time Fourier created from an audio recording:

ShortTimeFourier[Import["ExampleData/rule30.wav"]]

Short-time Fourier created from an array:

ShortTimeFourier[RandomReal[1,100]]

OpenersExampleSubsection1(Spacer1)Properties  (4)

Inspect the properties of (RefLink[ShortTimeFourierData, paclet:ref/ShortTimeFourierData]):

chirp=Table[Cos[200. π t+2400. π t^2],{t,0.,1.6,1/8000.}];stft=ShortTimeFourier[chirp]

stft["Properties"]

Inspect the data:

stft["Data"]//Short
stft["Data"]//Dimensions

Recover the parameters used in the computation:

AssociationMap[stft[#]&,Rest[stft["Properties"]]]//Dataset

Modify the "Data" property:

chirp=Table[Sin[ π t+10. π t^2],{t,0.,1.6,1/200.}];
stft=ShortTimeFourier[chirp,100,10,HannWindow]

stft["Data"]=stft["Data"]*10;

The transformation can be approximately inverted using (RefLink[InverseShortTimeFourier, paclet:ref/InverseShortTimeFourier]):

{chirp,InverseShortTimeFourier[stft][[;;Length[chirp]]]}//ListLinePlot

Modify the "PartitionOffset" property:

chirp=Table[Sin[ π t+10. π t^2],{t,0.,1.6,1/200.}];
stft=ShortTimeFourier[chirp,100,10,HannWindow]

stft["PartitionOffset"]=12;

The transformation can be approximately inverted using (RefLink[InverseShortTimeFourier, paclet:ref/InverseShortTimeFourier]):

{chirp,InverseShortTimeFourier[stft][[;;Round[1.2*Length[chirp]]]]}//ListLinePlot

Modify the "DataType" and "SampleRate" properties:

chirp=Table[Sin[30 π t+200. π t^2],{t,0.,1.6,1/2000.}];
stft=ShortTimeFourier[chirp,100,10,HannWindow]

stft["DataType"]="Sound";
stft["SampleRate"]=2000;

The transformation can be approximately inverted using (RefLink[InverseShortTimeFourier, paclet:ref/InverseShortTimeFourier]):

InverseShortTimeFourier[stft]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ShortTimeFourier, paclet:ref/ShortTimeFourier])  ▪  (RefLink[InverseShortTimeFourier, paclet:ref/InverseShortTimeFourier])  ▪  (RefLink[Spectrogram, paclet:ref/Spectrogram])  ▪  (RefLink[SpectrogramArray, paclet:ref/SpectrogramArray])  ▪  (RefLink[Fourier, paclet:ref/Fourier])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Fourier Analysis, paclet:guide/FourierAnalysis])}, {▪(RefLinkPlain[Signal Processing, paclet:guide/SignalProcessing])}})}})