1

Is it possible to split a wav file into .2 second sections, then perform a Fourier Transform on each section to get the frequency distribution of each section?

Specifically if I only cared about 2 or 3 specific frequencies, would there be an easier method to find the amplitude of each of these frequencies in each section? I saw on another post someone mentioning using Goertzel algorithms to find specific frequencies

Chris
  • 155
  • 1
  • 9
  • 1
    The Goertzel algorithm is good if you know the frequency already, like for dial tones, or for a lock-in amp with fixed frequency. For your example, just convert the wavefile into a numpy array and the do STFT (short time fourier transforms) as you suggested yourself. There is a canned function `spectrogram` in `scipy` that allows you to set the window width (your .2 secs) and all sorts of other things (e.g. overlap,windowing type). – roadrunner66 May 05 '16 at 05:47
  • It is indeed possible to split a wav file into .2 second sections, then perform a Fourier Transform on each section. To have meaningful results, not affected by issues connected with the non-periodicity of the samples, you want to apply a smoothing window to each 2s sample. This is dealt with using `spectrogram`, as explained in the [excellent comment](http://stackoverflow.com/questions/37039164/perform-fourier-transform-on-sections-of-a-wav-file-python#comment61635297_37039164) by [roadrunner66](http://stackoverflow.com/users/906693/roadrunner66). – gboffi May 05 '16 at 11:07

0 Answers0