LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding Valleys for Absolute Sine Wave

Solved!
Go to solution

I have an absolute sine wave and I am using the Waveform Peak Detection function to find the peaks an valleys. The detection at the peaks works well but valley detection is returning an empty array. I suspect that it is because the sharpness of the valleys. I am struggling to think of a solution for this.Labview Help Valley Detection.PNG

0 Kudos
Message 1 of 6
(1,436 Views)
Could you attach your code and sample data here? You can set sample data by allowing the graph to populate, select it, then select Edit >> Make current values default.
0 Kudos
Message 2 of 6
(1,433 Views)

🤔 The sharpness of the valleys should make them even easier to detect. 

 

There's not much point in guessing what could be wrong though.  If you want some help, post your code...  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 3 of 6
(1,426 Views)

I generated some similar looking curves, and it works fine for me:

Capture.PNG

0 Kudos
Message 4 of 6
(1,423 Views)

Here is the code, the graph shown was plotted after the first peak detect and before the Butterworth filter

Message 5 of 6
(1,415 Views)
Solution
Accepted by topic author hylian_marq
You are using the default threshold of "0" for your valley detector. Since your signal never goes below 0, you won't detect any valleys. If you set it to "0.1" you will detect them.
0 Kudos
Message 6 of 6
(1,386 Views)