LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Peaks and valleys detection of a zig-zag shape waveform

Hi,

I have 2 waveforms coming in and I would like to detect the peaks and valleys(with the location, or ) and write them to a spreadsheet file. 

In a pattern like this


peak #1(waveform 1)            peak #1(waveform 2)                  Location of peak#1(waveform 1)              Location of peak #1(waveform 2)   
valley #1(waveform 1)           valley #1(waveform 2)                Location of valley#1(waveform 1)             Locationo of valley#1(waveform 2)
peak #2(waveform 1)            peak #2(waveform 2)                  Location of peak#2(waveform 1)              Location of peak #2(waveform 2)
valley #2(waveform 1)           valley#2(waveform 2)                  Location of valley#2(waveform 1)            Location of valley #2(waveform 2)
.                                              .                                                                  ..............                                                     ...............
.
.
.
  The waveforms come in with varing heights, kind of like a wiggling zig zag shape.  Sometimes the peaks/valleys are very smooth and kind of hard to differentiate from the others. 


Thanks.

0 Kudos
Message 1 of 4
(3,184 Views)
If you search the forums for peak detect, you will find a number of hits.  Also, here is a recent thread discussin peak detection without setting a pulse width.

Basically, you want to use the peak detection.vi located in Signal Processing > Signal Operation.  That will find your peaks and valleys.

In order to put all of this into Excel/Spreadsheet (do you have / want to use the Excel Toolkit or just the Write to Spreadsheet.vi?), you will need to  feed all of your points into a build array and a shift register and then when you are done aquiring data, feed that into the Write to spreadsheet.vi or to a vi for excel.

The formating will depend on how you feed the data into your array, ie wave 1, location 1 or wave 1 , wave 2, etc

Kenny
Kenny

Message 2 of 4
(3,182 Views)
Does the peak detect vi only detect peaks or valleys or it can do both at the same time?
0 Kudos
Message 3 of 4
(3,167 Views)

It can detect both peaks and valleys, but only one at a time.  So you will need one instance for detecting peaks and another for detecting the valleys.

 

Kenny

Kenny

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