10-05-2009 06:19 PM
Im would like to take a moving average of 3 decimal values taken on sucessive samples. So the fourth iteration on the FPGA would average the values from the 2nd, 3rd, and 4th iterations, while the fifth iteration would be the 3rd, 4th, and 5th.
There seems to be a limitation in that only the fixed floating point data type seems supported for arrays while running on the fpga. This is understandable why. Yet, it appears many of the functions do not support fixed floating point such as "replace in array", or even summation. Other ways around this, such as using the remove and insert into array functions appear to be restricted as the array is changed size and the error "arrays must be fixed size in current target" is produced.
Thanks in Advance
10-05-2009 07:22 PM - edited 10-05-2009 07:23 PM
10-05-2009 08:39 PM
doing 4 will be just fine, especially if its easier
thanks
10-06-2009 08:48 AM
10-06-2009 09:13 AM
9237 bridge module
its analog input channel 0
10-06-2009 09:56 AM
this seem tricky.
the replace in array function will wire in fixed floating point, but it work run properly with it, ie, only 0 comes out.
the only other way i can think of of is to insert into array, but that changes the array size so it can execute on the fpga.
10-06-2009 10:29 AM
Hello Biosolutions,
Have you seen this Community Example?
FPGA Running Average Function
10-06-2009 12:14 PM
see attached image of a diagram. real simple. average code could be moved into sub-vi. sample could be averaged in with previous values on same iteration but iteration rate would be reduced. this is computing the average while the next point is being acquired.
10-08-2009 05:20 PM
a running average and moving average are very different
the moving average is over a small window.
its generally used to remove noise when not sampling at a high frequency, which is what is done in this case
10-08-2009 05:21 PM
this looks very clever.
a simplier soluition turned out to be using the fixed point math toolbox, which is free.
http://zone.ni.com/devzone/cda/tut/p/id/7781