Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear fit

Hi people.   How i make a VI with Linear Fit running in real-time?

Icaro Kossmann
LabVIEW 8.6 Newbie.
Brazil
0 Kudos
Message 1 of 8
(5,497 Views)

Icaro Kossmann,

 

Please be specific about what you mean by "real-time." Are you running LV on one of the NI provided real-time OSes? Are you running on an FPGA? Or does "real-time" simply mean that it keeps up with what a human operator can observe?

 

How many data points are you trying to fit?

 

Some of the fitting routines have been improved substantially since LV 8.6. A 1000 point data set can be fit in ~40 us on a recent version of LV.  For 100000 points it takes about 2.5 ms.

 

Lynn

0 Kudos
Message 2 of 8
(5,490 Views)

(in some cases) a linear fit can be done with a FIR filter 🙂

So samplerate (&looptime) , number of points, kind of fit???

FPGAs can do FIR filter very fast 😄

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 3 of 8
(5,481 Views)

So, this is my job: want to continously do a linear fit over acquired data sets that has to be able to keep up with the incoming data. I will acquire temperature in max 40 minutes, and i want to make a linear fit with each new temperature value durig acquisition. In real time.

Icaro Kossmann
LabVIEW 8.6 Newbie.
Brazil
0 Kudos
Message 4 of 8
(5,477 Views)

And build equation in real time

Icaro Kossmann
LabVIEW 8.6 Newbie.
Brazil
0 Kudos
Message 5 of 8
(5,476 Views)

If you are working with temperature over a 40 minute time scale, you should have no problem doing a linear fit as you acquire the data. As I pointed out before fitting the numbers of points you would likely have takes only a small fraction of a second.

 

Lynn

0 Kudos
Message 6 of 8
(5,464 Views)

So, i got it :), but my next problem is build and show de equation from the data collected. Exist a VI for this?

Icaro Kossmann
LabVIEW 8.6 Newbie.
Brazil
0 Kudos
Message 7 of 8
(5,461 Views)

I am not sure about LV 8.6 -  that is pretty old. In the newer versions of LV the Linear Fit VI has slope and intercept outputs. Those are the coefficients needed for the standard equation of a line of the form y = m*x + b.

 

The fit VI also has an array of points of the values of y for each of the values of x in the input array. This can be used to plot a line of the fit without any extra work.

 

Lynn

0 Kudos
Message 8 of 8
(5,454 Views)