LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detailed directions on to modify the Levenberg Marquardt for a Gaussian Fit?

I have a spectroscopy data set that is composed of evenly spaced x data points and a varying y axis. I would like to find the best fit to this data and be able to determine the FWHM of a given peak and its corresponding area. Does anyone have experience is doing this? Is it possible to modify the Levenberg Marquardt fit to get Gaussian peak information? If so how, is there a clean example somewhere? So far I've had luck in being able to use property nodes to select a given region on a waveform graph and perform a fit on this area, however, I've had no luck in getting the fit to work. Thanks a bunch.

Brian
0 Kudos
Message 1 of 10
(3,711 Views)
What I did was change the formula inside the formula node in the original lev mar fit VI. this is looking for two peaks but you can see how I modified it. I had to modify all three foumula nodes that is why I sent all subvi's

hope this helps

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 10
(3,711 Views)
Thanks a bunch Joe. Unfortunately I am working with Labview 6.1 and the files were saved as 7.0. Is there a way to save them in a 6.1 format? Thanks again.

Brian
0 Kudos
Message 3 of 10
(3,711 Views)
It said that some files could not be saved for previous version so I hop you do not have any trouble in opening them. The only real thing that I did was change the formula in all the subvi's and renamed them so as not to get them mixed up with the original ones from NI.

Hope this helps

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 4 of 10
(3,711 Views)
Joe,

Once again thanks. Unfortunately, I think it is doomed, many of the subvi's are missing (mainly timing cur.vi) I'm trying to get a demo of 7.0 or 7.1 to give it a whirl and see what you did. Until NI can send me a demo, is there a resource online that could provide some more insight on how to fit data with the labview vi's as the help option provides a rather non-descript overview of the vi inputs?

Brian
0 Kudos
Message 5 of 10
(3,711 Views)
sorry about that I forgot to add it to the zip.
here it is.If you need any more subvi's let me know you will probably need to find the VI called get New coefficients.Vi all you have to do there is copy the one from the original and wire it up.If you need anything else do not hesitate to ask

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 6 of 10
(3,711 Views)
Ok, now I think I'm making some progress. I downloaded the labview 7 evaluation but unfortunately it won't let you look at the Block Diagram...however, when I load it in 6.1 there seems to be only some minor errors that hopefully with a little explanation I can fix. I've attached a screen shot of the errors I get in 6.1. Do you think you could give a brief description of the vi or function(s) that are on your block diagram---maybe I can emulate it with 6.1 using a combination of fucntions. Well thanks again. Almost there....

Brian
0 Kudos
Message 7 of 10
(3,711 Views)
Ok another Mistake by me downconverting. this is an express vi filter. all it is doing is smoothing out the signal. Try just wiring the two broken wires together and see what happens.Let me Know what you get. You should also be able to open the block diagram in the demo version. I can do it on the demo version here.

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 8 of 10
(3,711 Views)
I've re-installed the demo version and I still cannot view the block diagram. When I re-wire the diagram I get an error saying that the equation cannot be solved. The matrix is singular. Not exactly sure what that means. So it seems as though all of the code is quite complicated--I'm not sure exactly what you are doing with the intial coefficients. Is there an easy way to fit a curve to a set of x-y pairs. Well I'll keep plugging away at it. Cheers,

Brian
0 Kudos
Message 9 of 10
(3,711 Views)
Well I looked at your post again and seen that ou are wanting to use the Lev mar and i am using the nonlinear lev mar but you can still look my code. as I said earlier is expecting two peaks, that is the cause for the error. And as i said earlier really all you have to do is change the formula in each of the subvi's to the formula that you want to use to do the fit.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 10 of 10
(3,711 Views)