LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

filtering waveform after baseline reading

Hi,

Any way to take out the first chunk of waveform data that is baseline (not zero)?  I currently have an app where pressure transducers take readings but there is always a long baseline for about 10 seconds before a sinusoidal-like signal starts, which is when I want the actual data collection to start.
0 Kudos
Message 1 of 5
(3,067 Views)
Use WDT Get Waveform Subset.vi
0 Kudos
Message 2 of 5
(3,061 Views)
The issue is that there is no fast and set rule as to when that baseline finishes or what its value is; from looking at the get waveform wdt, it looks like i need to specify time which wouldnt necessarily work for my application.

I guess what is needed is a way to detect a slope in  waveform and use that to trigger.  Please let me know if there's a way or whether I just missed the mark
0 Kudos
Message 3 of 5
(3,058 Views)
If the data follows a well defined behavior such as exponential decay or if it can be adequately modeled as something simple like a straight line, then fit a model to the beginning data. From the parameters of the fitted model determine where the start of the valid data is and extract that portion for your other analysis. Look at the linear regression VIs if a straight line will work or the Lev-Mar curve fitting for more complex shapes.

Lynn
0 Kudos
Message 4 of 5
(3,041 Views)
If you know you have about ten seconds of baseline, detection becomes much easier (you know you will always have a baseline).  These things are usually fairly specific to a particular application, but a few things you can try are:
  • Take an n point running average.  When your signal deviates by some amount from this average for x number of points, you have found the signal start.  Tune n and x based on the signals.
  • Use one of the derivative functions to find out when your signal starts to deviate from zero.  This can be difficult, because noise in your signal will cause a lot of noise in the derivative.  Possible solutions are to require two or more points above/below a certain value or to differentiate using Savitzky-Golay filters (native in LV 8.2, roll-your-own before that - search for Savitzky-Golay in these forums for lots of info).  You can also run a low-pass filter on your data before you differentiate, but this will introduce a constant time delay you will need to account for.
  • Fit the last n points to a polynomial.  When the higher coefficients get big enough, your signal has started.  This could be very flaky, but may be worth a try.  Even more difficult, but perhaps more accurate, would be to fit your data to a known starting curve (baseline plus first few points of signal).
Good luck!
0 Kudos
Message 5 of 5
(3,039 Views)