"Mastering grade oversampling"?

DSP, Plug-in and Host development discussion.
mystran
KVRAF
6761 posts since 12 Feb, 2006 from Helsinki, Finland

Post Thu Nov 25, 2021 8:36 am

Urs wrote:
Thu Nov 25, 2021 8:18 am
Yes, that's what I meant. I just expressed it clumsily and in an easily misunderstood way.
Oh, I don't doubt it, I just wanted to clarify (for the benefit of future readers who stumble upon this thread by random) 'cos it's not entirely obvious if you've never thought about what exactly is going on. :)
Preferred pronouns would be "it/it" because according to this country, I'm a piece of human trash.

Zaphod (giancarlo)
KVRAF
2560 posts since 23 Jun, 2006

Post Mon Nov 29, 2021 7:40 am

we have low quality oversampling and high quality oversampling. In the low-quality one, the consumption is low but the phase is not completely flat for the spectrum range. Clearly there is always a solution to the phase problem (even in IIR mode), but it complicates the design and final consumption a bit. For a "decent" oversampling many factors come into play (the presence of a fir interpolator, the DFT approach and possibly partitioned convolution and so on).

As far as kernel length is concerned, it is not true that you can just stretch it to infinity and simply increase the latency. This works from a noise reduction point of view, but it increases preringing and all the artifacts that affect the transient. A longer pulse creates more audible artifacts, all of which is also pretty logical.

The common opinion is that you just need to upsample and downsample and that's the end of the game, but the type of filter heavily influences the final result.

Surprisingly, we have analyzed many products with various ovesampling algorithms and the quality of the final result varies a lot, some were really unlistenable.

mystran
KVRAF
6761 posts since 12 Feb, 2006 from Helsinki, Finland

Post Mon Nov 29, 2021 9:11 am

Zaphod (giancarlo) wrote:
Mon Nov 29, 2021 7:40 am
we have low quality oversampling and high quality oversampling. In the low-quality one, the consumption is low but the phase is not completely flat for the spectrum range. Clearly there is always a solution to the phase problem (even in IIR mode), but it complicates the design and final consumption a bit. For a "decent" oversampling many factors come into play (the presence of a fir interpolator, the DFT approach and possibly partitioned convolution and so on).
I want to agree that there's no "one size fits all" solution, but I'm not convinced FFT is very profitable (you're free to try to convince me otherwise, but this is my experience), since it takes quite a ridiculously long (well, for oversampling purposes) kernel before any kind of FFT-approach actually starts to perform better than a straight polyphase FIR (especially with SIMD)... or put another way, it seems that for a typical "reasonable" resampling kernel, the optimum FFT blocksize for partitioned polyphase filtering is 1 sample (ie. no FFT at all).
The common opinion is that you just need to upsample and downsample and that's the end of the game, but the type of filter heavily influences the final result.
This I could not agree with more and it's not just about pre-ringing. Especially with strong non-linear processing one should also consider what the transition shape does with IMD products, because you can get quite obvious notches or other issues in the audible band from a poor (eg. too sharp) transition shape even if you're oversampling enough that aliasing is completely negligible.

This is actually a tricky problem for distortion, because the act of band-limiting very much changes the sound of a distortion even at low frequencies (and generally not for the better). In a synth you can sort of get around it by rendering your oscillators at something like 2x so you can then have a very gradual and nice transition before additional oversampling for non-linear stages, but if you're starting with critically sampled audio (eg. 44.1kHz or 48kHz) then you're sort of between rock and a hard place from the get go as you can either use a gradual transition (=loss of high frequencies) or you can use a sharp transition (=bad distortion IMD products).
Preferred pronouns would be "it/it" because according to this country, I'm a piece of human trash.

Zaphod (giancarlo)
KVRAF
2560 posts since 23 Jun, 2006

Post Mon Nov 29, 2021 10:53 am

...
Last edited by Zaphod (giancarlo) on Mon Nov 29, 2021 10:55 am, edited 1 time in total.

Zaphod (giancarlo)
KVRAF
2560 posts since 23 Jun, 2006

Post Mon Nov 29, 2021 10:55 am

mystran wrote:
Mon Nov 29, 2021 9:11 am
Zaphod (giancarlo) wrote:
Mon Nov 29, 2021 7:40 am
we have low quality oversampling and high quality oversampling. In the low-quality one, the consumption is low but the phase is not completely flat for the spectrum range. Clearly there is always a solution to the phase problem (even in IIR mode), but it complicates the design and final consumption a bit. For a "decent" oversampling many factors come into play (the presence of a fir interpolator, the DFT approach and possibly partitioned convolution and so on).
I want to agree that there's no "one size fits all" solution, but I'm not convinced FFT is very profitable (you're free to try to convince me otherwise, but this is my experience), since it takes quite a ridiculously long (well, for oversampling purposes) kernel before any kind of FFT-approach actually starts to perform better than a straight polyphase FIR (especially with SIMD)... or put another way, it seems that for a typical "reasonable" resampling kernel, the optimum FFT blocksize for partitioned polyphase filtering is 1 sample (ie. no FFT at all).
The common opinion is that you just need to upsample and downsample and that's the end of the game, but the type of filter heavily influences the final result.
This I could not agree with more and it's not just about pre-ringing. Especially with strong non-linear processing one should also consider what the transition shape does with IMD products, because you can get quite obvious notches or other issues in the audible band from a poor (eg. too sharp) transition shape even if you're oversampling enough that aliasing is completely negligible.

This is actually a tricky problem for distortion, because the act of band-limiting very much changes the sound of a distortion even at low frequencies (and generally not for the better). In a synth you can sort of get around it by rendering your oscillators at something like 2x so you can then have a very gradual and nice transition before additional oversampling for non-linear stages, but if you're starting with critically sampled audio (eg. 44.1kHz or 48kHz) then you're sort of between rock and a hard place from the get go as you can either use a gradual transition (=loss of high frequencies) or you can use a sharp transition (=bad distortion IMD products).
Yes I read it somewhere but I didn't believe. There was a paper describing DFT on top, so I simply tested it.
We have partitioned FFT optional, on top of the calculation. With the actual size we are using it is 30% lighter. I can disable it, but it doesn't make a sense. Yes possibly using 32 doesn't make it worth

Zaphod (giancarlo)
KVRAF
2560 posts since 23 Jun, 2006

Post Mon Nov 29, 2021 6:34 pm

btw i’m speaking about FFT/DFT on TOP of polyphase approach. Polyphase is necessary (both for cpu load AND latency)

And yes, our direct convolution is based on SIMD, but still…

To solve the problem I had to write all the code in a custom way. Combining the polyphase concept with a partitioned FFT approach is simple but requires some attention, at the end you have to invest some time in debugging and understanding how to make the polyphase implementation compatible.

mystran
KVRAF
6761 posts since 12 Feb, 2006 from Helsinki, Finland

Post Mon Nov 29, 2021 6:44 pm

Zaphod (giancarlo) wrote:
Mon Nov 29, 2021 6:34 pm
btw i’m speaking about FFT/DFT on TOP of polyphase approach. Polyphase is necessary (both for cpu load AND latency)
Yes, is what I was talking about too.
Preferred pronouns would be "it/it" because according to this country, I'm a piece of human trash.

Return to “DSP and Plug-in Development”