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

Comparison codes for DSP module

DSP related issues, mathematics, processing and techniques

Comparison codes for DSP module

Postby Spogg » Sat May 09, 2015 2:04 pm

Hi
The User Guide doesn't seem to list all the possible comparison DSP codes. I base this on looking at others' DSP coding.
I've found
== which means exactly equal to
!= which means not equal to
I've also seen the vertical bar symbol | but have no idea what this does and means. Can someone enlighten me please?

What other stuff can I use in the DSP box that I don't know about? Does anyone have a complete list by any chance?

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

Re: Comparison codes for DSP module

Postby adamszabo » Sat May 09, 2015 9:15 pm

| is Or, & is And, then you have these also: <, >, >=, <=
adamszabo
 
Posts: 657
Joined: Sun Jul 11, 2010 7:21 am

Re: Comparison codes for DSP module

Postby KG_is_back » Sun May 10, 2015 6:33 pm

there is also pow(x,y) function, which is x to the power of y. However, it is very CPU consuming (in mono it is mostly OK, but in poly it can be quite a bugger). I recommend using these: http://flowstone.guru/downloads/stream-math-functions/
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Comparison codes for DSP module

Postby Spogg » Mon May 11, 2015 8:25 am

Hey thanks guys, much appreciated. I do wonder why the latest User Guide doesn't show all the functions available.
Cheers!
User avatar
Spogg
 
Posts: 3318
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: Comparison codes for DSP module

Postby Spogg » Tue Jun 09, 2015 3:54 pm

I found another one, by accident:

abs(a) gives the absolute positive value of a, that is it removes a - sign.

I do wonder what else isn't in the manual...

Cheers

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

Re: Comparison codes for DSP module

Postby MyCo » Tue Jun 09, 2015 7:58 pm

eg. sign, exp, sqrt
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Comparison codes for DSP module

Postby tulamide » Tue Jun 09, 2015 8:11 pm

Spogg wrote:abs(a) gives the absolute positive value of a, that is it removes a - sign.

Sorry, I just can't resist :mrgreen:

Time for Mr Wisenheimer in his smarty-pants

"absolute positive value" is an contradiction in terms. While certainly all will understand what you mean, the absolute of a value doesn't have any sign. That's why it's called absolute. Programming always was forming from lazyness. One of these lazy guys decided that positive values won't be written as +5, but only as 5 and the programmer thinks of it as '+5'

But despite its writing a number is either +5 or -5. Only when taken the absolute it is just 5 without any "direction".


Thanks, Mr Wisenheimer, what would we do without you!
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2686
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Comparison codes for DSP module

Postby KG_is_back » Tue Jun 09, 2015 9:44 pm

To deepen the concept.
Most people are forgetting the main aspect of mathematics: Number is always a representation of something. The sign of a number represents the direction of something(for example a direction of rotation). The absolute value is the length/size of that something.

Example: "You have 5 apples and you give 2 apples to your friend. How many apples do you have?"
mathematical solution: 5-2=3
the 5 and 3 represents the amount of apples (technically it has no sign - you simply have certain amount of apples). -2 represents the change (change can be positive or negative). You solve the problem by adding the change to the amount (so what is really happening is 5+(-2) )
The absolute value of the change is 2 = the size of the change, disregarding the direction. Sign is a property, that the number technically doesn't need to have, depending on what that number represents. The absolute value of amount of 5 apples is also 5 apples (because it was an amount to start with).
Math was invented to let us (logically) operate with things, without thinking of the things themselves - all we think about is their properties of amount, length, size, direction, orientation, probability, complexity,... Numbers, with all their properties are just general representations of the properties of real things, letting us apply general concepts to them (for example, in real life adding apples is quite different from adding areas, but it's driven by identical concepts).

For me, this is the real beauty of mathematics, that for some reason most people overlook... Probably because of how mathematics is being thought at schools these days. Teachers take so much effort to teach children how to separate the math from the reality (so that they can solve similar problems in general abstract way), that they miss the link between numbers, operations and relationships and the real things they represent.

For example, the prime number. Most people know that it is "a number divisible only by 1 and by itself". What people don't know is the consequences of it in real life! Many species of insects have reproductive cycle of prime number of years, so that there is smaller likelyhood of being in sync with reproductive cycles of your predators. Thanks to that, they do not serve as a main source of food for them (predator can't rely on them to be around when he is born / at certain age).

wow :shock: I've gone quite philosophical today...
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Comparison codes for DSP module

Postby martinvicanek » Tue Jun 09, 2015 9:48 pm

int(x) rounds SSE channel 0 to the nearest integer (and leaves the other three SSE channels untouched). :o
User avatar
martinvicanek
 
Posts: 1315
Joined: Sat Jun 22, 2013 8:28 pm

Re: Comparison codes for DSP module

Postby KG_is_back » Tue Jun 09, 2015 10:11 pm

martinvicanek wrote:int(x) rounds SSE channel 0 to the nearest integer (and leaves the other three SSE channels untouched). :o


I had no idea this one even existed!!! !!!!
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Next

Return to DSP

Who is online

Users browsing this forum: No registered users and 15 guests