LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

curve fitting

Our application uses a lock-in amp, implemented in LabVIEW, to extract our signal. I would like to fit this data to a rather complicated function. Unfortunately I don't have much experience with LabVIEW and so this is proving a little hard. Are there any good resources with information relating to this that people know of? Would it be best to export the data to something like Matlab and do the fitting there?
Cheers.
0 Kudos
Message 1 of 7
(3,796 Views)
LabVIEW can probably do all the fitting you need. What is the function? How many fitting parameters?
 
All the fitting tools have been significantly improved with LabVIEW version 8.0, so it would be important to know what version you have? 🙂
0 Kudos
Message 2 of 7
(3,793 Views)
Have version 8. The function is (long):
(-a*(2/b)*2+(-((2+b^2)-2*((x-c)/d)^2)*sqrt(sqrt(((sqrt(1+b^2))^2-((x-c)/d)^2)^2+4*((x-c)/d)^2)+((sqrt(1+b^2))^2-((x-c)/d)^2))+(-4*((x-c)/d)*((x-c)/d)/abs(((x-c)/d)))*sqrt(sqrt(((sqrt(1+b^2))^2-((x-c)/d)^2)^2+4*((x-c)/d)^2)-((sqrt(1+b^2))^2-((x-c)/d)^2)))/(sqrt(2)*sqrt(((sqrt(1+b^2))^2-((x-c)/d)^2)^2+4*((x-c)/d)^2)))^2

fitting parameters: a,b,c, and d.
I have tried the curve fitting express vi without much luck, but that could be the partly data. It also takes a long time.


0 Kudos
Message 3 of 7
(3,782 Views)

Yes, the express VI might be a bit slow. Personally, I almost exclusively use the "VI model" of the "Nonlinear Curve Fit.vi" (in the "Math...Fitting" Palette).

Just glancing at your formula, you should be very careful chosing the initial parameter estimates because you divide by some of the parameters. For example if you would use initial estimates of zero, the function would blow up. What are typical values for a, b, c, and d?

Use the same model VI to display the initial estimate function overlayed over your data to see if your guess is reasonable or very far off.

Maybe I have time to look at this a bit more in a few days. Let me know if you get stuck!

0 Kudos
Message 4 of 7
(3,765 Views)
Thanks for your help. It is appreciated.
This being my first time using LabVIEW my problem is not knowing how to give the function to the nonlinear fit vi and how to get X and Y from my dynamic data signal (as X is just time do I generate an array based on the sample speed?).
Initial guess parameters are a=0.3, b=2.2, c=0.0095, and d=0.0002.
0 Kudos
Message 5 of 7
(3,748 Views)
Hi, feijoa,
 
I create a simple VI to show how to use the non linear curve fitting VI with your model.
You need to wire your data to X and Y input.
 
It would be helpful if you can upload some real data for try.
 

帖子被DSPmchen在08-18-2006 02:55 AM时编辑过了

0 Kudos
Message 6 of 7
(3,726 Views)
Thanks DSPmchen for the VI. I appreciate the time you put in.
It's pretty much what I wanted to know. I think the fitting routine is going to be a little slow using LabVIEW but I will persist and maybe try Matlab as well (a bit more flexibility). If you are still keen on getting some data I can try up loading some.
Thanks again.
0 Kudos
Message 7 of 7
(3,667 Views)