LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i measure only the valley voltages of a sine wave in labview 7 express evaluation version?

I am trying to convince my company to send me to purchase labview and send me to classes for labview.
I am trying to put together a small demo for them using the Labview 7 express evaluatin copy that I recieved.

What I am wondering is how can filter out everything besides the valley peaks on a sine wave.

What I am trying to accomplish, is create an example showing that Labview can sameple from a sine wave, read about 5 "valley" points of the wave, evaluate these based on a value that i can define, and signal pass or fail.

attached is a picture of what i have so far
Ryan

LV 7.1
0 Kudos
Message 1 of 10
(3,640 Views)
I can't tell much from your picture, and something gets lost in the translation of "valley peaks", but ...
You can use functions such as "Array Max&Min" to find the index point of the maximum and minimum values in an array of data. You can limit the array with the "Array subset" function too. Is that what you are looking for?

Les.Hammer@CompleteTest.com
0 Kudos
Message 2 of 10
(3,640 Views)
Les, I am very new to Labview so I have not yet learned that much about it. I will look over the array stuff today and see if I can figure something out, I just hope to get a good enough demo together to sway the company.
Attached is a pic to help illistrate what I mean by "valleys"
What I want is to measure 5 consecutive "valley" values indicated by the red arrow I drew in the picture. When I quickly tried using "Array Max&Min" this morning it does the same as "Negative Peak".
It appears that no matter where the sine wave is on the graph it always read what the minimum value of the sine wave is. I need it follow the actual values of the sine wave, then have it recognize that one "wave" has passed and calculate the minimum value that wave co
ntained. I need it to do this for 5 consecutive waves, then if all 5 pass signal pass.
If at any time one of the waves fails, I need it to stop the test and signal a red light.
I hope this makes sense its hard for me to explain what I want to do in the demo.
Ryan

LV 7.1
0 Kudos
Message 3 of 10
(3,640 Views)
What I would probably do is:
Use a power spectrum to determine frequency content
Find the period of the signal
Use a loop:
Use Subarray to get a one-period chunk of data
Use Array Max&Min to find the location and value of the min
Move on to the next period of data.

To get fancier, I would add some test to make sure that I wasn't starting at a min - that is, have a min at both the first and last points of my sub array. If you knew you had 10 waves, I would go for a 1 period chunk, find the MAX, and then use that as the starting index for the next one period chunk - putting the min in approximately the mddle of the subarray.

Les
0 Kudos
Message 4 of 10
(3,640 Views)
Les, I must apologize but I am getting a bit confused.
Lets start with something easier.
Lets say that I want to simulate a sine wave to run 5 waves, during the first wave I want to check the minimum amplitude, if it is less than -10 i want to move to the second wave, if it is greater than -10 i want the wave to stop and a red light to go off.
On the second wave I again want to check the minimum amplitude, if it is less than -10 I want to move to the third, etc.
Lets start with that as I am getting a bit confused with what exactly an array is/does.

Thanks
Ryan

LV 7.1
0 Kudos
Message 5 of 10
(3,640 Views)
Hi,

I built a VI using LabVIEW 7.0 that detects the valleys in a sine wave. It uses the 'Peak detector' VI that I believe is available in the evaluation version.
(Functions palette >> All Functions >> Analyze >> Signal Processing >> Time Domain >> Peak Detector)

I have attached a VI as well as the screen shots its front panel and block diagram.

I hope this helps.

Sincerely,
Feroz
Message 6 of 10
(3,640 Views)
FerozP, thanks a lot for posting that VI, that helped a lot. Your VI has given me a different approach to this demo, what I would like to do now is:
Sample a sine wave for X amount of seconds. Now if Y amount of valleys are sensed BELOW a level of Z, a green light goes off, if less than Y valleys are sensed below a level of Z a red light goes off.
I will play around with it a bit today but if anyone has any suggestions on how to do this that would be great.
Thanks again!
Ryan

LV 7.1
0 Kudos
Message 7 of 10
(3,640 Views)
I have sort of achieved what I am looking to get. Attached is a VI and a picture. I am looking to do what I did in this VI except I want to extend it to 5 "runs" instead of the 2 now (sine waves).
It works somewhat, but if the first wave fails, and the second wave passes, it signals that the test passed. I need to figure out how to signal fail if the first wave doesnt meet the threshold (say -10 for now)
Any help is appreciated.
Thanks
Ryan

LV 7.1
Download All
0 Kudos
Message 8 of 10
(3,640 Views)
Hi,

I think what you are trying to do is to logically AND the two results and negate the end result so that even if one of the results fails, the end result is fail.

I have reattached your VI, with the slight modification.

Sincerely,
Feroz
0 Kudos
Message 9 of 10
(3,640 Views)
Feroz, thank you so much that is exactly what I was trying to do. I will try and move forward with it now and finish it up, if I have more questions I will post back but for now thank you a ton!
Ryan

LV 7.1
0 Kudos
Message 10 of 10
(3,640 Views)