10-18-2007 03:05 PM
10-18-2007 03:12 PM
10-18-2007 03:54 PM
Lynn,
I was wrong about "screwing up polymorphism". It seems that I was dividing by 0 on the first iteration,because an increment function hadn't wired (just looked wired on top of the wire). Now, however, I am getting null arrays from the shift register. I initialize the register, but aways get a null array. What gives with that? Jonathan
10-18-2007 03:59 PM
10-18-2007 05:03 PM
10-19-2007 08:33 AM
10-19-2007 09:36 AM
One additional small tip for your "cumulative mean" calculation. You can rewrite your calculation to do just 1 divide operation instead of 2. It may not matter much unless your arrays are approach a Meg or more, but is something to keep in mind for a rainy day...
rewrite as: [ (most recent array) + i*(previous averaged array from shift register) ] / (i+1)
-Kevin P.
10-19-2007 10:02 AM - edited 10-19-2007 10:02 AM
@Kevin Price wrote:
rewrite as: [ (most recent array) + i*(previous averaged array from shift register) ] / (i+1)
Or even simpler, accumulate the summed array and just divide but i+1. If you are using floating point numbers, it is NOT worth to accumulate the averaged array, because you cannot run out of bits. (Even with integer arrays, you should just add, because the divisions will bias your averaging. Just make sure you are using a representation with sufficient number of bits. If your data is I16, accumulate in a I32 or I64, depending on the total number of averages you are trying to do).
averaged array=(most revent array +sum of all previous arrays)/(i+1)
Here's a quick example (LabVIEW 8.0).
Message Edited by altenbach on 10-19-2007 08:03 AM