Depth limited notch filter

Sometimes it is desirable to filter out a narrow frequency, but the usual notch filter (notch2 s Hz Q) is just too deep. The idea of this filter is to provide the narrow band of a notch filter, but to limit the depth of the notch by mixing in a proportion of the unfiltered audio.

Here’s the code:

In theory there’s lots of nasty phase shifting going on, but in practice it seems to work pretty well.

One thought on “Depth limited notch filter”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.