01-10-2006 12:40 PM
01-10-2006 12:56 PM - edited 01-10-2006 12:56 PM
Message Edited by Darren on 01-10-2006 12:56 PM
01-10-2006 01:00 PM
HI,
Use a shift register to hold the "running sum". Use the "i" from the for loop for i [what you were calling y(i)]. Wire the array x(i) into the for loop. If you right click the tunnel that is created when you wire the x(i) array to the loop edge you will see Enabale Indexing (which will be chaecked if you wire to a for loop, and unchecked if you wire to a while loop). If indexing is enabled, LV will grab one point from the array each iteration, and when theend of the array happens, the for loop will autostop (no need to wire to the big blue N).
01-10-2006 01:03 PM
01-10-2006 01:31 PM
Thank you very much to all who replied. Your recommendations were just what I needed, allowing me to compute the "mean frequency" of a power spectrum:
sum(i=0..N-1) { i*P(i) }
mean Freq = df * ------------------------
sum(i=0..N-1){ P(i)}