LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the Nth lowest local maximum?

I have a sine wave that is being inputted. The amplitude values are being saved in a 1D array. What I want to do is find the lowest maximum peak of the wave. What I'm thinking is starting at element zero check for the highest value, until a zero crossing, and then when a zero crossing is detected save the highest point. At the next zero crossing save the highest point again and compare that highest peak to the previous one. Save the lowest one and repeat for the number of cycles that have been inputted. I'm wondering if that is the easiest way to do it, or if there is some built in features I haven't been able to find that will make it easier to accomplish.

0 Kudos
Message 1 of 4
(3,600 Views)

Do you have a sample of your data that you can post?

Sounds like you could just send it through Waveform Peak Detect and then sort the resulting amplitudes/locations.

0 Kudos
Message 2 of 4
(3,558 Views)

I don't have a sample at the moment, I can go over to the computer it is all hooked up to though and run it again to get some. The sine wave is captured in conjunction with a reference encoder, so the points are based on angle rather than time. Other than that the values look just as if you took the amplitude values of a sine wave and threw them in an array. I'll play around with the Waveform Peak Detect, and see if it will work like I would like. 

0 Kudos
Message 3 of 4
(3,555 Views)

Here's an example I've used.  It was poached from the NLFIT function example, "Sum of 3 Gaussians".

Message 4 of 4
(3,542 Views)