LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does parallel for loop effect iteration terminal

Again assuming we just want to average a set of ROIs over z, here's what might work:

 

altenbach_0-1696526458568.png

 

(Note that adding arrays in a shift register is a known transform and allowed in a parallel loop)

 

0 Kudos
Message 21 of 25
(942 Views)

It is as stated indeed a s(u)implified version of the snippet I uploaded a few posts earlier. The heavy lifting is indeed a placeholder for the Magnitude/Frequency calculation from the 'Advanced Signal Processing Toolkit' that is happenin in the real code. The importance of a well designed minimal example get obvious again. Thank you for all your contributions to this thread so far. My takeaway is that there is no nice way to 'autoindex-like' iterate over the second index  and third index in my specific case.

Actor Framework
0 Kudos
Message 22 of 25
(924 Views)

@Quiztus2 wrote:

It is as stated indeed a s(u)implified version of the snippet I uploaded a few posts earlier. The heavy lifting is indeed a placeholder for the Magnitude/Frequency calculation from the 'Advanced Signal Processing Toolkit' that is happenin in the real code. The importance of a well designed minimal example get obvious again. Thank you for all your contributions to this thread so far. My takeaway is that there is no nice way to 'autoindex-like' iterate over the second index  and third index in my specific case.


I still think there is a lot of slack left. For example the "detrend" function is NOT reentrant! Similarly, your FFT could be done directly, without all the detours over waveforms and cluster, etc. Especially since you seem to be only interested in exactly one point in the frequency domain, doing a full FFT seems way overkill! All you probably need is multiplication with a complex sine of the desired frequency. Since all dt's are the same (?), that sine can even be calculated before the loop. (start reading here for a simple example)

 

Shouldn't you init the unwrap phase when i=0 of the inner loop?

 

Can you strip down your full example to the code in the inner loop with a typical "extracted signal" as diagram constant so I can try a few things to see how to get the same result with significantly less effort. My guess is that we can gain an order of magnitude, but no guarantees, of course. 😄

 

0 Kudos
Message 23 of 25
(886 Views)

Thanks for your suggestions. I will compare them and come up with the results here.

Actor Framework
0 Kudos
Message 24 of 25
(834 Views)

Even the "detrend" could be done directly on the 3D array by iterating over the planes and maintaining a few planes of various sums to get a 2D array of slopes and intercepts to be applied to the 3D array for correction.

0 Kudos
Message 25 of 25
(811 Views)