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

quick qay to perform multiple operations?

For general discussion related FlowStone

quick qay to perform multiple operations?

Postby tester » Wed May 08, 2013 12:53 am

I need to perform multiple similar operations on the fly witing a set of inputs, something like this.

If you have N inputs, and want to substract each one with everyone else, to get an array, then yoy need to perform N(N-1)/2 operations. For many inputs there would be too many simplistic blocks to work with.

But I guess there should be a way to make it faster, with some buffering/queue/multitrigger setup?

Generally the whole idea is to:
a) calculate midpoints between multiple input values (reject results if smaller than predefined x),
and b) compare these input values with calculated midpoints, and pick only these in range y (0<y<z).
It's for calculating elements of vibration and harmony.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: quick qay to perform multiple operations?

Postby tester » Wed May 08, 2013 12:48 pm

My guess is, that such circular counter will be the first step here. Something that will calculate everyone with everyone.

Second step will be probably to add some limiter, to increase the counter for one of the selectors per each iteration? Target formula: N(N-1) / 2
Attachments
step1 circular counter.fsm
(1.31 KiB) Downloaded 912 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: quick qay to perform multiple operations?

Postby tester » Wed May 08, 2013 10:13 pm

Okay, I'm stuck. Is there a quick way to substract all elements from one array any elements of that array. and exclude inv duplicates?

Like this:

if array has numbers 400, 300, 200, 100,

then

400-300
400-200
400-100

300-200
300-100

200-100

I'd like to use it for larger arrays.

Maybe no ruby, it may somehow interfere in other things going on in "living" schematics/design. Besides I'd like to do some more (similar) operations after that, and I don't understand ruby. I'd like to understand it on prims.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: quick qay to perform multiple operations?

Postby tester » Wed May 08, 2013 11:13 pm

Hmm... Like this? Two last must be triggered separately. (works in second re-click, must find out where afterload is required)

//edit:

I don't know if this can be done without initial recalc. see updated version
Attachments
combi-updated.fsm
(615 Bytes) Downloaded 919 times
combi.fsm
(573 Bytes) Downloaded 931 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: quick qay to perform multiple operations?

Postby Jay » Thu May 09, 2013 2:29 am

it works if you add a little trigger delay onto the after load like below! don't know if that suits your needs m8

combi-updated + trigdelay.fsm
(924 Bytes) Downloaded 1003 times


Best Regards
Jay
 
Posts: 276
Joined: Tue Jul 13, 2010 5:42 pm

Re: quick qay to perform multiple operations?

Postby Tronic » Thu May 09, 2013 2:40 am

tester wrote:Okay, I'm stuck. Is there a quick way to substract all elements from one array any elements of that array. and exclude inv duplicates?

Like this:

if array has numbers 400, 300, 200, 100,

then

400-300
400-200
400-100

300-200
300-100

200-100

I'd like to use it for larger arrays.

Maybe no ruby, it may somehow interfere in other things going on in "living" schematics/design. Besides I'd like to do some more (similar) operations after that, and I don't understand ruby. I'd like to understand it on prims.


I do not know if I understand correctly what you want to do, but I hope this is.
Subtract_Array_Iterator_(Tronic).fsm
(888 Bytes) Downloaded 896 times
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: quick qay to perform multiple operations?

Postby Tronic » Thu May 09, 2013 10:20 am

New module, recursive mode , infinite length arrays, and two options result, ordered, or sorted.
Attachments
Subtract_Array_Iterator_Recursive_[Sorted]_&_[Orderd]_(Tronic).fsm
(2.98 KiB) Downloaded 913 times
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: quick qay to perform multiple operations?

Postby tester » Thu May 09, 2013 12:33 pm

Thanks for responses. Jay - what for the delay there if it works without it? I rather meant to avoid a calculation on startup. Tronic - I dig deeper later into your schematic, to learn something new.

Meanwhile I made a small optimization and with example. And by the way - sorry for confusion; I was talking about substracting, while I was focused on midpoints.

The concept I'm working on is related to calculating resonances and harmony, and pointing references. So here is what I've done for now. General step 1: calculate all possible midpoints between incoming frequencies, and General step 2: compare all incoming frequencies with calculated midpoints.

Now - there are few things more to do. For example - filter incoming array of frequencies from zero-frequencies. Another one - to duplicate array combiner in order to get a list of synchronized descriptors. And third - filter after step 2, to elliminate values greater than pre-defined X. And fourth - to filter somewhere around midpoints smaller than pre-defined Y, to elliminate audible (strong) differential beats.

Thus, the result will end up like this.
Let say that you have 3 input frequencies: f1=200, f2=252 and f3=300.
Then - the output should tell: f2=2Hz (f1-f3).

It get's more complicated if you have bigger lists than 3, but the whole idea is to point these harmonic resonances.

Probably, there is more in the game, like comparing frequencies to harmonic intervals, in the same way.

*

In my example, I thing I need to elliminate somehow the need for using last two elements on array in a separate thread, to make dynamic (resizable) selectors.
Attachments
combi-app.fsm
(1.72 KiB) Downloaded 941 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: quick qay to perform multiple operations?

Postby Tronic » Thu May 09, 2013 7:29 pm

I hope I have understood.
:roll:
Attachments
combi-app_Iterator Recursive_(Tronic).fsm
(5.05 KiB) Downloaded 910 times
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: quick qay to perform multiple operations?

Postby tester » Thu May 09, 2013 9:33 pm

Hi Tronic,
It seems to show correct values.

From this point it get's more tricky. Let me think out loud for a few moments.

1. If input data on array equals zero, then there is still a midpoint between 0 and other inputs. But there is no sense of calculating midpoints between zero and X. So these midpoints should be removed.

Sure, input data can be filtered from zero's, but... (...few thoughts below)

2. Output (midpoints compared with input data) should be narrowed/filtered, to values greater than 0, and less than "user value" (guess it will be around 12Hz).

3. Optional (must check how it sounds). Midpoint list should be narrowed, to elliminate data, that come from similar inputs, i.e. f1-f2 should be smaller than 20Hz I guess. So if f1-f2 > "userlimit2", then don't store midpoint, or move it to a secondary list of midpoints. The reason for this is, that below 30Hz difference - differential beats become more audible, and harmonic resonance becomes a problem than benefit.

4. (...the "below" thoughts...). It's easier to calculate all sort of this stuff, but more difficult will be to combine maths with descriptor list (string array).

Let say, that the input array is made of 3 values: 200, 252 and 300.
Second input array is made of 3 strings: f1, f2 and f3.
Indexes for values and strings are constant (f1->200, f2->252,f3->300)
What changes in various projects - is the amount of values/strings (index size).

When the midpoints are calculated on values, string data would be combined with each other, like this:
"f1-f2", "f1-f3", "f2-f3".

When input values are compared to midpoint data, then string arrays will be combined like this (two arrays?):
"f1/f1-f2", "f1/f1-f3", "f1/f2-f3", f2/f1-f2", "f2/f1-f3",...

Now the filtering of values, and corresponding strings

At the end, there will be a list of values and strings, combined like this:

f2=2.00/f1-f3

And I guess some indicator, when things like f1-f3 (math this time) are less than one of these custom limits (20Hz)

I have no idea yet how I make that string associated part, but I thought maybe you have more xperience with it. Using my schemtic, I'm probably able to easy filter unwanted values and midpoints, but then I probably will stuck with associated strings/descriptors. I guess it must be done on synchronized loops. Still with me? ;-)
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Next

Return to General

Who is online

Users browsing this forum: No registered users and 83 guests