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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 area of peaks

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
gatordan82 Posted - 03/08/2011 : 8:14:30 PM
Origin Ver. 8 and Service Release 6:
Operating System: Windows XP (32 bit)

I am trying to find the peak intensity of two peaks in my data. I can use the pkfind function to locate the peak positions, but I need to integrate to find the area. I looked over another article in the Origin wiki

http://wiki.originlab.com/~originla/wiki/index.php?title=LabTalk:X-Functions_for_Data_Analysis

This seems to be using functions (e.g. pkarea) that are maybe outdated in my version. Is there a convenient way to integrate the area under a peak? Ideally I'd like to be able to integrate from say x1 to x2, where f(x1) and f(x2) are some small percentage (~2%) of the peak height.

Any help would be appreciated.
3   L A T E S T    R E P L I E S    (Newest First)
Sam Fang Posted - 03/11/2011 : 01:47:35 AM
It may results from that you can't define a range from a column subrange. e.g.

range garea=gpeak[$(gixl):$(gixr)]; //y range over peak limits
range xgarea=xgdata[$(gixl):$(gixr)]; //x range over peak limits


You can try the following:

range garea=spectrum[$(gixl+200-1):$(gixr+400-1)]; //y range over peak limits
range xgarea=xdata[$(gixl+200-1):$(gixr+400-1)]; //x range over peak limits

You can also use Origin's Peak Analyzer tool in the menu, which may be easier.

Sam
OriginLab Technical Services
gatordan82 Posted - 03/10/2011 : 12:19:35 PM
So I got this to work out pretty well for a single peak. My issue is that I have multiple peaks I need to integrate, so I have a new problem I guess.

I've tried restricting my code so that it searches for a peak in a range that I've set as a subset of my whole data that only does contain one peak. This works fine for finding the peak, and then the corresponding limits for the peak. But when I want to integrate this it's giving me an error about my input to the integ1 routine.

Does anybody know what my mistake might be, or a workaround?

range spectrum = col(2); //ydata
range xdata = col(1); //xdata

limit spectrum -b 200 -e 400; //restricted range with only 1 peak
g = limit.ymax; //finds peak height
gthresh = 0.02*g; //sets my footheight for the peak limits
range gpeak = spectrum[200:400]; //restricted range for y
range xgdata = xdata[200:400]; //restricted range for x
dataset gixl; //temp variables
dataset gixr;
pkfind iy:=gpeak fheight:=gthresh oleft:=gixl oright:=gixr; //find the one peak
range garea=gpeak[$(gixl):$(gixr)]; //x range over peak limits
range xgarea=xgdata[$(gixl):$(gixr)]; //y range over peak limits
integ1 iy:=garea; //integrate the area of the peak
gintens=integ1.area; //store the area of the peak

Sam Fang Posted - 03/09/2011 : 02:54:11 AM
You can use pkfind function to find the left and right base marker index for each peak. Then use integ1 to integrate and calculate the area.

You can see the Subtract Baseline and Integrate Peaks example in the page:
http://wiki.originlab.com/~originla/ltwiki/index.php?title=LabTalk:Peaks_and_Baseline#Subtract_Baseline_and_Integrate_Peaks

I test it and it can work in Origin8.0SR6.

Sam
OriginLab Technical Services

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000