Hi Craig! This is the most-basic version of the algorithm and was intended for educational purposes, and as you have seen, this algorithm collapses when the noise-to-signal ratio is high. To avoid the estimator to track noise frequency, we need to add a band-pass filter prior to the adaptive band-stop filter so as to better condition the input signal (de-noising).

Here you can find an example of what I was suggesting:

https://gist.github.com/Ro3code/ebdd6be4d1f841f3212f0e4b27b5970e

Keep playing with the code! By the way, the band-pass filter transfer function I have implemented in the previous example is 1 - BAND-STOP-FILTER.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store