11-12-2015 03:00 AM
Hi all,
Many members share so nice VI's for performing moving average. But if the measurement deliver (NaN) it will be a problem in this case, specially. when
the processing of data is in a real time mode. So please can some one help me to manage that.
Here I try to do that, Its working well, but when I insert it to the real time acquisition and processing it make to much problems.
Thank you.
Solved! Go to Solution.
11-12-2015 07:30 AM
First some questions:
How do you want the NaNs to be treated? How should they be ignored or replaced? Last value, last average of n , last average of n-1 , mean/median of pre- and post (i) values or ??
What should happen if you get a series of NaNs covering the avaraging time?
Post the vi instead of a png. If we have the data we can play with it ( I 'm still running LV2012, so maybe not everyone 😉 )
The other question is: Why do you have NaNs in your Data??
11-12-2015 08:07 AM
Thanks for response,
Here is the VI, in which I collect the data of one minute in an array and then process it,
I want to do the same in real time acquisition, but I beleive I made some mistake which I couldn't figure out.
I want to set a moving average of 25 size window, within this window if NaN value exist, then it should be ignored, and continue from the previuos value.
At last , becaust this data is time dependant, in the chart the values of NaN should exists as an empty space beside the moving average values.
Thanks again.
11-12-2015 09:09 AM - edited 11-12-2015 09:19 AM
Here is my solution:
Try both replacements 😉
11-13-2015 05:46 AM
some more methods ...
what are you measuring? Just curious 😉
11-14-2015 07:15 AM
Dear Henrik_Volkers.
Appreciate your efforts, your VIs are so helpful and simple, It can acheive the required issue.
Actually I try to process data acquired from non contact temperature measurement probe, in which the temperature of some object is calculated
based on the intensity of the thermal radiation from the object . And the absolute intensity of the signal depends basically on the temperature of
the object, so if the temperature is very low or the thermal radiance from the object is blocked for any reason the probe will detect nothing and the
out put will be NaN.
I hope my explanation is clear,,
Thanks again.