[DSP module discussion] New Oversampling class

Thanks again man! :wink:

But regarding the Oversampling, I was talking specifically about this:

Iā€™m not sure what optimisation will do here, but I hardly believe any kind of SIMD will take place, I would say some loop unrolling at most.

But since it is convolution anyways, why not use the dsp::Convolution there and take advantage of the efficiency that frequency domain convolution provides, and on top of that, FloatVectorOperation optimization.

The reason why dsp:Convolution (which is SIMD optimized by the way, see the function ConvolutionEgine::convolutionProcessingAndAccumulate) is not used for FIR Oversampling is because it wouldnā€™t be as efficient as you think to do so. As a general rule, FFT convolution is supposed to be faster than time-domain convolution when the length of the IR is higher than 64 samples. Otherwise, the FFT operation itself all alone will be slower than the time domain operations.

About the SIMD optimization of Oversampling, Iā€™ll have a look at some point, but I think I did already a good job by taking into account the symmetry and all the properties of 2 times upsampling / downsampling, even if it could be faster using SIMD for say multi channel oversampling. To me, the part that needs to be optimized most of the time is the process being oversampled itself, since the operation multiplies by two / four / eight its original CPU cost.

1 Like

I think big gains (x2) could be achieved by using the parallel property of the IIR multi-phase filters. Itā€™s two independent filters in parallel outputting interleaved samples, so they can be calculated at the same time using SIMD. The FIR filter could also be done using SIMD and could scale even more than 2-fold as itā€™s parallel by design. This would all apply to single-channel oversampling and by extension also multi-channel.

Of course, the internal processing loop is the most important thing to optimize, but the oversampling itself is also oversampled for higher ratios and the filters are executed many times. For instants, an 8x oversampler filters the signal 6 times through all the stages and the innermost are running at 4x the sample rate. So overall we end up filtering 2*(4+2+1)x = 14x the amount of incoming audio samples.

btw. I had a thought about the -75dB max qualityā€¦ would you use an audio interface with 75dB SNR? In my opinion, the same quality demands apply because the oversampling should be transparent to the audio.

1 Like

Thanks a lot for the elucidation @IvanC.
Iā€™m a heavy user of the Oversampling, and Iā€™m very satisfied with the performance.
Just throwing ideas. :slight_smile:

By reading the code I kinda get what you mean.
But just out of curiosity, I couldnā€™t understand if it is doing some kind of FIR poly-phase decomposition. Does that makes sense?

Yes it does, even if there is no SIMD optimization, I spent a lot of time on the algorithm coding :wink:

1 Like

Currently working hard :slight_smile:

1 Like

Any news about a dsp::delay with good fractional delays implementations?
(that would notably be useful to compensate the dsp::oversampling latency )

1 Like