Antialiasing Nonlinearities

Apologies if this question is really basic. I’ve created a few modules for non-linear distortion that I would like to release, but the aliasing is not at a point I’m ok with. I’m prescaling the input signal to +/-1, applying a gain that’s mapped exponentially between 1 and 100, and DC offset mapped linearly between 0.0 and 0.5 for even harmonics. I’ve tried both the native oversampling implementation at 8x with a quality factor of 10, as well as @jatinchowdhury18’s oversampling with Butterworth decimation filters. I’ve also tried a half band lowpass filter with PyFDA (below), extracting the coefficients and then filtering inside of the oversampling process loop. I tried adding this to both oversampling methods. It really didn’t help that much. What are some ways to antialias nonlinear distortion? I’m looking into ADAA, but I’m not quite sure yet how that works or if it might be helpful.

I think I may actually have just solved this with a better set of coefficients for the FIR, but still interested in other solutions! :slight_smile:

This one here uses a 6 pole butterworth. The code is extremely simple, and uses only stuff built into VCV. Why don’t you try out the module and see if it works for you?

1 Like

I’m glad you answered this because I was really impressed with how clean yours sounded. Cheers!


1 Like

I hope you read the article on measuring aliasing?

Yes, I did! That’s pretty slick. Thanks. This sounds great. Follow up question, couldn’t I just unwrap the Biquad filter cascade into a single filter?

Biquads exist for a reason. A higher order filter will often have bad noise issues, esp in the bass. I have found that with 64 bit double you can do it, 32 bit float can have problems. Read up more on biquads, why they exist, and why the vcv sdk provides them and not higher order filters.

I was thinking more along the lines of unrolling the biquads into one function that does the exact same thing as if there were three biquad filters (an internal vector for the biquad states, etc), but there may not be a point… As it is, I’m quite ok with the efficiency, I just need to templatize it for SIMD. Thanks for your help! I definitely also want to try antiderivative, but this sounds really nice.

The VCV biquads are already templatized for simd. If you mean my silly example wrapper, I don’t know…