Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Oversampling Toolkit (Revisited)

DSP related issues, mathematics, processing and techniques

Re: Oversampling Toolkit (Revisited)

Postby martinvicanek » Mon Dec 22, 2014 8:15 pm

Wow, you are a genius, Tronic! :ugeek: Pity I haven't time right now to check it out in depth.
User avatar
martinvicanek
 
Posts: 1318
Joined: Sat Jun 22, 2013 8:28 pm

Re: Oversampling Toolkit (Revisited)

Postby Tronic » Tue Dec 23, 2014 2:01 pm

martin're too kind :P
I just port the implementation of Laurent de Soras, in language more friendly, like Ruby.
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Oversampling Toolkit (Revisited)

Postby MyCo » Wed Dec 24, 2014 9:02 am

Thanks Tronic, the coeffs are indeed generated by this code. You can reproduce them with transition = 0.01 (hard slope) and 0.05 (soft slope).
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Oversampling Toolkit (Revisited)

Postby TheOm » Tue Apr 07, 2015 1:33 am

Thank you very much for sharing these.
I am currently using the Order 10 hard slope version in a project (a distortion plugin).
During optimizing I first changed the upsampler to do the filtering for odd and even samples simultaneously, because I only have a stereo input signal.
When I wanted to do the same thing for the downsampler I was a bit surprised to see that the downsampler does twice the amount of work that the upsampler does, which seemed strange to me. So I looked closer and it seems like f2outEven and f1outOdd are calculated, but never actually used. :?:
When I removed those calculations I could not notice any kind of change in behaviour, so I think they really are superfluous.

Also another thing that I noticed while testing:
Changing from not oversampled to x2 oversampled reduces aliasing by a fair amount.
But I could not see any difference between x2 and x4 upsampling. Why is that?
Attachments
Oversampling Kit 5 (MyCo) The Om Tanh test.fsm
(239.33 KiB) Downloaded 1267 times
TheOm
 
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: Oversampling Toolkit (Revisited)

Postby MyCo » Tue Apr 07, 2015 6:51 pm

TheOm wrote:So I looked closer and it seems like f2outEven and f1outOdd are calculated, but never actually used. :?:


That's not true. Those variables are used in a loop. So on the next sample they are read before they get overridden. And their values are at the end used to calculate the interpolated final output ("out") by using their corresponding xmm registers.

TheOm wrote:When I removed those calculations I could not notice any kind of change in behaviour, so I think they really are superfluous.


You actually didn't remove em, you just shuffled them to different SSE channels and at the end you shuffle them back and interpolate. That's not surprising me, it's actually how you would do it when you don't rely on all 4 channels. Martin mentioned that as well earlier:
MyCo wrote:
martinvicanek wrote:You could exploit SSE to squeeze out still more (unless you really need to process all 4 channels in parallel)

I didn't want to go that way, because I thought about using it for oscillators in a poly section.


TheOm wrote:But I could not see any difference between x2 and x4 upsampling. Why is that?

Yeah, the problem is, it hardly depends on the aliasing your code is generating. When you take the rate reducer example in this thread, you can clearly see the difference. The higher oversampling order only makes sense when you have aliasing above twice the sampling rate (4 times the nyquist).
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Oversampling Toolkit (Revisited)

Postby TheOm » Tue Apr 07, 2015 8:38 pm

This is the usage of the channels in xmm0 in my version of the downsampler:

xmm0[0]: Filter1, Even, Left
xmm0[1]: Filter1, Even, Right
xmm0[2]: Filter2, Odd, Left
xmm0[3]: Filter2, Odd, Right

Notice that I am neither calculating Filter 2 for the Even Samples nor Filter 1 for the Odd samples, but the output is still identical to your original version.
It's also pretty easy to see in the blue code version that f2outEven and f1outOdd do not contribute anything to the output.
TheOm
 
Posts: 103
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: Oversampling Toolkit (Revisited)

Postby MyCo » Tue Apr 07, 2015 10:02 pm

Yeah, something is messed up there. Not sure if I just forgotten to remove that when optimizing the code, or if the filters should actually be joined and I made a mistake.
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Oversampling Toolkit (Revisited)

Postby MyCo » Fri Apr 17, 2015 3:00 am

I've updated the kit. So the unused code is removed. Download is in the first post.
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Previous

Return to DSP

Who is online

Users browsing this forum: No registered users and 13 guests