fitting.stft

fitting.stft(data, fs, w, overlap_fac=0.5)

Short time (or moving window) Fourier transform using a Hanning window. Code was adapted from Kevin Nelson’s code (https://github.com/KevinNJ/Projects).

Parameters:
  • data (array) – 1d data to be processed.
  • fs (float) – Sampling frequency of the data ( = 1 / dt ).
  • w (float) – Size of the moving window in units of time.
  • overlap_fac (float) – Percentage of overlap between consecutive windows. A value of 0.5 does not alter the magnitude of the signal.
Returns:

2d spectrogram of frequency vs time.