Page 1 of 1
How to add Oversampling to modules
Posted: Thu Jan 20, 2022 7:54 am
by AndyMac
I am working on some modules that split audio waves into multiple parts and, as a result, have issues with aliasing for higher notes due to the fixed 48kHz internal sample rate in Voltage Modular. I have seen some developers are including up to 8x oversampling in their modules and was wondering how this was being done within the limits, and if anyone has example code that I might be able to make use of/adapt for this module.
Re: How to add Oversampling to modules
Posted: Thu Jan 20, 2022 7:02 pm
by ColinP
Hi Andy,
This is one of the things I'm studying at the moment but I'm not an expert in audio DSP. My experience of resampling techniques is in 2D graphics but I believe the principles are essentially the same.
The idea is to upsample the input by an integer factor. Then do processing at the higher virtual sample rate. Then downsample back to the original sample rate.
Upsampling is done by a process called "zero stuffing" followed by low-pass filtering. One might think that linear interpolation would work best but zero stuffing counter-intuitively is definitely the way to go. Note that a FIR filter can be used so that the known presence of the zeros can be exploited to increase efficiency.
Downsampling applies a low-pass filter to the oversampled data and again a FIR algorithm allows optimisation during the decimation.
I hope this provides some pointers for you to google more detail.
Re: How to add Oversampling to modules
Posted: Thu Jan 20, 2022 8:42 pm
by AndyMac
Thank you, that gives me a great starter around it
although it does sound quite complex. I might have to put those modules on the backlog for now while I get to grips with it.
Re: How to add Oversampling to modules
Posted: Thu Jan 20, 2022 9:11 pm
by ColinP
The Star Trek like terminology doesn't help.
And some of the maths looks a bit frightening but in reality a lot of this stuff ends up being just a few lines of code so don't feel put off.
One thing I forgot to mention is that much of the point of this is that the final low-pass filtering is done at the higher sample rate and it's this that makes it easier to filter out the crap above the Nyquist frequency that causes the anti-aliasing.