Anti aliasing is still a bit of a mystery to me. If my CPU is powerful enough, can I just run my patch at 96000 or even 192000 and put a 22kHz filter at the end? Or do I still need to filter between each audio process that could introduce aliasing?
My patch is a modular synth with modules as follows: oscs, filters, EQ, wavefolding, FM.
-
Aliasing and high sampe rates.
-
anti-aliasing methods are required 1. when downsampling but 2. also when generating content.
you already got how about 1. works; as far as 2. applies, this of course is not always possible, but should be done whereever possible.
frequency filters do not suffer from too much aliasing, so you could leave that out for now.
but the generation of oscillators will often require to bandlimit the content.
do you use wavetables/harmonics/tri/saw and squarewaves? if yes, that is where you should begin with. once you only use bandlimited generators, most things work fine in a pure 44 khz circuit.
-
another part of the answer would be this:
upsampling does not avoid aliasing, it only makes it happen later.
-
Am I upsampling or downsampling if I generate the waveforms at 192kHz and stay in 192kHz until the actual physical DAC?
As well as ugly oscillators, I have FM and wavefolding and the resonance on the filters generates some high frequencies at times. So it gets pretty bad if I run the patch at 44.1
-
i am not a pd user but dont think you can work in 192 khz when the IO hardware does not support that.
you will more likely only have a part of your DSP running at a higher samplerate and not everything.
that is pretty good practice to up- and downsample all the time and that is also what happens when you work in a DAW with a dozen of plug-ins in the same channel.there are enough situations where you can downsample to save CPU, for example when you modulate 10 LFOs which each other - or when you analyze data for GUI presentation.
from 192 to 48... that would be "down".
which means that before you "enter" 48 khz you will place a filter there which removes content over 24 Hz of frequency.
FM is a bitch, as soon as you use waveforms other than pure cosines or harmonics, calculating sidebands and spectral content is almost impossible for us normal mortals..
however with 192 khz you´d have more "headroom"; the path until a foldover frequency comes back down to 24 khz is 300% longer.
if there are filters which can produce frequencies over nyquist, other than errors? i doubt it, but i dont guaranty this.
if you build your own biquad or ladder filter using + - *, loops and gates, you would typically upsample x2 - or give the user an option to do so - and be fine.
for FIR it should not be required at all, unless i am mistaken.
and externals might already do it inside (at least comb~ for example), so in this case check that first.
-
@Obineg Thanks for the info. My hardware does go up to 192kHz. I definitely need to look at bandlimited ways of doing PWM and oscillator sync. But it seems like if I put a few lowpass filters at 22kHz in the signal chain whilst keeping the sample rate high throughout, it might be OK.