Is there something special about Reaktor 1 pole HP/LP filter?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I am trying to translate my reaktor patch to C++ but it is not sounding the same. The culprit seems to be the HP/LP 1 pole filter.

Does anyone know anything about this filter so that I could recreate it in C++? Is there a Core Cell version that I could open up?

The filter I am referring to is the one built in, not a core cell, not an external, etc. Built-in Module -> Filter -> HP/LP 1-pole is how you get to it.

Post

Architeuthis wrote: Thu Apr 15, 2021 4:07 am I am trying to translate my reaktor patch to C++ but it is not sounding the same. The culprit seems to be the HP/LP 1 pole filter.

...
Have you tried plot (mag/pha) responses of those?

Post

a wild guess: i could imagine that reaktor uses a different discretization method than your code - for example bilinear transform instead of impulse invariant transform. if you are using the 1-poles from my library, you have actually both options there (i tend to use IIT by default, but from what i have gathered here over years, Vadim prefers BLT due to its rigid relationship between magnitude and phase)
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

thank F***ING GOD thank you Robin, so happy you stumbled upon this thread, dunno what I would have done without your response, you don't know how relieved I am to have figured this out.

Looks like IIT is the ticket.

What I am working on is best sounding analog-style filter I've heard, I'm releasing it for free tomorrow in the Flower Child beta. It's really simple, just two IIT lowpass filters fed back into a particular waveshaper where I spent days perfecting all the parameterization and scaling of parameters over frequency and resonance and what not, I don't want to give away the secret sauce at the moment, but oh my god I was very depressed that I might not be able to get it out of Reaktor. 90% confident my C++ performs exactly like Reaktor.

Post

This begs the question, why is IIT better than BLT in this case? The difference in sound is that... IIT has constant resonance over frequency, BLT resonance increases in a displeasing way over frequency and then explodes. It could be that I just geared my values to work with IIT, but I don't even know if I could get BLT to work, I did try a bit.

Post

oh - so you actually were using BLT before and now switched to IIT and that works better? that's kinda the other way around from what i had in mind with my guess, but whatever. if you are tuning the feedback gain manually as function of the cutoff so as to achieve a uniform resonance over frequency sweeps, i can imagine that BLT behaves more bitchy towards high frequencies due to the frequency warping effects which become more severe when the cutoff approaches the nyquist limit
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

btw: if constant resonance over frequency sweeps is the goal, i'd probably try to use custom formulas instead of BLT or IIT. i derived the relevant formula for a 4-stage filter here:

http://www.rs-met.com/documents/dsp/Res ... Filter.pdf

if i'm not mistaken, if your filter is a 2-stage, then just the t = tan((w_c - pi) / 4) must be replaced by t = tan((w_c - pi) / 2) in formula 11 and k = r/(g1^2)^2 = r/g1^4 must be replaced by k = r/g1^2 in formula 15. ...but i could be wrong - take it with a grain of salt
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Actually, without the IIT filters in the feedback path, the code still functions as an analog style filter with good resonance response over frequency. The problem is that it sounds tinny at lower cutoffs OR if you don't want a tinny sound then you have to increase the feedback distortion by lowering the "metaphorical voltage rails" so it clips sooner, which sounds nice, but I really wanted a clean filter this time.

So! IIT filters are not being used to filter the input signal so much, it's actually there to purify the feedback path (purer resonant tone) so you get the best of both worlds, warm low end and clean resonance, and as a side-effect, overdriving the input sounds better.

Since I've been experimenting with feedback for years now, I have some intuition in how to go about creating specific tones and behaviors. I will make a bold claim that I can recreate/imitate any analog filter by ear (it won't be perfect), and invent new ones. The possibilities are endless. For example, I've made a filter that has downsampling in the feedback path which creates pleasing fuzz. I will be doing more of these downsampled filters in the future, I'm just scratching the surface.

I'll keep those equations in mind for future exploration.

Here's some samples of my recent work:

Using IIT filters: https://www.elanhickler.com/transfer/so ... filter.mp3

Polivoks-like: https://www.elanhickler.com/transfer/so ... ttempt.mp3

Downsampled: https://www.elanhickler.com/transfer/so ... filter.mp3

Post

Music Engineer wrote: Thu Apr 15, 2021 12:56 pm ...but i could be wrong
just a little update: i tried it. the generalization of the formulas for an N-stage ladder

t = tan((w_c - pi) / N)
k = r/g1^N

seems to work only for N >= 3. ...i'm trying to figure out, why that is...edit: aaah! i see: the phase response of a 1-pole approaches only -90° as f goes to infinity (in the analog case), so for the 2-pole, the -180° frequency is at infinity (i thought, the values would be twice that - i should look at phase responses more often). it could probably be made to work with an additional allpass in the feedback loop. ...and that would actually offer the possibility to tune the resonance further - independently from the cutoff.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Music Engineer wrote: Sat Apr 17, 2021 7:02 am
Music Engineer wrote: Thu Apr 15, 2021 12:56 pm ...but i could be wrong
just a little update: i tried it. the generalization of the formulas for an N-stage ladder

t = tan((w_c - pi) / N)
k = r/g1^N

seems to work only for N >= 3. ...i'm trying to figure out, why that is...edit: aaah! i see: the phase response of a 1-pole approaches only -90° as f goes to infinity (in the analog case), so for the 2-pole, the -180° frequency is at infinity (i thought, the values would be twice that - i should look at phase responses more often). it could probably be made to work with an additional allpass in the feedback loop. ...and that would actually offer the possibility to tune the resonance further - independently from the cutoff.
Right, so the feedback in the case of the 4-pole is based on the idea that four poles give you total 2*pi phase-shift at infinity and the half-way point (=pi) is at cutoff, so when you invert the feedback the cutoff is in phase.

That said, you CAN build arbitrary responses (of a given order) with any number of poles cascaded like in a ladder, you just have to take a combination of the output from multiple poles for use as feedback. The idea that you can do this to place the zeroes where you want is well-known (ie. the "Xpander modes"), but you can also do a similar thing with the feedback signal. For example, in the case of a 2-pole, taking the difference between the first and second pole (check the math yourself, I'm writing this from memory and there might be some detail I'm forgetting) will get you a filter that is essentially a transposed Sallen-Key. I personally don't think non-linearities in the style of transistor-ladder necessarily sound great with such filters (eg. OTA-style cascade like in Xpander tends to work better for these), but they certainly work.

Post

mystran wrote: Sat Apr 17, 2021 4:28 pm That said, you CAN build arbitrary responses (of a given order) with any number of poles cascaded like in a ladder, you just have to take a combination of the output from multiple poles for use as feedback.
that is indeed an interesting idea that i may explore at some point! the ladder is a very flexible and versatile basic structure on top of which a lot of interesting stuff can be built!

oh and another note: i only realized later that the expression for the compensation gain can be simplified much further. at the end, the required compensation gain comes out as just 1+k. i really should update the pdf to add that. this whole "evaluate the polynomial via Horner's rule" stuff is obsolete
Last edited by Music Engineer on Sat Apr 17, 2021 9:12 pm, edited 1 time in total.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

This LPF1 (MZT) may give closer to analog response than IIM (IIT?) ... ? :

Code: Select all

Approximated LPF1

p1 = (fc*(19.7392*fc + 6.28319*fs))/fs^2 + 1;

a0 = 1.0;
a1 = -p1;
b0 =  a0+a1; 
b1 = 0;
Comparison plot in attachments.
You do not have the required permissions to view the files attached to this post.

Post Reply

Return to “DSP and Plugin Development”