Is there something special about Reaktor 1 pole HP/LP filter?
 KVRAF
 3114 posts since 28 Jan, 2006 from Phoenix, AZ
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. Builtin Module > Filter > HP/LP 1pole is how you get to it.
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. Builtin Module > Filter > HP/LP 1pole is how you get to it.

 KVRian
 655 posts since 21 Feb, 2006 from FI
Have you tried plot (mag/pha) responses of those?Architeuthis wrote: ↑Wed Apr 14, 2021 8:07 pmI 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.
...
 KVRAF
 3927 posts since 8 Mar, 2004 from Berlin, Germany
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 1poles 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)
 KVRAF
 3114 posts since 28 Jan, 2006 from Phoenix, AZ
Topic Starter
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 analogstyle 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.
Looks like IIT is the ticket.
What I am working on is best sounding analogstyle 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.
 KVRAF
 3114 posts since 28 Jan, 2006 from Phoenix, AZ
Topic Starter
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.
 KVRAF
 3927 posts since 8 Mar, 2004 from Berlin, Germany
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
 KVRAF
 3927 posts since 8 Mar, 2004 from Berlin, Germany
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 4stage filter here:
http://www.rsmet.com/documents/dsp/Res ... Filter.pdf
if i'm not mistaken, if your filter is a 2stage, 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
http://www.rsmet.com/documents/dsp/Res ... Filter.pdf
if i'm not mistaken, if your filter is a 2stage, 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
 KVRAF
 3114 posts since 28 Jan, 2006 from Phoenix, AZ
Topic Starter
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 sideeffect, 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
Polivokslike: https://www.elanhickler.com/transfer/so ... ttempt.mp3
Downsampled: https://www.elanhickler.com/transfer/so ... filter.mp3
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 sideeffect, 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
Polivokslike: https://www.elanhickler.com/transfer/so ... ttempt.mp3
Downsampled: https://www.elanhickler.com/transfer/so ... filter.mp3
 KVRAF
 3927 posts since 8 Mar, 2004 from Berlin, Germany
just a little update: i tried it. the generalization of the formulas for an Nstage 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 1pole approaches only 90° as f goes to infinity (in the analog case), so for the 2pole, 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.

 KVRAF
 6321 posts since 12 Feb, 2006 from Helsinki, Finland
Right, so the feedback in the case of the 4pole is based on the idea that four poles give you total 2*pi phaseshift at infinity and the halfway point (=pi) is at cutoff, so when you invert the feedback the cutoff is in phase.Music Engineer wrote: ↑Fri Apr 16, 2021 11:02 pmjust a little update: i tried it. the generalization of the formulas for an Nstage 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 1pole approaches only 90° as f goes to infinity (in the analog case), so for the 2pole, 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.
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 wellknown (ie. the "Xpander modes"), but you can also do a similar thing with the feedback signal. For example, in the case of a 2pole, 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 SallenKey. I personally don't think nonlinearities in the style of transistorladder necessarily sound great with such filters (eg. OTAstyle cascade like in Xpander tends to work better for these), but they certainly work.
Preferred pronouns would be "it/it" because according to this country, I'm a piece of human trash.
 KVRAF
 3927 posts since 8 Mar, 2004 from Berlin, Germany
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 1:12 pm, edited 1 time in total.

 KVRian
 655 posts since 21 Feb, 2006 from FI
This LPF1 (MZT) may give closer to analog response than IIM (IIT?) ... ? :
Comparison plot in attachments.
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;
You do not have the required permissions to view the files attached to this post.