Cesaro summation of Fourier series to avoid Gibbs ripples

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

mystran wrote: Fri Mar 01, 2024 11:01 pmthe average of progressively longer Dirichlet kernels has a triangular shape in terms of linear magnitude.
Yes - and that is the answer to my original question: "How would that Cesaro/Fejer approach compare to more standard techniques like tapering off the higher harmonics". The averaging in the Cesaro summation process just corresponds to using a triangular window on the original Fourier series coefficients. I didn't immediately realize this, but now it's clear. So - as said - this is really nothing new but only a different perspective on something old.
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post

Tone2 Synthesizers wrote: Fri Mar 01, 2024 11:40 pm Preventing overshoting makes a lot of sense if you process stuff with integers that can overflow.
I think there's an easy solution to this: leave some headroom.
An oscillator with lots of gibbs ringing frequently has an audible impact on the sound of non-linear filters or anything else non-linear like distortions in the following processing blocks.
This is a thing, yes.. though whether it's really the Gibb's ringing or the sharp cutoff in spectrum that's the real problem is not entirely clear. Arguably they are kinda the same thing though. In a synthesizer probably the best solution is to generate the oscillators at 2x so that you have about half the Nyquist rate to gently taper down the response.. and then oversample the actual filter some more to prevent aliasing (so while this strategy works well, it's not exactly free).

Sadly that doesn't really work for effects though, 'cos you're kinda stuck having at least reasonably sharp cutoff for upsampling, otherwise you lose high frequencies. This is actually the main thing where I think keeping the whole DAW at 96kHz (or 88.2kHz is fine too) could be advantageous... because then you get to use those gentle wide oversampling filters.
You also don't want to see such a ringing if you do accurate analog emulations. Analog oscillators simply do not have 'gibbs ringing'.
This is actually not quite so black&white. Opamps in particular rely on feedback, but that feedback is never instant and they will more often than not overshoot. If you look at any opamp datasheet, you'll find a graph that looks something like this one is from TL072 datasheet (fair-use I'd imagine), a chip you might or might not find in various audio schematics (in part because the below graph is actually what we consider "very nice" for audio circuits):
tl072-phase-margin.jpg
What this basically gives us is the so called "phase margin" at various frequencies: if the total phase-shift in a closed loop (after you add whatever capacitances we might be driving) hits 180 degrees at some frequency where the gain is unity or more, we essentially have a resonant low-pass filter in self-oscillation. The closer to 180 degrees we get, the more the opamp tends overshoots and longer it rings. For all intents and purposes, this is the same "gibbs" ringing, it's just typically not very strong in a well designed circuit (who wants parasitic oscillations; better give up some high frequency gain and damp the thing so it's not an issue) and it's probably at a much higher frequency most of the time (unless the opamp is really slow). This particular opamp is at around 90 degrees for most of it's bandwidth which (if I'm not mistaken) makes it critically damped, but even soldering it to a PCB can add a tiny bit of load capacitance and therefore a tiny bit of more overshoot.

There's any number of other reasons you can also get similar issues, but the point is... analog systems are not completely free of these sorts of things... but if there's a tiny bit of opamp ringing at 3MHz, as far as audio goes it's rather negligible compared to a ton of ringing at 20kHz. In analog it's mostly an issue when you're trying to drive a load with way more capacitance than the design intended (like.. perhaps a very long cable?), but put a scope with enough bandwidth at the output of most audio circuits and it's entirely possible you see a bit of ringing in things like sharp edges of raw square-waves or whatever.

The point is... a bit of ringing by itself is not necessarily a problem. The problem is when there's lots of it, at low enough frequency that it turns into IMD distortion with the actual audio signals in the actual audio band.... or it goes into self-oscillation and your analog circuit becomes an unlicensed radio transmitter.
You do not have the required permissions to view the files attached to this post.

Post

Music Engineer wrote: Thu Feb 29, 2024 6:46 pm Yeah - I now think that Cesaro summation just corresponds to using a triangular window (which is also known as the Fejer-window - probably that's why) in the frequency domain - which indeed implies a strong attenuation of high frequencies. Trying to use phase-shifting to counteract the ripple is indeed a thing that might be interesting to explore.
I did run some experiments. Shifting the phase of partials can indeed help to reduce the ringing around discontinuities in the waveform. However then it always appears somewhere else. So in short: it won't help in practise
We do not have a support forum on kvr. Please refer to our offical location: https://www.tone2.com/faq.html

Post

Tone2 Synthesizers wrote: Mon Mar 25, 2024 4:55 pm I did run some experiments. Shifting the phase of partials can indeed help to reduce the ringing around discontinuities in the waveform. However then it always appears somewhere else. So in short: it won't help in practise
I did some experiments with using brickwall (elliptic) IIR filters and combining them with some allpass filters to move some parts of the overshoot to the other side of the edge (like in a sawtooth or square wave), i.e. distribute the overshoot more symmetrically between the left and right side of the discontinuity. Initially, due to the minimum phase characteristic of the elliptic filter, all the overshoot is on the right side. With the allpasses, I can reduce the overshoot on the right side at the expense of introducing some overshoot on the left side (where previously was none). I'm considering to use that technique in the future for brickwall IIR filters. Edit: after doing these experiments, it occurred to me that I'm actually manually trying to design a phase-correction allpass. Something like this:

https://spinlab.wpi.edu/courses/ece503_ ... xample.pdf

Of course, for (symmetric) FIR filters, the ripple is already symmetrically distributed to both sides of the edge in the first place, so in such a case, an allpass won't help.

Edit: and maybe shifting the ringing to somewhere else - away from the discontinuity - could be a good thing, especially when that signal discontinuity coincides with signal extrema (as it typical in many common waveforms (e.g. saw, pulse)) . In a subsequent waveshaper, some wiggle around a zero-crossing may be less offensive than the overshoot at the extrema. :shrug:
My website: rs-met.com, My presences on: YouTube, GitHub, Facebook

Post Reply

Return to “DSP and Plugin Development”