LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peak detection & averaging in dynamic data

Solved!
Go to solution

 

hello?

I have a few questions. Can you help me?

I am a Labview beginner.

I'm acquiring data with an NI USB-5133 device.

1) First, I want to display the average signal obtained through the equipment on a waveform graph. If I change the number in the Averaging panel to 10, can I get only 1 signal to come out as the average of 10 signals?

 

2) When the averaged signal appears above, I want to find the highest peak point(just one point) in the x-axis cursor (m_st, m_ed) in the waveform graph and find the time axis value of that peak point.

I think the averaged signal and peak detection should be linked.

frontpanel.PNG

block diagram.PNG

  

Download All
0 Kudos
Message 1 of 10
(1,131 Views)

The term "dynamic data" has a very special meaning in LabVIEW, and except for two short wires, you don't have dynamic data, so you are probably talking about something else.

 

Converting a 2D array to dynamic data and back to a 1D array is NOT reasonable code and I seriously doubt that it does what you think it does.

 

Assuming that the traces are aligned across iterations of the FOR loop (are they?), you probably want to accumulate the data in a shift register, then divide by N at the end. You don't need any dynamic data anywhere.

 

 

0 Kudos
Message 2 of 10
(1,087 Views)
Solution
Accepted by topic author hurang

@altenbach wrote:

Assuming that the traces are aligned across iterations of the FOR loop (are they?), you probably want to accumulate the data in a shift register, then divide by N ant the end. You don't need any dynamic data anywhere.


Here's a quick skeleton how to do that:

 

altenbach_0-1705534902569.png

 

0 Kudos
Message 3 of 10
(1,083 Views)

Thank you so much! Thanks to this, averaging was solved.


How do I detect the highest peak point (just one) between 1 and 2 of the waveform graph x-axis cursor and find the time of the highest peak point?

0 Kudos
Message 4 of 10
(1,066 Views)

@hurang wrote:

How do I detect the highest peak point (just one) between 1 and 2 of the waveform graph x-axis cursor and find the time of the highest peak point?


In the absence of noise, all you need is "array max". If you would use cursors locked to the plot, you could use the "cursor index" property to easily get the subset between the two and calculate the actual time from the max index.

0 Kudos
Message 5 of 10
(1,051 Views)

I'm a beginner at Labview so it's hard to understand in writing.
Could you please fix it in my vi?

thank you!!

0 Kudos
Message 6 of 10
(1,028 Views)

See if this can give you some ideas....

 

(probably needs a few tweaks, depending on if you want include or exclude the cursor positions from the max search, etc.)

 

altenbach_0-1705563730557.png

 

Message 7 of 10
(1,011 Views)

thank you! Thanks to you, I now know how to configure it.
However, I implemented it in my program, but it does not work because it does not receive the cursor index value.
I want to find the peak value between the x-axis cursors in a graph with averaging and interpolation applied.
Can you help me solve the problem?

0 Kudos
Message 8 of 10
(966 Views)
Solution
Accepted by topic author hurang

As I already mentioned, all  the cursors need to be set to locked to the plot. Free dragging cursors (the default) can be anywhere, even between points), so an index makes no sense..

 

altenbach_0-1705593725705.png

 

0 Kudos
Message 9 of 10
(933 Views)
 

Thank you so much!!

Everything has been resolved.

Thank you for helping me. 

0 Kudos
Message 10 of 10
(917 Views)