Short Time Fourier Transforms - psambit9791/jdsp GitHub Wiki
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.
int frameLength = 5;
int overlap = 2;
ShortTimeFourier stft = new ShortTimeFourier(signal, frameLength, overlap);
stft.transform();
Complex[][] out = stft.getComplex(false);
_Fourier[] dfts = stft.getOutput();
We apply the Inverse Short-Time Fourier Transform to a signal to reconstruct the original signal which was transformed using STFT.
int frameLength = 5;
int overlap = 2;
InverseShortTimeFourier istft = new InverseShortTimeFourier(dfts, frameLength, overlap);
istft.transform();
double[] outputReal = istft.getReal();