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

Wraping the signal.

For general discussion related FlowStone

Wraping the signal.

Postby joejoe » Fri Nov 08, 2013 4:49 am

Has anyone made any components that wrap the signal between -1 and 1 or 0 and 1? Would you be able to share with me?
joejoe
 
Posts: 23
Joined: Mon Oct 21, 2013 2:28 am

Re: Wraping the signal.

Postby trogluddite » Fri Nov 08, 2013 12:40 pm

Hi joejoe,

Not at my FS machine at the moment - but copy/pasting this code into an assembly primitive should get you what you need (not tested!)

Code: Select all
streamin in;
streamout out;

float one = 1.0;
float two = 2.0;
float half = 0.5;

movaps xmm0,in;

//Scale -1..1 to 0..1
addps xmm0,one;
mulps xmm0,half;

//Wrap to 0..1 by removing integer part.
movaps xmm1,xmm0;
addps xmm1,half;
cvtps2dq xmm1,xmm1;
cvtdq2ps xmm1,xmm1;
subps xmm0,xmm1;

//Scale 0..1 to -1..1
mulps xmm0,two;
subps xmm0,one;

movaps out,xmm0;
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
trogluddite
 
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Wraping the signal.

Postby joejoe » Fri Nov 08, 2013 2:47 pm

Thank you Tro, I do get sound out of it and when I bring my osc to 1 I get distortion which I suppose should be the case. Correct? When plugging a scope into it I don't get an output reading.
joejoe
 
Posts: 23
Joined: Mon Oct 21, 2013 2:28 am


Return to General

Who is online

Users browsing this forum: No registered users and 65 guests