How to add Oversampling to modules

Post Reply
User avatar
AndyMac
Posts: 148
Joined: Wed Sep 05, 2018 6:16 pm
Location: Wirral UK
Contact:

How to add Oversampling to modules

Post 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.
ColinP
Posts: 939
Joined: Mon Aug 03, 2020 7:46 pm

Re: How to add Oversampling to modules

Post 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.
User avatar
AndyMac
Posts: 148
Joined: Wed Sep 05, 2018 6:16 pm
Location: Wirral UK
Contact:

Re: How to add Oversampling to modules

Post 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.
ColinP
Posts: 939
Joined: Mon Aug 03, 2020 7:46 pm

Re: How to add Oversampling to modules

Post 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.
Post Reply

Return to “Module Designer”