I'm thinking about ways to automatically identify and analyze lots of musical instrument samples, and would like to find the part of the sample that's the most stable in frequency, without any accidental vibrato or anything. My first thought was to do a sliding FFT and find the "width" of the peaks (maybe fitting a parabola to many of the neighboring points?), since a constant frequency chunk will produce a narrow peak (green) and one wavering in frequency should produce a wider peak (red):

enter image description here

On a spectrogram the red is a slightly wiggly line, and the green is a more straight line.

Time domain is ok, too. Some kind of "slide the signal past itself and look for sections that interfere with each other in a constant way instead of phasing in and out"?

But I'm not sure how easy or reliable this method would actually be. Any other ideas?

  • $\begingroup$ I think the "Gabor Bandwidth" is a measure you might be able to use. It is essentially moment measure. "How much off the center does my spectrum deviate?". I asked a related question here once: (dsp.stackexchange.com/questions/1358/…). In your case, the GB of the red would, I imagine, be greater than the GB of the green. $\endgroup$
    – Spacey
    Aug 1, 2012 at 20:15

2 Answers 2


Your technique might work, provided you window and so on correctly, but it does not really strike me as the right approach for pitch vibrato for a lot of reasons, mostly that the change in pitch is very small compared to other things which could change the "width" of your spectrum (eg, timbre).

I think you'd be better off actually tracking the fundamental pitch in the time domain using a technique like YIN and seeing how much it varies over time.

  • $\begingroup$ I was going to suggest that. Just track the f0 and get the standard deviation. If YIN is not precise enough, or if window size trade-off becomes a problem (because the vibrato is very subtle and fast), one might switch to a high-resolution sum of sines estimator such as ESPRIT or MUSIC. $\endgroup$ Aug 1, 2012 at 23:38

If for some reason you do want to remain in the frequency domain (using a sliding FFT as you are), the peak width would not be a robust method to track vibrato. A better approach is to look at the phase of the neighbouring bins (bins to the left and right of the fundamental frequency peak). If the phase difference between the peak and neighbouring bins remains reasonabley constant over a number of frames, the component can be considered as stable.

  • $\begingroup$ I don't understand. You're talking about neighboring frames and neighboring bins at the same time? Surely the phase from one frame to the next would be unpredictable, since the frequency of the signal is not related to the sampling rate or frame size? $\endgroup$
    – endolith
    Aug 3, 2012 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.