LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Non-linear fitting in LabVIEW 5.0

I want to fit a Lorentzian to resonance data from a Network Analyzer. Despite my best attempts over the past year, I cannot seem to get adequate fits using the standard LV Lev-Mar VI; either the algorithim converges with too large a value of chi-squared or it doesn't converge at all. When I use the exact same function and initial parameters with IGOR pro, the convergence and results are excellent. I have tried everything I can think of but can not seem to improve LabVIEW's performance, yet I read on this website several reports of LabVIEW curve-fitting to Lorentzians really well. What am I missing or doing wrong?

Thanks
0 Kudos
Message 1 of 3
(2,858 Views)
Please attach your VI for better support. I'd be interested in seeing the parameters you set.
0 Kudos
Message 2 of 3
(2,858 Views)
Attached is a library containg the VIs I have written in an attempt to fit to the magnitude of the S11 (reflection) scattering parameter as a function of frequency. I am measuring two to three resonances of a microwave cavity. The signal, S11, is the ratio of incident voltage to reflected voltage - at resonance this is a minimum. There are four fit parameters: resonant frequency (location of minimum, typically ~ 460 MHz and 6.8 GHz); quality factor (ratio of frequency to width, typically ~ 800 and 300); coupling parameter (related to depth of resonance, typically ~ 0.018 and 1); and attenuation parameter (related to off-resonance value of S11). In the VI library are two modified "Non-linear Lev-Mar fit.vi" which are identical except that one uses the standa
rd CIN to estimate the new parameters and the other uses a specific VI written by me for this particular function. They seem to have the exact same performance; I can get neither to work well. I have tried changing the convergence criterion (change in chisqd) from 0.001 to 0.000001, but this seemed to have no effect. Finally, below is the Igor Pro code defining the function I am fitting to, which, when used with the standard Igor curve-fitting routines, works very well. Thanks.

Function MagnS11(w,x)
Wave w; Variable x // w = (f, Q, beta, alphaL)

variable atten = -2*w[3]
variable epsilon = 2*(x-w[0])/w[0]
variable epsilonQsqd = (epsilon*w[1])^2
variable numerator = (1-w[2])^2+epsilonQsqd
variable denominator = (1+w[2])^2+epsilonQsqd

return exp(atten)*sqrt(numerator/denominator)

End
0 Kudos
Message 3 of 3
(2,858 Views)