Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate potential improvements to StateVariableFilter #73

Open
yupferris opened this issue Jul 23, 2021 · 0 comments
Open

Investigate potential improvements to StateVariableFilter #73

yupferris opened this issue Jul 23, 2021 · 0 comments

Comments

@yupferris
Copy link
Member

yupferris commented Jul 23, 2021

This is a decent and very compact filter design, ultimately originating from [1] (though in this particular case I believe I took the code from Sonant, and somewhere online before that). Its derivation is covered here (among many other places).

However, this particular filter construction has known instabilities at higher frequencies. To get around this, we employ a simple 2x oversampling scheme, equivalent to a linear upsampling filter before the SV filter, and a 2-tap moving average filter after. This setup effectively halves its (normalized) cutoff frequency, thus avoiding said instabilities (note that “avoiding” is used here instead of “eliminating” as I haven’t actually analyzed/proved it properly; I can only say I haven't experienced/heard of of any instances where it's “popped” in a very long time!).

While the code for this is very simple, the up/downsample processes alone are likely introducing noticeable artifacts even in the absense of the actual SV filter, which surely degrades the perceived quality of the SV filter itself. It's likely that with a bit of investigation, we can find a similarly-cheap, yet more-transparent strategy, so we should look into this.

Alternatively, since this filter is used wherever an "analog-style"/"coloring"/"non-surgical" filter is desired (eg. in the synths and many creative effects), it's possible that another filter topology (perhaps VA or similar) that's inherently stable (thus avoiding up/downsampling entirely) is more attractive altogether.

[1] H. Chamberlin,Musical Applications of Microprocessors, Second Edition, New Jersey: Hayden Books,1985.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant