LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Gaussian Peak Fit function problem.

Solved!
Go to solution

Hello, everybody:

 

I have a problem, which buffles me completely. I am collecting a signal from spectrometer, then use peak finder to find peaks and fit them with Gaussian curves. And this part works just fine, when I tweak initial guess. Next thing I tried is to let a user choose a peak he/she wants to fit. I basically did the same thing as before, except now it is user-defined peak positions, which are sent into Gaussian Peak Fit function. And here comes the problem: Gaussian Peak Fit function simply does not do any fitting, all it does is to generate gaussian curves located at the initial positions with initial amplitudes and initial widths. I tried everything I could think of, but to no avail. I even tried to supply the function with manually set data--it worked! But within my code it does not do anything!

 

Any ideas how this can be possible??

 

Thank you for your help!

 

Kirill

0 Kudos
Message 1 of 8
(3,674 Views)

Your description is not sufficient to tell what you are doing wrong. We need to see some code and some sample data.

0 Kudos
Message 2 of 8
(3,625 Views)

I attached the VI, which is supposed to do the job. I also attached Ne spectrum. If I manually ask to fit 702 and 724 peaks, for example, it does not do anything.

 

Hopefully, you can point me where I went wrong. Thank you in advance for all your assistance!

 

Kirill

0 Kudos
Message 3 of 8
(3,610 Views)

You did not attach anything.

0 Kudos
Message 4 of 8
(3,602 Views)

I see it, surely, somehow IE refuses to attach files. I am fighting it for half an hour now.

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

Can you see the files now?

Download All
0 Kudos
Message 6 of 8
(3,581 Views)
Solution
Accepted by topic author kzhuravlev

Please form a ready-to-run example, not some subVI. None of your controls contain typical data.

 

It seems your data has a large y offset, but your fit offset if fixed at zero. You need to change the parameter bounds and change the bounds for the offset from 0,0 to inf/-inf.

Easiets would be to right-click the "bounds" input and "create constant". Now change the to zeroes to -inf and inf respectively.

0 Kudos
Message 7 of 8
(3,567 Views)

I seems I figured the problem out on my own. I just needed to restrict bounds on parameters more.

 

Any other suggestions for improvement are still welcomed.

 

Thank you!

 

Kirill

0 Kudos
Message 8 of 8
(3,565 Views)