04-02-2008 12:06 PM
04-02-2008 01:35 PM
Hi Aparna,
if all your waveforms have the same dt, you can run through a for loop with indexing the array of waveforms. See the attached example. I hope this helps.
Mike
04-02-2008 09:58 PM - edited 04-02-2008 09:59 PM
Mike,
I think you had problems with your averaging functions, you were averaging each waveform with the the running average. So waveform 0 had the least weight, the last waveform had the weight of 1/2.
The attached should work better.
04-02-2008 11:43 PM
Hi Ravens,
i understand my code in this way:
i think this should work.
Mike
04-03-2008 01:07 AM
Hi Ravens,
yes you are right. Excuse me please.
Mike
08-24-2011 08:08 AM
Mike,
the math for each point in your average goes like this. Lets call x the first point in the sweep. x1 is the first point from the first waveform. x2 is the first point from the second waveform. First time through (x1+x1)/2 = x1. Good. Second time through (x1 + x2)/2 = average you want for 2 points. Good. third time through ((x1+x2)/2 + x3)/2 = does not equal an evenly weighted average. x3 is weighted more heavily than x1 and x2. You algorithm does an average of sorts but weights some waveforms more than others. The other commenter had it right where you add all the waveforms together and divide by the N of the for loop.
08-24-2011 08:09 AM
Sorry I thought Ravens was admitting Mike was right on this chain. Ravens is right.
06-28-2012 06:42 PM
Hi,
I had a question. If I have let's say 10 waveforms, can't I store it in an array and then find the mean of it. I dont really understand the use of registers.
06-28-2012 09:13 PM
@robotica
If I understand right, you're suggesting dumping ALL the waveform data together into a single array, then taking the mean.
This would essentially produce the average value of any given individual point in all the waveforms. In other words, you stick in a ton of waveforms and get out a single scalar value - say, 5.3 or whatever.
What the original question asked was how to get the average point at each timestamp, or the "average WAVEFORM" not the "average VALUE."
Let me know if that clears things up or if you were suggesting a different solution.
06-28-2012 11:18 PM
No... I wanted to find the average waveform.. sorry for the misunderstanding......
i was asking if it is possible to make an array of the waveforms and then find the average of those waveforms.
Since the method suggested earlier was a bit lengthy and I couldn't figure out how it was being solved using the method suggested earlier...