02-02-2015 03:24 AM
Dea all,
I am looking for a multi channel running average function (or VI) that i can adjust to an arbitrary but fixed number of channels.
I attached an example of a 5 channel running average which technically does the job. however, scaling it to bigger numbers of channels (lets say, 50) is surely not good practice. do you have any suggestions?
Thank you!
and by the way, what change does this VI need so I could adjust the sample length while running the VI?
Solved! Go to Solution.
02-02-2015 04:22 AM
hi
how about doing like this?
02-02-2015 04:28 AM
Hi syrpimp,
putting the PtByPt-Mean in a loop doesn't make it aware of multiple channel data! Infact your example will mix up the values of different channels heavily!
@OPCer:
You can look into the PtByPt-Mean function and study it's internal behaviour. After you have done so you can create a similar VI which takes a 1D array (holding the new values for your channels) as input…
02-02-2015 05:03 AM - edited 02-02-2015 05:04 AM
@syrpimp: yes, that was the first thing i tried, but as GerdW writes, it mixes the channels, so it does not work at all!
02-03-2015 04:50 AM - edited 02-03-2015 04:51 AM
Hey,
please have a look at this Forum post as I think it is exactly what you need:
http://forums.ni.com/t5/LabVIEW/averaging-rows-in-an-array/td-p/507204
You simply need to use the AxB function which multiplies an array with a vector which is much more efficient and scalable.
I modified the VI that you can find in the other forum post. Now it calculates mean values for each channel:
Regards
Christian
02-06-2015 02:51 AM - edited 02-06-2015 03:03 AM
Hey Christian-P,
thanks for the suggestion. i see the point in matrix multiplication. Just like GerdW's answer it will takr me some time to fit it to my real-time apllication.
@GerdW:
i think you Idea is the closest what i am trying to do. now, when looking into the Mean PtByPt.vi i find everything except the cases is unclickable. this is qite annoying for investigating this VI - do you know how i could get a copy from it that i can modify? or do i have to rebuild it manually?
02-06-2015 04:00 AM - edited 02-06-2015 04:01 AM
@GerdW
forget my upper post 🙂 i resolved that part.
Id like to stress the detail about the real time sample length of the initial post: how can i adjus the sample length when the VI is running? up to now, i have to restart the VI for the new sample length to take effect.
02-09-2015 03:17 AM - edited 02-09-2015 03:21 AM
I made my own multi channel running average, based on what i found in the PtByPt mean VI as suggested by GerdW, but with the matrix multiplication. It has not all the functionality as the original PtByPt, but it works like a charmfor an arbitrary number of parallel channels and sample length. I attached also the runAxB.vi that feeds a random input and provides a graph of original and averaged data.
still, could i change the sample length while running the VI?