LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stepped signal analysis

how to count the number of steps(red signal on graph) on the diagram below?

number of steps should be counted in the rising and falling signal and make a comparison between them.

 

how this can be done?

0 Kudos
Message 1 of 2
(2,098 Views)

There are probably lots of ways.  Your diagram has a hint for one of them.  Here are a couple of options:

 

  1. Use a Savitzky-Golay filter to take the derivative of the waveform.  You will end up with a bunch of peaks and valleys.  Find the peaks with a peak finder and count them.  You can figure out up/down by looking at the area between the peaks and get an average level or by looking at the direction of the peaks (up is up, down is down).  You data is fairly noisy, so you will have to experiment with how wide you want the S-G filter to be and how much averaging you want to do between the peaks.
  2. Use a single cycle square wave as a convolution filter and run it.  The end result will be similar to the Savitzky-Golay filter and can be analyzed the same way.  This is probably easier and faster on some targets, such as an FPGA.

Good luck.  Let us know if you need more help.

0 Kudos
Message 2 of 2
(2,070 Views)