Page 1 of 2

MyCo's and MV's Oversampling Toolkit

Posted: Sat Apr 16, 2022 3:00 pm
by martinvicanek
MyCo's oversampling toolkit from the past (Synthmaker?) days. I remember there used to be a tutorial on the SM forum. Anybody has a copy?

Re: MyCo's Oversampling Toolkit

Posted: Sun Apr 17, 2022 2:11 pm
by Spogg
Thanks for this Martin.

Back in 2016 there was a discussion about oversampling in FS using the technique in the toolkit:

viewtopic.php?f=2&t=4383&p=24759

I didn’t understand it then and, 6 years later, I still don’t get it. :oops:

Please forgive me again, but if FS evaluates a whole schematic once per sample how do we achieve a sample rate of 88.2 KHz? I know the technique somehow splits the stream into “odd and even” (whatever that means) and the two halves are processed in ASM at the same time, in parallel, and recombined later. :?

I guess what I really need is a book called “Oversampling in FlowStone for Dummies”. :lol:

Re: MyCo's Oversampling Toolkit

Posted: Mon Apr 18, 2022 7:03 pm
by martinvicanek
HI gang, I know this is not at all an obvious matter, so I whipped up a little demo/tutorial with application examples. Hope it helps. :)

Re: MyCo's Oversampling Toolkit

Posted: Tue Apr 19, 2022 3:35 pm
by Spogg
Thank you SO much for the tutorial and worked examples. :D

I spent quite some time puzzling over this and I found the DSP code versions of up and down sampling filter number 1 really useful, because I could work out what the code was doing. I also auditioned the Tanh(x) thing as well as the naïve saw and the results were striking to me.

Based on me listening rather than going by the graphs, I found the audio results absolutely fine with the simplest up/down selected. So although I could see the differences I could barely hear them (on good headphones)!

I think I get the ODD/EVEN thing now. I checked, and swapping odd/even still worked, so they could be called a/b or x/y or whatever. “Odd/even” was a stumbling block for me before, but I guess it relates to sample number 1 when a channel opens, then 2 and then 3 and so on.

The big light came on for me when I realised that a single sample pass of an up-sampling code block (or saw osc) would generate 2 non-identical stream values per sample period so, for example, you get 2 outputs separated by half the difference between the current and previous value. The 2 different values are generated at 44100 with a nyquist of 22050 for both signal paths (odd/even). What seems to be happening with down-sampling is the aliasing is reduced by averaging between 2 successive samples for the odd and even and this is the bit that still puzzles me I’m afraid. Clearly it works successfully and is useful, but I’m surprised at just how much the aliasing is reduced.

BTW Martin, are you a native English speaker? Your text was perfect and I wouldn’t have edited even one word!

Re: MyCo's Oversampling Toolkit

Posted: Tue Apr 19, 2022 7:12 pm
by Tepeix
Yep thanks, very interesting and detailed !

I had also difficulty to hear the difference, even with a naive square.
But once placed in a simple synth with envelope i could clearly hear it !)

Re: MyCo's Oversampling Toolkit

Posted: Tue Apr 19, 2022 10:40 pm
by tulamide
martinvicanek wrote:HI gang, I know this is not at all an obvious matter, so I whipped up a little demo/tutorial with application examples. Hope it helps. :)

Without having read it, here's how I'd do it (or not do it):
I double, quadruple, or whatever the rate increase is, each sample, then do some magic and finally average the doubled/quadrupled etc values down to one again.

Problem is, I suck at magic :lol:

Re: MyCo's Oversampling Toolkit

Posted: Wed Apr 20, 2022 8:37 am
by Spogg
tulamide wrote:... I double, quadruple, or whatever the rate increase is, each sample...


Once I’d kinda worked out what was going on I started to wonder if you could generate 4 non-identical values per sample period. But then my brain hung up.
:lol:

Re: MyCo's Oversampling Toolkit

Posted: Wed Apr 20, 2022 8:54 am
by martinvicanek
You can cascade the 2x oversampling units to achieve 4x, 8x, etc. Perhaps I should include that in the tutorial. Hmm.

Re: MyCo's Oversampling Toolkit

Posted: Wed Apr 20, 2022 10:45 am
by Spogg
martinvicanek wrote:You can cascade the 2x oversampling units to achieve 4x, 8x, etc. Perhaps I should include that in the tutorial. Hmm.

Oh wow! Yes please!

Re: MyCo's Oversampling Toolkit

Posted: Wed Apr 20, 2022 12:59 pm
by adamszabo
Very interesting Martin, thanks for the tutorial! I am particularly interested in the 2x upsampled naive saw. I assume it outputs the odd and even samples only? I am still not quite sure how that works, can one visualize it somehow with a graph so we see that they only go to even and odd ones? Or I am misunderstanding something?