I am looking for an algorithm, preferably available in a Python library, which passes only frequencies of interest, with the center frequency continuously changing as it moves through an array of audio response data.

I need this because I am analyzing the result of an audio sine wave sweep from 20Hz to 20000Hz and the recorded data contains noise. Since I am driving the system with a known frequency and am only interested in the system's response near that frequency, I would like to have a tracking bandpass filter.

I have Googled terms such as "moving bandpass filter" "tracking bandpass filter" to no avail. I would appreciate any suggestions.

Example of driving waveform

  • $\begingroup$ Are you sure you don't want to analyze all those frequencies simultaneously with a STFT? Also, if you know the exact signal going into the system (=you're generating it), you can run a matched filter at the output to see what the frequency response is. $\endgroup$
    – endolith
    Commented Dec 20, 2016 at 19:07
  • $\begingroup$ If the center frequency changes in a known and predictable manner, you could implement a Bayesian tracker such as a particle filter to track that frequency. The measurement that the particle filter makes could be the signal power in the passband, for example. $\endgroup$ Commented Dec 20, 2016 at 19:19
  • $\begingroup$ I think an STFT-like approach makes sense. I can divide my recorded data into segments and FFT those segments separately. I can disregard frequencies far away from the driving signal frequency for each segment. $\endgroup$
    – jbiondo
    Commented Dec 21, 2016 at 18:58
  • $\begingroup$ Probably I am too late, but maybe others can profit from it: I did what you described using the Vold-Kalman filter technique. Maybe that can help you too. $\endgroup$ Commented Feb 10, 2021 at 9:02

1 Answer 1


Depends on what exactly you want to do but easiest would be Heterodyne detector: multiply with a local oscillator (cos() and sin()) with variable frequency followed by a lowpass with a fixed bandwidth. The cutoff frequency of the lowpass is equivalent to the bandwidth of the equivalent bandpass. The frequency of the local oscillator determines the center frequency.

If you need non-uniform bandwidth (like 3rd octave for example), things get a little more complicated. You can do this primarily through frequency "warping".

Finally, you can always table and/or interpolate filter coefficients.

  • $\begingroup$ This sounds like the approach I would go with. What the OP is describing actually sounds like the front end of any swept-tune spectrum analyzer (without the envelope detection). $\endgroup$
    – Jason R
    Commented Dec 20, 2016 at 20:39

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.