Skip to content

Short Time Fourier Transforms

Sambit Paul edited this page Dec 11, 2021 · 1 revision

Forward Short-Time Fourier Transform

Short-Time Fourier Transform decomposes an input signal into short-time segments and applies the fourier transform on each segment. This helps provide the information regarding the fluctuation of the frequency contents over time. It is to be noted that the signal length should be exactly divisible by the frame length. Details are provided in Issue #32.

CODE
int frameLength = 5;
int overlap = 2;
ShortTimeFourier stft = new ShortTimeFourier(signal, frameLength, overlap);
stft.transform();
Complex[][] out = stft.getComplex(false);
_Fourier[] dfts = stft.getOutput();

Inverse Short-Time Fourier Transform

We apply the Inverse Short-Time Fourier Transform to a signal to reconstruct the original signal which was transformed using STFT.

CODE
int frameLength = 5;
int overlap = 2;
InverseShortTimeFourier istft = new InverseShortTimeFourier(dfts, frameLength, overlap);
istft.transform();
double[] outputReal = istft.getReal();
Clone this wiki locally