Antialiasing a synth?

Hi, I’m fairly new to dsp and have only recently come across a problem unbeknownst to me called “Anti aliasing” which causes this problem:

this is the spectrum of a saw wave played on my synth at a very high frequency. As you can see the harmonics are “bouncing back” at Nyquist’s frequency and going back down, even below the fundamental. This is obviously not ideal and was wondering a good way of going about solving it.
I have seen very little on these forums about antialiasing which surprises me quite a bit.

Thanks in advance

The problem is actually not a problem caused by JUCE, so your best bet is to do some research on the matter using your search engine of choice.

Yeah I did not mean to imply that it was a problem with juce. However I am surprised there are nto more forum posts discussing this issue, as it seems to be a pretty fundamental problem in dsp.
How did you solve this problem with your synth?

Aliasing is one of the most common issues when working with non-sinusoidal/non-linear systems in DSP and is usually “fixed” by using some kind of oversampling.

Oversampling is not an ideal choice for oscillators, though. Even large oversampling factors might not reduce aliasing enough but the CPU use will be multiplied by the oversampling factor.

For wavetable based oscillators, one approach is to have multiple wavetables for different pitch ranges. (Wavetables for higher note pitches would have less high frequency partials.)

For generating the classic simple synth waveforms (triangles, saws and squares), there are specialized techniques like minBlep.

1 Like

Yeah after going through some different articles and papers, I think the approach I will take is a combination of MIP MAPs (which is what you’re describing) as it states in this paper:

and also limiting the modulation index for high frequencies.

I “cheated” using an approach of constant “hard/reset sync” and frequency, but not actual sample, oversampling.