11-09-2015 03:51 AM
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
Solved! Go to Solution.
11-09-2015 10:12 PM
Your description is not sufficient to tell what you are doing wrong. We need to see some code and some sample data.
11-10-2015 01:09 AM - edited 11-10-2015 01:11 AM
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
11-10-2015 01:12 AM
You did not attach anything.
11-10-2015 01:13 AM
I see it, surely, somehow IE refuses to attach files. I am fighting it for half an hour now.
11-10-2015 01:20 AM
Can you see the files now?
11-10-2015 01:40 AM - edited 11-10-2015 01:42 AM
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.
11-10-2015 01:41 AM
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