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

tula's DSP modules

Post any examples or modules that you want to share here

Re: tula's DSP modules

Postby tulamide » Fri Jan 12, 2018 5:30 am

RJHollins wrote:Thanks T.

Are there any DSP sites that you're researching from ?

No, but I'm sure that will happen, once I enter the "complex zone"
tulamide
 
Posts: 1649
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: tula's DSP modules

Postby RJHollins » Fri Jan 12, 2018 7:06 am

tulamide wrote:
RJHollins wrote:Thanks T.

Are there any DSP sites that you're researching from ?

No, but I'm sure that will happen, once I enter the "complex zone"

Alright ... well ... be safe ... report back ... hope ya keep post findings ....

and maybe we'll get more group insights/explanations.

I learned some new stuff already from this thread.

thx
RJHollins
 
Posts: 1242
Joined: Thu Mar 08, 2012 7:58 pm

Re: tula's DSP modules

Postby Spogg » Fri Jan 12, 2018 5:16 pm

Here's a poly stream-controlled inverter I knocked up, together with a demo test synth attached.

DSP box.png
DSP box.png (288.21 KiB) Viewed 1253 times


I wonder if this could be made more efficiently in DSP code...

Cheers

Spogg
Attachments
Stream controlled inverter -Spogg .fsm
(552.05 KiB) Downloaded 60 times
User avatar
Spogg
 
Posts: 1645
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: tula's DSP modules

Postby tulamide » Fri Jan 12, 2018 10:35 pm

Hey Spogg,

thanks for participating! Interesting question. I came to the conclusion that basically you only care for a sign switch (positive switch input = +1, negative switch input = -1). I always look at all modules, Martin shares with us. In the past, it didn't help me the slightest bit. But now that I slowly start to understand the dsp editor, I remembered that I once saw a sign bitmask in some of Martin's modules.
Code: Select all
sgn = -1&-2 //sign bitmask defined in stage 0

I have no clue what exactly is happening to the bits, but I know what a sign function does in higher level programming languages. And since it is a bitmask, I knew I had to somehow bitwise combine it with the switch. After several tries, I came up with this
Code: Select all
1|(switch&sgn) //results in either -1 or 1


The final code then looks like so:
stream_switch_inverter.png
stream_switch_inverter.png (6.42 KiB) Viewed 1241 times


What do you think? And what do the DSP gurus think?
Attachments
Stream controlled inverter -Spogg(tula) .fsm
(86.11 KiB) Downloaded 54 times
tulamide
 
Posts: 1649
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: tula's DSP modules

Postby martinvicanek » Sat Jan 13, 2018 2:05 am

Yup, tula's inverter does the same as Spogg's and is more efficient. ;)
It is probably not meant to be used as in the schematic because it aliases quite heavily.
martinvicanek
 
Posts: 768
Joined: Sat Jun 22, 2013 8:28 pm

Re: tula's DSP modules

Postby Spogg » Sat Jan 13, 2018 9:43 am

Hey well done tulamide! :ugeek:

Nobody noticed I got the inv and noninv names crossed, not that it matters for the result.

My first attempt was to get the whole job done in just one line of code, but I failed to find a method.

I like this topic!

Spogg
User avatar
Spogg
 
Posts: 1645
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: tula's DSP modules

Postby TheOm » Sat Jan 13, 2018 1:41 pm

tulamide wrote:
Code: Select all
sgn = -1&-2


There is actually an even simpler method to get a sign mask in dsp code:
Code: Select all
float signbit = -0;


Unfortunately you can not use xor in dsp code, otherwise one could simplify the code to
Code: Select all
out = in ^ (switch & signbit);


This is why I don't like the dsp code module, it is limiting because it doesn't have all the features and the generated asm code is poor.
TheOm
 
Posts: 124
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: tula's DSP modules

Postby martinvicanek » Sat Jan 13, 2018 1:53 pm

TheOm wrote:There is actually an even simpler method to get a sign mask in dsp code:
Code: Select all
float signbit = -0;

Cool! :ugeek:
Do you happen to have a simpler expression for the abs bitmask as well?
martinvicanek
 
Posts: 768
Joined: Sat Jun 22, 2013 8:28 pm

Re: tula's DSP modules

Postby TheOm » Sat Jan 13, 2018 2:14 pm

martinvicanek wrote:Do you happen to have a simpler expression for the abs bitmask as well?

No, unfortunately not without using stage0. I don't think there's a way to type NaN in the code module, is there?
TheOm
 
Posts: 124
Joined: Tue Jan 28, 2014 7:35 pm
Location: Germany

Re: tula's DSP modules

Postby Spogg » Sat Jan 13, 2018 4:20 pm

TheOm wrote:
Unfortunately you can not use xor in dsp code, otherwise one could simplify the code to
Code: Select all
out = in ^ (switch & signbit);


This is why I don't like the dsp code module, it is limiting because it doesn't have all the features and the generated asm code is poor.


Assuming the ^ symbol means XOR it'll be available in the 3.09 release according to the list I have. The DSP code will be extended considerably.

Cheers

Spogg
User avatar
Spogg
 
Posts: 1645
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

PreviousNext

Return to User Examples

Who is online

Users browsing this forum: No registered users and 13 guests