LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I measure the level of a flat region in an anlog signal

Hi. Thanks for the reply. Yes, this has to happen live. The signal is generally repeating. I will try to recode my vi to filter out the 'flat' regions which are out of the (max-min)/2 +min range.
0 Kudos
Message 11 of 19
(1,761 Views)

Oh, here's another idea we used in some analysis...

 

Calculate the linear fit of a stretch of data, as well as the confidence interval of the slope of the linear fit.  If the confidence interval includes zero, you have a flat section.  Again, the # of data pts used in the fit acts like a filter.  The advantage to this technique is insensitivity to the actual values seen and tolerates noise fairly well.  The downside is more calculations, though with some wizardry, it may be possible to do a pt-by-pt calculation of that confidence inteval.

Message 12 of 19
(1,751 Views)

Hi

 

I have attempted to implement some of your suggestions, with limited success. 

 

I have attached a vi which (roughly) simulates my signal.  I have tried to use the linear fit to determine the zero point. This works quite well, but still suffers from some small variations in the zero point. Is there a way to minimise these? By using an average perhaps?

 

I have also tried to use two other methods; filtering and differentiation. Neither of these work well on this simulated signal, although the differentiation method works OK on the actual signal.

 

Do you have any idea how I could increase the performance of the linear fit method (or the differentiation)?

 

Many thanks

 

John
0 Kudos
Message 13 of 19
(1,729 Views)

Actually, reducing the noise control greatly improves the performance of the 'linear' method. However, this noise was an attempt to simulate the overshoot seen in the actual signal. I will test the linear method this afternoon.

 

John

0 Kudos
Message 14 of 19
(1,728 Views)
 
- there is always an easy way, but it is always the hardest to find
0 Kudos
Message 15 of 19
(1,726 Views)

What I menat to put but did not show was:

 

Is it possible to eliminate the dc shift on the hardware side of things, ie a capacitor across the analog input 

- there is always an easy way, but it is always the hardest to find
0 Kudos
Message 16 of 19
(1,722 Views)

Beaton wrote:

What I menat to put but did not show was:

 

Is it possible to eliminate the dc shift on the hardware side of things, ie a capacitor across the analog input 


I don't think that would work because the OP is dealing with pulses that (if his original diagram is correct) have a huge mean shift.  In other words, because the vibration isn't symmetric around some zero point, applying a capacitor would only act as a low frequency filter and not get him his zero value.

0 Kudos
Message 17 of 19
(1,700 Views)

eichlerjw wrote:

Actually, reducing the noise control greatly improves the performance of the 'linear' method. However, this noise was an attempt to simulate the overshoot seen in the actual signal. I will test the linear method this afternoon.

 

John


I reviewed your code.  As far as I can tell, none of the library VIs offer something exactly like how my group finds (in Matlab) the confidence interval for the slope of a linear prediction.  I then reviewed the signal analysis palatte since NI seems to have every detection method known to mankind.  Smiley Happy  Without more details of your imput signal, I'm not sure this will work but....

 

The "Pulse Measurements VI" will deal nicely with pulsed input on a single channel, especially if you have a low duty cycle.

 

Using the NI-provided example, I tweaked the settings and produced what I think is the correct Low reference value (the bottom red line in graph).  I'm assuming that you likely have some control over the timing of your inputs to the UUT (or can at least assume they don't overlap in the time domain).  The first key setting was the histogram method of detecting thresholds which should deal with any signal offset.  Adjust histogram size for your event region; I'm thinking it should actually cover multiple pulses to be robust.  Also, specify if the expected pulse is low or high (positive or negative from the true zero line).  The measurement info wire from the VI will give you all 3 detected reference levels.

 

 

0 Kudos
Message 18 of 19
(1,698 Views)

Many thanks!

 

I'll try to test this vi asap. 

 

J

0 Kudos
Message 19 of 19
(1,685 Views)