Cepstral Analysis for pitch detection

前端 未结 5 1436
陌清茗
陌清茗 2020-12-07 09:53

I\'m looking to extract pitches from a sound signal.

Someone on IRC just explained to me how taking a double FFT achieves this. Specifically:

  1. take FFT
5条回答
  •  无人及你
    2020-12-07 10:33

    What's wrong with your existing technique that you're interested in a new one? I don't think a cepstrum is going to give you more accurate pitch, if that's the goal. It will, however, help you with suppressed fundamentals. I suppose you could use the cepstrum to get you close, then go back to the first FFT (which I would keep in its original form) and then apply your cunning technique to the bin that the cepstrum guides you to.

    As for the quadratic fit, it's referred to in this paper by Ted Knowlton, which came up in another SO question recently, but I've never used it.

    I should add that the quadratic fit technique, at least as outlined in the reference from Knowlton, depends on using a rectangular window on the first FFT. As Paul R explained in another of your questions, if you're doing audio processing you should use a Hann or Hamming window on the first FFT. So I guess an overall algorithm could look like:

    • Take time domain buffer x, make a windowed copy w.
    • Sx = FFT(x), Sw = FFT(w)
    • c = Log of square magnitude of Sw
    • Cx = FFT(c)
    • Estimate fundamental (and maybe harmonics) using Cx
    • Use Sw to do cunning phase trick on fundamental (or higher harmonic) bin(s)
    • And/or use Sx to do quadratic bin fit around fundamental (or higher harmonic)

    The (or higher harmonic) note applies if you do indeed have suppressed fundamentals.

    And I mentioned this in your other question, but what makes you think the log requires a lookup table? Why not just call the log function? I imagine that the time taken by two FFTs (O(n*logn)) dwarfs any other processing you can do.

提交回复
热议问题