LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Curve fitting during daq

I would like to perform curve fitting during my data acquisition such that, as more data is collected, the curve will be more accurate. So the fit curve should be anchored at some point in time, and then update on my chart as data is collected. I would like to plot this on my chart while I'm performing the daq as a means to filter out some "noisy" incoming data, and to try to forecast an event (reach a specified voltage level).

Will this require a graph instead of a chart?

Can anyone suggest any examples of this "real-time" curve fitting?

Thanks.
0 Kudos
Message 1 of 4
(2,985 Views)
Re: graph or chart,
you pick em based on what you prefer.

I have done things like this to to some predictions based on history. You will be best served if you decide what kind function you will be fit. Simpler stuff can be handled explicitly. The more advanced would profit by using the modal analysis tools.

You have a number of other challenges here.
1) Filtering induces a phase shift. THis can be handled using a "zero-phase" shift technique (I found it on this site some yeras ago).

2) Edge effect. When you zero-phase shift, you loose resolution at the begining and end. Problem is that the "most recent end" is the end you are most interested in because you are trying to do predictions.

What do you expect your data to look like?

How fast is it coming in
?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 4
(2,985 Views)
My data is fairly linear. However, I've found that a 2nd order polynomial fit is the best. It is an increasing curve.

I am currently sampling at about 20 samples per second. This may increase a bit, but not by much. I am using a 4-point moving average to soften the spikes. It is this data that I want to fit a curve to.

Thanks for the suggestions.

Craig
0 Kudos
Message 3 of 4
(2,985 Views)
Take a look at this lib:
Least Square Polynomial Curve Fitting
Just search for it on the ni site.
The download is: "Download - General_LS.llb".
It looks as if you may modify the data VI for you DAQ and otherwise use the curve fit method.
Just a suggestion.
Good luck, Matt
0 Kudos
Message 4 of 4
(2,985 Views)