tomshlomo / stft

Matlab routines for efficient calculation of the Short Time Fourier Transform and its inverse.
MIT License
9 stars 0 forks source link

stft and other transforms #1

Closed jasonnicholson closed 3 years ago

jasonnicholson commented 3 years ago

Thank you for writing your stft. I find it interesting. I have written similar code but not as vectorized as yours is.

Have you looked at the Stockwell Transform (S-Transform)? I am working towards seeing how an S-transform differs from an STFT when looking at spectrogram.

I use STFT to look at control signals. i.e. current, voltage, pressure, etc. I work with Electro Hydraulic systems. Often I will calculate a transfer function from an STFT of input and output by doing the following:

  1. Run a linear chirp into an input.
  2. Calculate STFT of input. Extract frequency, amplitude, and phase along the chirp signal ridge where the amplitude is the largest. unwrap the phase if needed.
  3. From the output signal, extract amplitude and phase at the same frequencies/time as the input signal. unwrap phase if needed.
  4. Divide. transferFunction=output/input. This works well to produce an empirical transfer function.

The S-transform looks to handle the time-frequency tradeoff better than the STFT but I have not been able to prove this yet.

tomshlomo commented 3 years ago

Hi, thanks for your input. The Stockwell transform indeed looks interesting, however I don't have any experience with it. Due to the varying window length, I think it would be challenging implementing it in a fully vectorized way (as my STFT is implemented).

Regarding the use of STFT to estimate transfer functions - one has to be careful with choosing the right windows. You can see this work for more information. If your system is stationary, or if you can assume some parametric model, consider using other, more appropriate methods for system identification.

jasonnicholson commented 3 years ago

Thank you for the response. I will take a look at the paper.

Robert Brown wrote the Generalized Fourier Family Transform (GFT). He has recently posted on Github in python3. It is an O(n log(n)) algorithm. The STFT and Stockwell Transform (ST) are subsets of the GFT. https://github.com/robb-brown/GFT

You can close this question. Thank you!

tomshlomo commented 3 years ago

Thanks, i'll take a look (I'm migrating to python anyway ;))