Specific oversampling/antialiasing advice

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

Post

The oversampling approaches I’ve used (often in conjunction with other antialiasing techniques, like antiderivative antialiasing—see viewtopic.php?t=332930&start=90) exhibit the Gibbs phenomenon, with time domain ripples. Are there suggested approaches to oversampling in nonlinear waveshapers that:

-are fast,
-are usable at 2x or 4x (with ADAA) and
-minimize the Gibbs phenomenon?

Post

To avoid ringing or Gibbs phenomenon use less steep filters. May have to accept some treble attenuation or aliasing at highest frequencies.

Post

Dogue wrote: Tue May 28, 2024 2:10 am -are fast,
-are usable at 2x or 4x (with ADAA) and
-minimize the Gibbs phenomenon?
This might depend a bit on platform, but on modern desktop CPUs the method of choice would typically be a polyphase FIR (they are SIMD friendly and don't have any recursive dependencies).

The thing about Gibbs though is that it's the steep transition in frequency domain that produces the Gibbs ringing in the time-domain, so pretty much the only way to reduce Gibbs is to use a wider transition (ie. make the filter "worse" in frequency domain), which means giving up high frequencies, allowing some aliasing at high frequencies.. or both. Wide transitions are perhaps workable at 88.2kHz/96kHz, but for 44.1kHz/48kHz Gibbs ringing is probably the lesser evil most of the time.

Unlike aliasing, Gibbs is also relatively simple to reduce after the fact: just take any random EQ and cut the high frequencies with a gentle lowpass. So as long as the Gibbs-ringing from upsampling doesn't cause too many issues with your oversampled process, I wouldn't worry too much about Gibbs at the downsampling phase... users can deal with it themselves if it bothers them.

Post

Thanks – ha, I hadn't thought of just throwing a simple LPF on the output of the oversampling. That's certainly an easy solution!

Post

Dogue wrote: Wed May 29, 2024 1:02 am Thanks – ha, I hadn't thought of just throwing a simple LPF on the output of the oversampling. That's certainly an easy solution!
Well.. it's not really a "solution" as it just moves the "problem" elsewhere (loss of high frequencies)..

Rather my point is that since the Gibbs ripple is a natural consequence of the shape of the spectrum, some amount of it will come and go as you process a signal, even with simple linear EQ.

Don't stress about it unless it creates some actual problems for you. Losing a bit of headroom is not a problem, that's something you deal with a limiter at the very end of mixing a track.

Post

Thanks. My main concerns are (1) when using a clipper (in place of a limiter), and (2) when using saturation within a feedback loop, like a delay line with feedback. In my initial experiments, using some combination of ADAA + oversampling + one-pole LPF seems to work fairly well for my purposes (although if there are other interpolation or oversampling strategies to try I'm all ears :-)).

Post

Dogue wrote: Wed May 29, 2024 12:46 pm Thanks. My main concerns are (1) when using a clipper (in place of a limiter), and (2) when using saturation within a feedback loop, like a delay line with feedback.
The first case is not worth worrying about unless you're writing the actual clipper.. and then you might want to think about inter-sample peaks too, which are basically the same thing except "hiding" between the samples. Basically if you aren't going to worry about inter-sample peaks, then you probably don't want to worry about the Gibbs ripple either, because putting either through a clipper will alias the same way.

In the second case, a bit of ringing doesn't necessarily matter much unless you drive it very hard (but then you'd be oversampling again)... but also a bit of lowpass filter in delay feedback loops usually sounds good anyway, so .. :shrug:

Post

Dogue wrote: Wed May 29, 2024 12:46 pm ...
some combination of ADAA + oversampling + one-pole LPF seems to work fairly well for my purposes
...
Does it make any difference if you use BLT, IIM/MZT or other implementations ... ?

Post

Probably! So far I've just tried Max's poly~ oversampling and a polyphase approach.

Post

juha_p wrote: Wed May 29, 2024 1:38 pm
Dogue wrote: Wed May 29, 2024 12:46 pm ...
some combination of ADAA + oversampling + one-pole LPF seems to work fairly well for my purposes
...
Does it make any difference if you use BLT, IIM/MZT or other implementations ... ?
The idea choice in terms of reducing time domain ripple specifically is to use a boxcar or perhaps a cascade of several (approaching gaussian as you apply more and more)... but that's also basically the worst thing you can do with your frequency response.

Post

Good point. The approach I didn't mention is the old-school Reaktor method of linear interpolation between two samples, applying the non-linear process to the subsamples, and then averaging the interpolated outputs. Which, as you note, minimizes ripple at the expense of mid and high frequency response.

Post

Dogue wrote: Wed May 29, 2024 2:15 pm Good point. The approach I didn't mention is the old-school Reaktor method of linear interpolation between two samples, applying the non-linear process to the subsamples, and then averaging the interpolated outputs. Which, as you note, minimizes ripple at the expense of mid and high frequency response.
Doing this together with ADAA is kinda pointless, 'cos ADAA is just a better version of this.

Post Reply

Return to “DSP and Plugin Development”