LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rolling array stack averaging

Hi, yeah, the script is a work of art, however, it doesn't seem to perform this idea of a rolling stack and average for each new array in. I feel close and fully expecting a penny drop moment in the coming days. Thanks again for your effort in helping to resolve this problem. 

0 Kudos
Message 11 of 15
(165 Views)

Here's what I had in mind (you can transpose the graphs if desired. Currently rows run along the x-axis). Near x=0, averaging is poor because of limited samples, but later all values are near 0.5 as expected.

 

altenbach_0-1638824564138.png

 

Message 12 of 15
(159 Views)

Yeah, I think you might have something here. I see didn't use tunnel indexing when I tried, so that explains where I was going wrong and my past query. I am partway through a circular buffer concept that seems to also work, but I'm going to test out your approach properly to compare. I'll report any findings to this thread to spread the knowledge. 

 

Thanks.

0 Kudos
Message 13 of 15
(149 Views)

@narra_1985 wrote:

I am partway through a circular buffer concept that seems to also work, but I'm going to test out your approach properly to compare. I'll report any findings to this thread to spread the knowledge. .


The 2D array inside my VI is a circular buffer, just implemented fully "in place" where the new data replaces the oldest, keeping track of the insert point. An average does not depend on order, so make sure not to shuffle tons of data around with each iteration.

0 Kudos
Message 14 of 15
(141 Views)

Hi Alterbach, 

 

Sorry, yes, you are quite right regarding the circular buffer. Also, I am pleased to announce that I managed to come up with the working solution last week and have been busy implementing my little project since then, so excuse me for not publishing the solution as of yet. My solution wasn't quite the same as yours, however, I definitely benefitted from our back and forth (actually you inspired me to think a bit deeper about this than I may otherwise have gone). 

 

...anyway, solution on the way...

0 Kudos
Message 15 of 15
(98 Views)