The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Gaussian peaks from maxima only
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Hydrag

Germany
8 Posts

Posted - 12/21/2021 :  06:18:00 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I am currently trying to compare data given in literature to mine.
Problem is, the author only extracted the maximum values.
So I have a table, that I typed into Origin where x = Position and
y = Height.

I can draw it a diagram with vertical anchor points and delete the capping points. That way I have vertical lines where a maximum is and they have the correct height as well.

No I'd love to turn these into Gaussian peaks with a certain FWHM, at best they should also overlap if they are close or form a baseline. That way I can run it through our database as well and fit the data, which crashes the software if I try to do it with vertical lines only.

Is there any way to create these new points in Origin?

Best Regards

YimingChen

1609 Posts

Posted - 12/21/2021 :  08:55:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
If you have the Gaussian Peak parameters like position, width and height, you can use Set Column Values to simulate the peaks. See the example of simulating two peaks below and also check the page on nlf_gaussian() function.
https://www.originlab.com/doc/origin-help/gaussian-function-fitfunc


James
Go to Top of Page

Hydrag

Germany
8 Posts

Posted - 12/22/2021 :  06:36:53 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you for the quick reply.

That would indeed work but I have quite a number of points.
So I'd have to generate a column A with numbers running from
0-50 (in my case) with 0.01 steps.

My column B = x-Position of the peak and column C = y-Position.
Hence the code would look something like:

nlf_Gaussian(A,B1,C1,0.1) + nlf_Gaussian(A,B2,C2,0.1) + ... + nlf_Gaussin(A,B31,C31,0.1)

So I'd either have to type that in manually or there is way to let that run via a sum that keeps A and 0.1 but changes Bn+1 and Cn+1 at the same time every step. Does that work somehow or is there another way to do this for my case?

Thank you and Best Regards.
Go to Top of Page

YimingChen

1609 Posts

Posted - 12/22/2021 :  10:01:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Then you will need LabTalk script, see below

function dataset simulate(dataset ds1) 
{
   dataset ds2;
   ds2.SetSize(ds1.GetSize());
   range rx = col(B);
   range ry = col(C);
   for (int i = 1; i <= rx.GetSize(); i++) 
   {
      ds2 += nlf_gaussian(ds1, 0, rx[i], ry[i], 0.5);
   }
   return ds2;
}



James
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000