Files
DataAnalysis2021/04-FFT_DFT_and_Applications/spectrogram.ipynb
T

1.6 KiB

Time-Frequency Analysis

Moving window analysis

One way to analyse the time-varying frequency content of a signal is to apply windows in the time domain to the signal and to calculate a Fourier spectrum of the windowed part. The window marches along the signal with defined overlap creating a series of Fourier spectra associated with the center times of the windows. The resulting amplitude spectra are then plotted versus window center time. In more detail:

  1. Choose windowing functions: w(t,t_m) with t_m the center of the window.
  2. Multiply windowing function with time series: f_m(t) = f(t)w(t,t_m)
  3. Detrend the windowed signal.
  4. Perform a DFT: F_{km} = \Delta t\sum_{n=0}^N f_m(t)\exp(-2\pi i \frac{kn}{N}) and calculate the absolute value, |F_{km}|.
  5. Plot the resulting matrix: |F_{km}| in the time-frequency plane.
In [ ]: