LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepped Voltage Check

I have a captured waveform that needs to have the "voltage steps" quantified. See attached vi for dataset.

 

My normal procedure would be a bit tedious on this, but it may be all there is:

 

1) Find the transistions

    a) messy because the threshold varies

    b) Need to interleave and drop copies of edges detected at alternate threasholds

2) Inspect values between transistions

 

Is there some other method that could be recommended to get to these values?

~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 1 of 18
(3,588 Views)

Hello Pablop,

 

That seems to be a typical procedure for such operation. If it's possible, could you also post Edge Array VI so I could take a look at your algorithm?

 

Andy Chang
National Instruments
0 Kudos
Message 2 of 18
(3,555 Views)
This what I have so far, inlcuding the edge routine
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
Download All
0 Kudos
Message 3 of 18
(3,539 Views)

Hey Pablop,

 

Check out the Waveform Peak Detection VI. This will analyze your data, find peaks and valleys, and display their corresponding amplitudes. Sounds exactly like what you are trying to do. Check out the Help Document on the Waveform Peak Detection VI. I played around with some of the settings and found that a threshold of 1 and a width of 2500 work nicely.

 

 levels.png

 

Message Edited by BCho on 09-08-2009 03:31 PM
Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 4 of 18
(3,499 Views)
I've tried that VI before but always got lots of false peaks, I mean lots. I'll try it again and to see if I can demonstrate.
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 5 of 18
(3,488 Views)
See attache sample. I can't figure this VI out. The number of peaks is directly related to the width, but I can't find one that works. And the locations make no sense either.
~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 6 of 18
(3,483 Views)

Hey Paul,

 

One of the reasons you are getting so many false peaks is because you have a large number of data points. So, with a width of 3, you will pick up a large number of peaks. At such small widths, it seems that the number of peaks found is almost directly related to the width. This is because in relation to the number of data points you have changing the width from say 3 to 4 doesn't make a huge impact on filtering out smaller peaks that you are not concerned about. I found that a width of 1500 found all 15 peaks that I am sure you are concerned about. I also put together a little routine to highlight the location of these peaks that the Waveform Peak Detection VI found.

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 7 of 18
(3,473 Views)

Ben,

 

This is an intersting VI, but I don't understand the width selection. The typical width of a valley/peak in my sample set is around 1200. But you have to set the "width" variable above that in order to get the correct results. How does that jive with the instruction:

 

"width specifies the number of consecutive data points to use in the quadratic least squares fit. The value should be no more than about 1/2 of the half-width of the peak/valley and can be much smaller (but > 2) for noise-free data. Large widths can reduce the apparent amplitude of peaks and shift the apparent location. For noisy data, this modification is not important because the noise obscures the actual peak"

 

Also of note: Using theThreshold value has inverse effects on finding valleys verses peaks. If I set the threshold to zero, I find all of the peaks and none of the valleys. If I set the threshold to 4.5, I find all of the valleys and none of the peaks. I suppose I could work with that, but the main problem is I need to find transitions, not the centers.

 

Thanks for the demonstration though! 🙂

 

 

 

 

~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 8 of 18
(3,464 Views)

This is an intersting VI, I wish I could get a handle on how it works. It turns out that for this application, I might be able to use it. Unlike other sections of my test program, here I'm only looking for amplituders of the varius steps.

 

When I wire out the amplitudes, I get values that are close. But it's strange. As I vary the sample width from just below, to approximately equal, to just above the width of the valley/peak, I get a modulation of the amplitudes detected at just below, approximately equal to, or just above the actual amplitude.

 

I wonder if there is a way to make this beasty behave? Maybe if there was a way to plug in the actual width for each transiition?

~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 9 of 18
(3,448 Views)

Hi Pablop,

 

Do you need to have the width be dynamic for each transition?

 

Flash

National Instruments
Applications Engineer
0 Kudos
Message 10 of 18
(3,420 Views)