LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform averaging

I am trying to average a waveform toneburst and ultrasonic reponse waveform in each sucessive iteration in order to average out any noise in the signal.  I am using the Formula Express VI to sum the new waveform with the summation of the previous waveforms aquired using the feedback loop.  Then the result is divided by the iteration loop number to get the average.  However, the VI is not doing what I think it is.  The result is not a waveform toneburst but a flat line response.  Should I be using another VI?  Any help would be greatly appreciated.  Thanks.
0 Kudos
Message 1 of 32
(4,859 Views)

Hi jtd30,

 

what about using a simple add function followed by a divide? Simple as it is...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 32
(4,853 Views)
Unfortunately, I'm trying that now but it doesn't seem to be working right.
0 Kudos
Message 3 of 32
(4,820 Views)

Hi jtd,

 

can you attach what you have done so far? What exactly "doesn't seem to be ... right"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 32
(4,808 Views)

Here is a copy of my vi.  Channel 0 is the one in question.  Channel 1 is not functioning at this time.  Once Channel 0 works, I'll apply the same logic to channel 1.  When you run the vi the actual toneburst is correct.  However, the averaged waveforms are not correct.  Channel 0 is out of phase with the generated toneburst but it is the same signal only averaged.  Also, the amplitude varies greatly in the averaged signal, which is not correct either.  Now I'm thinking it has something to do with the way I dis-assembled and reassembl;ed the wavefrom components and the time stamp function.  Yo help is greatly appreciated.

 

Jeff

0 Kudos
Message 5 of 32
(4,768 Views)
Instead of using formula nodes, I would recommend just using add and divide nodes and do the entire operation as an array.  I can't get your code to work because I don't have the FGEN libraries on this PC (and I don't feel like spending six hours trying to justify adding them to the IT manager).  You could also use probes and/or plots to see if it is doing what you think it should.
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 6 of 32
(4,760 Views)
Thanks for the help but unfortunately I get the same results whether I use the add divide nodes or the formula nodes.
0 Kudos
Message 7 of 32
(4,758 Views)
OK, but what do you see on the probes/plots?  And are your arrays all the same size?
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 8 of 32
(4,753 Views)

I will now begin to show my ignorance as I am learning this stuff on the fly and I am not sure exactly what you're asking.  The plot of the waveform component shows the same erroneous results as the waveform graph.  As far as the array size goes for the waveform, isn't the dt a single value and the t0 a single value timestamp?  However, all of the array sizes for the y value of the waveform are the correct size.

0 Kudos
Message 9 of 32
(4,737 Views)

Look up "probe" in the help and it will tell you how to see the data during execution at different points.  I was also thinking it would be a good idea to plot the data, so I would put a temporary plot after the add.  As for the array sizes, for each of the wires going to the add node, hook up an array size node and put an indicator on the output of the array size.  If they aren't the same size -- that's the problem.  Array size can be found in the upper left corner of the array functions.

 

And the dt, etc., is not what I was referring to.  So see if you can figure it out from there and let me know if you need more help.

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 10 of 32
(4,735 Views)