07-09-2012 07:08 AM
Hi everyone,
My problem is as following:
With every sample I receive an array of 64 signals and I would like to build the mobile mean of each of these 64 signals.
However it is very poor to place 64 reentrant mobile mean VIs in parallel to do that (like shown in the attachment).
Therefore I am wondering if there isn't a better way to do that?
Every hint is appreciated
Benjamin
Solved! Go to Solution.
07-09-2012 07:28 AM - edited 07-09-2012 07:28 AM
07-09-2012 08:25 AM
What about auto indexing a for loop?
07-09-2012 08:33 AM
07-09-2012 09:21 AM
Gerd, you are right, a 2D array solved my problem.
Thanks!
07-09-2012 10:29 AM
GerdW wrote:that will average across all your different signals. I doubt the OP want that - as he already expressed...
you could probably get around it by making the FOR loop parallel and define 64 parallel instances. 😄
(still, I agree it would be better to make a scaleable subVI that accepts arrays directly)
07-09-2012 11:00 AM
Benjamin Button wrote:With every sample I receive an array of 64 signals and I would like to build the mobile mean of each of these 64 signals.
What does your "mobile mean" actually do? Isn't it the same as the current "Mean ptbypt" that ships with LabVIEW?
You did not show us any code, but a sloppy implementation could potentially be a real memory thrasher and it would be worth to double-check the code to make sure it is efficient.
An example of an efficient in-place implementation of the 2D version can be found here. Modify as needed.
07-10-2012 01:16 AM
Hi altenbach,
Thanks for the hint but "Mean ptbypt" will not work in my case because my Mobile mean also filters out all NaN values so that my result will never be NaN.
By the way, have you ever had a look into the Mean ptbypt VI? My code is much simpler and without strings to control the behaviour which I think is a little strange.
I have to think about an in-place structure but on the other hand I have had never any problems with that part of the code 😉