Filter Transfer Function Modelling in SC

I have a transfer function I’d like to implement in SC, but I’m not sure how to go about this. Is it possible to do this by cascading FOS and/or SOS? Or would I need to design it somewhere else?

I would guess after calculating the partial fraction decomposition, each term would represent the coefficient of filter. maybe call that friend who knows math and matlab? (unless I’m lost and drunk, which is very possible)

1 Like

If you were given a filter transfer function that’s a static rational function of s, then there’s a few ways to go about it. A “sledgehammer” approach would be to compute H(jw) at a bunch of points along the imaginary axis, IFFT, and use that as an impulse reponse; it’s not going to be exact but for some filters it’ll work fine if you do it properly. Better would be the method you suggest, which is to pair off the zeros and poles into first- and second-order sections. To do that you’d have to compute the roots of the numerator and denominator polynomials. (Yes, polynomial root-finding is not very numerically stable, but that doesn’t always create problems in practice, so it’s worth a shot.)

However, this isn’t a static filter, there’s a w_c parameter (which I presume is a cutoff control) and a k parameter. If these are being modulated, then what you have here is not a linear time-invariant filter. I assume this is some kind of virtual analog thing, and unfortunately H(s) doesn’t capture enough information about the behavior of the filter for accurate and stable modeling. While the Laplace transform is useful for studying and analyzing the behavior of nonlinear or time-varying filters, you’ll need more advanced VA techniques to actually model them digitally.

1 Like

@nathan you make it sound like we now have to implement and hear it, will be interesting.

(Where is it from, btw?)

In depth analysis of 303 diode ladder filter:

https://www.timstinchcombe.co.uk/index.php?pge=diode

I know about RLPFD but I don’t like it very much.

1 Like

Ah yes, classic page. Alas it’s an analysis, not really a guide on how to emulate the filter, and it predates a lot of modern VA methods.

You could try and do it in faust, like this diode ladder:

https://github.com/grame-cncm/faustlibraries/blob/730eff6dc336973553829235e0b31b24c47a2f69/vaeffects.lib#L263

or just see if that filter is to your liking.

Sam

1 Like

There’s a chapter about diode filters in the holy grail of modern VA filter design:

Madskjedgaard’s portedplugins also contain a diodefilter (as well as some other VA filters) which may be interesting to try out.

1 Like

I think it’s more of an obsession with the sound of the 303 filter. I have a 303 clone. I just really want to get as close as possible to those classic dirty, squelchy filter noises in SC

I’ve ported a number of diode ladder filters from FAUST and I do like them. I’m just being a bit obsessive.

I found a 303 clone in C++, so I’m working on porting that, but it’s a little heavy and I need to think through calculating coefficients.

I don’t think I have portedplugins. I’ll check that out too!

Thanks all

1 Like

I doubt that any of the VA filters in portedplugins qualifies as a 303 clone, but they are capable of considerable filth. Never did figure out why the effective frequency is 3x the input frequency, but that’s easy enough to compensate.

hjh