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

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Stereo width control

Post any examples or modules that you want to share here

Stereo width control

Postby blatantleesly » Tue Jul 28, 2015 3:54 pm

stereo width control.fsm
(7.56 KiB) Downloaded 1162 times


Hi all,

A simple stereo width control using DSP.
blatantleesly
 
Posts: 21
Joined: Wed May 20, 2015 2:46 pm

Re: Stereo width control

Postby tulamide » Tue Jul 28, 2015 4:55 pm

Thank you, I'll make use of it. :)

To all asm-gurus: Is this already as fast as possible, or could one of you optimize the asm code?
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2692
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Stereo width control

Postby KG_is_back » Tue Jul 28, 2015 7:27 pm

there is a minor bug in the code:
Code: Select all
out1 = mid - side;
out2 = mid + side;

The signs should be swapped, because mid=left+right and side=left-right => left=mid+side

here is ASM optimized version of the code:
Code: Select all
streamin in1;
streamin in2;
streamin width;
streamout out1;
streamout out2;
float x=0.5;

movaps xmm0,width;
mulps xmm0,x;

movaps xmm0,in1;
movaps xmm1,in2;
movaps xmm2,xmm0;
addps xmm0,xmm1;
subps xmm2,xmm1;

movaps xmm3,x;
mulps xmm0,xmm3;
mulps xmm2,xmm3;
mulps xmm2,width;
movaps xmm1,xmm0;
addps xmm0,xmm2;
subps xmm1,xmm2;
movaps out1,xmm0;
movaps out2,xmm1;


the CPU savings will be minuscule though - the code is only using + - * which are very CPU cheap and those few intermediate variables don't make much difference.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Stereo width control

Postby tulamide » Wed Jul 29, 2015 12:19 am

Will test it later, but wanted to already thank you.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2692
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Stereo width control

Postby Rocko » Tue Sep 01, 2015 2:41 pm

Hi,

From theory side, can't this code be optimized by SSE, meaning by packing L+R into a single SSE, then processing SSE(0) and SSE(1), and then unpacking?

Or is that true only if running the same exact processing on both Left and Right inputs, which is not the case here?
Rocko
 
Posts: 186
Joined: Tue May 15, 2012 12:42 pm


Return to User Examples

Who is online

Users browsing this forum: No registered users and 14 guests