13. Spectral reindexing, the Fast way

  1. Get the spectrum of a signal frame. Try to get below 10Hz/bin spectral resolution, if the harmonics are stable enough over time. Example: in case of 22kHz sampling, cut 2000+ samples and apply a 2048 or 4096 point FFT. In case of 11kHz sampling, use a 1024-point FFT.
    reind signal and spectrum2
  2. Calculate the LUT to extract spectral bins at F0, 2F0, 3F0, 4F0, 5F0 candidate pitch values, as well as LUT vectors inbetween, ie. 1.5F0, 2.5F0, etc. The LUT depends on Fs, Nfft, Fo_min and Fo_max, see code.
    reind lut
  3. Extract spectral bins at F0, 2F0, 3F0, 4F0, 5F0, etc. candidates, and store them in separate vectors.
    reind disassembled spectrum
  4. Assemble the “re-indexed” spectrum by summing up the vectors.
    reindexed2
  5. Save time and download the Code.
  6. Take a look at the theory behind Re-indexing.

 

Leave a comment