PFM Manual

download PFM Manual

of 124

Transcript of PFM Manual

  • 7/28/2019 PFM Manual

    1/124

    Peak Fitting Module

    TM

    PFM

    OriginLab Corporation

  • 7/28/2019 PFM Manual

    2/124

    Copyright 2003 by OriginLab Corporation

    All rights reserved. No part of the contents of this book may be reproduced or transmitted in any formor by any means without the written permission of OriginLab Corporation.

    OriginLab, Origin, and LabTalk are either registered trademarks or trademarks of OriginLabCorporation. Other product and company names mentioned herein may be the trademarks of their respective owners.

    OriginLab CorporationOne Roundhouse Plaza

    Northampton, MA 01060USA(413) 586-2013(800) 969-7720Fax (413) 585-0126www.OriginLab.com

  • 7/28/2019 PFM Manual

    3/124

    Peak Fitting Module Contents iii

    Contents

    Installing the PFM and Getting Started 1 Installing the PFM......................................................................................................................1 Uninstalling the PFM.................................................................................................................2 Entering a Peak Fitting Session..................................................................................................3 Getting Started Using the Wizard ..............................................................................................3

    Peak Fitting Wizard Tutorials 5 Introduction................................................................................................................................5 Tutorial 1, Introduction to the Peak Fitting Wizard ...................................................................5

    Getting Started .............................................................................................................6 Selecting a Range of Data............................................................................................6 Defining the Baseline ..................................................................................................8 Finding the Peaks.........................................................................................................8 Fine-tuning the Peak Parameters ...............................................................................11 Performing the Fit......................................................................................................13 Reporting the Fitting Results .....................................................................................15 Exiting a Peak Fitting Session ...................................................................................17

    Tutorial 2, Analyzing Data with Hidden Peaks........................................................................17 Getting Started ...........................................................................................................17 Selecting a Range of Data..........................................................................................18 Defining the Baseline ................................................................................................18 Finding the Peaks.......................................................................................................20 Setting a Parameter's Lower Bound...........................................................................23 Performing the Fit......................................................................................................24 Reporting the Fitting Results .....................................................................................25 Exiting a Peak Fitting Session ...................................................................................25

    Tutorial 3, Creating a Customized Wizard...............................................................................25 Getting Started ...........................................................................................................26 Stepping Through the Wizard Performing Actions and Hiding Pages ......................27 Saving the Customized Procedure File ......................................................................29 Running the Custom Wizard......................................................................................30

    Peak Fitting Wizard Reference 31 Introduction..............................................................................................................................31

  • 7/28/2019 PFM Manual

    4/124

    iv Contents Peak Fitting Module

    Initializing the Peak Fitting Wizard .........................................................................................34 Selecting the Peak Data............................................................................................................35 Preconditioning the Data..........................................................................................................37 Initializing the Baseline............................................................................................................40 Defining How the Baseline Points Should be Used to Create a Baseline ................................42

    Modifying the Baseline Points...................................................................................43 Fitting the Baseline Points with a Function ...............................................................43

    Connecting the Baseline Points with a Line ..............................................................44 Connecting the Baseline Points with a Spline............................................................44

    Conditioning the Baseline ........................................................................................................44 Scaling the Baseline Along the Y Axis......................................................................45 Subtracting the Baseline From the Peak Data ............................................................45

    Specifying the Peak Function and Finding the Peaks...............................................................46 Selecting the Peak Function.......................................................................................46 Modifying and Defining New Functions ...................................................................48 Automatically Finding the Peaks ...............................................................................51 Defining Peaks from a Data File................................................................................52

    Adding, Modifying, and Deleting Peaks ..................................................................................52 Enlarging a Section of Interest in the Wizard Graph .................................................53 Locating Hidden Peaks ..............................................................................................53 Adding New Peak Markers........................................................................................54 Modifying the X Location of Peak Markers ..............................................................54 Deleting Peak Markers...............................................................................................54

    Assigning Peak-specific Functions and Initializing Parameters...............................................55 Selecting the Active Peak ..........................................................................................55 Changing the Function to Fit to the Peak...................................................................56 Optimizing the Initial Parameter Values....................................................................56 Updating the Wizard Graph While Editing the Peak Edit View Box ........................58

    Fixing and Sharing Parameters and Setting Constraints ..........................................................58 Fixing or Allowing Parameter Values to Vary ..........................................................59 Sharing Parameters Among Peaks .............................................................................60 Setting the Parameter Constraints ..............................................................................60

    Controlling the Fitting Procedure and Performing the Fit ........................................................61 Setting the Number of Iterations................................................................................62 Setting the Tolerance .................................................................................................62 Setting Confidence and Prediction Band Levels........................................................63 Varying or Fixing the Baseline ..................................................................................63 Weighting the Data ....................................................................................................63 Starting the Fitting .....................................................................................................64

    Checking the Fit By Reviewing the Residuals...........................................................64 Reporting the Results ...............................................................................................................66 Reporting the Fitting Function Parameters and the Fitting Statistics.........................66 Reporting the Peak Characteristics in a Worksheet Report .......................................69 Reporting the Peak Characteristics in a Graph Report...............................................73 Computing and Viewing the Peak Characteristics Interactively ................................77 Saving the Peak Locations to an ASCII File..............................................................79 Saving Settings to an Initialization File .....................................................................79

    Creating a Custom Wizard .......................................................................................................80

  • 7/28/2019 PFM Manual

    5/124

    Peak Fitting Module Contents v

    Peak and Baseline Function Reference 83 Introduction..............................................................................................................................83 Peak Functions .........................................................................................................................84

    Gaussian.....................................................................................................................84 Gauss2 .......................................................................................................................84 EMGauss ...................................................................................................................84 Lorentz.......................................................................................................................85 Voigt ..........................................................................................................................85 PsVoigt1 ....................................................................................................................86 PsVoigt2 ....................................................................................................................86 Pearson7.....................................................................................................................87 Asym2Sig ..................................................................................................................87 Weibull3 ....................................................................................................................87 LogNormal.................................................................................................................88 GCAS ........................................................................................................................88 ECS............................................................................................................................89 CCE ...........................................................................................................................89 BiGauss......................................................................................................................90 InvsPoly .....................................................................................................................90 Sine ............................................................................................................................90 SineSqr.......................................................................................................................91 SineDamp ..................................................................................................................91 Power2 .......................................................................................................................91 Pulse ..........................................................................................................................91

    Periodic Peak Functions...........................................................................................................92 SineDamp ..................................................................................................................92 Sine ............................................................................................................................92 SineSqr.......................................................................................................................92

    Baseline Functions ...................................................................................................................93 Line............................................................................................................................93 Parabola .....................................................................................................................93 Cubic..........................................................................................................................93 Poly4..........................................................................................................................93 Poly5..........................................................................................................................93 ExpDec1 ....................................................................................................................94 ExpDec2 ....................................................................................................................94 ExpGrow1..................................................................................................................94 ExpGrow2..................................................................................................................94 Hyperbl ......................................................................................................................94

    External DLL Functions...........................................................................................................95

    Programming the PFM with LabTalk 97 Introduction..............................................................................................................................97 Basic PFM Scripts: Getting Started .........................................................................................97 Getting Results.......................................................................................................................100 Controlling the PFM ..............................................................................................................104 Peaks With Different Functions .............................................................................................105

  • 7/28/2019 PFM Manual

    6/124

    vi Contents Peak Fitting Module

    Fitting a Section of a Dataset .................................................................................................106 Constraints .............................................................................................................................107 Auxiliary Methods and Properties..........................................................................................109 Fitting Multiple Datasets Simultaneously ..............................................................................113

    Index 115

  • 7/28/2019 PFM Manual

    7/124

    Installing the PFM and Getting Started Installing the PFM 1

    Installing the PFM andGetting Started

    Installing the PFM

    To install the PFM, perform the following:

    1) Start Origin 7.5.

    2) Select Tools:Pack/Unpack OPK Files . This opens the Origin Pack dialog box.

    3) Click the Open button .

    4) In the Origin Pack Files dialog box, Look in the PFM subfolder inthe Origin(Pro) program folder.

    5) Select the PFM.OPK and click Open (continues on next page ).

  • 7/28/2019 PFM Manual

    8/124

    2 Uninstalling the PFM Installing the PFM and Getting Started

    6) Click the Extract button in the Origin Pack dialog box to installthe files.

    During the PFM.OPK installation, a PFM button group is added to theGroups list box on the Button Groups tab of the Customize Toolbar dialog box ( View:Toolbars ).

    Additionally, the PFM toolbar displays in the Origin workspace. This

    toolbar includes one button, the Enter Peak Fitting Session button .

    Uninstalling the PFMTo uninstall the PFM, perform the following operations:

    1) Start Origin. (If Origin is already open and if you have run the Peak

    Fitting wizard in the current Origin session, close Origin and then restartOrigin. If Origin is open and you have not run the wizard in the currentsession, proceed to the next step.)

    2) Select Tools:Uninstall OPK Files . This opens the Uninstall Opack dialog box.

  • 7/28/2019 PFM Manual

    9/124

    Installing the PFM and Getting Started Entering a Peak Fitting Session 3

    Uninstalling the PFM

    3) Select the Peak Fitting Module from the list box and click Uninstall .

    Entering a Peak Fitting SessionYou can enter a peak fitting session when either a worksheet or graph isactive. To enter a peak fitting session, click the Enter Peak Fitting

    Session button on the PFM toolbar. This button opens the Peak Fitting wizard with the active dataset displaying in the wizard graph.

    Important Note: When the Peak Fitting wizard is open, you should not

    activate and begin performing operations in Origin. If you must return toOrigin to perform operations, you should first close the Peak Fittingwizard.

    Getting Started Using the WizardTo navigate through the Peak Fitting wizard, click the Next (and Back)

    buttons, or click the page icons on the wizard map located on the left sideof the wizard. The page icons on the wizard map are color-coded toindicate the active page (green), a page that has not been visited (yellow),a page that has already been visited or skipped (brown), and the lastwizard page (red).

    The wizard map provides more navigation options than the Next andBack buttons, as you can skip pages using the wizard map in both theforward and backward direction. However, when you first start using thePeak Fitting wizard, you should navigate through the wizard pages in thesequence provided. As you become familiar with the wizard, you can

  • 7/28/2019 PFM Manual

    10/124

    4 Getting Started Using the Wizard Installing the PFM and Getting Started

    skip and hide pages. For information on skipping and hiding wizard pages, see "Tutorial 3, Creating a Customized Wizard".

    The wizard graph (located on the right side of the wizard) updates as youmake selections and perform actions on the wizard pages. To enhance

    the view of the wizard graph, you can maximize the wizard's display.You can further enhance the wizard graph display by hiding the wizardmap and then maximizing the wizard. To hide the wizard map, right-click in a blank area of the wizard (for example, next to the Back button)and select Show Wizard Map from the shortcut menu. This action de-selects the menu command and hides the wizard map. Now maximize

    the wizard to enhance the view of the wizard graph.

  • 7/28/2019 PFM Manual

    11/124

    Peak Fitting Wizard Tutorials Introduction 5

    Peak Fitting WizardTutorials

    IntroductionThree tutorial lessons are provided to help you get started using the Peak Fitting wizard.

    "Tutorial 1, Introduction to the Peak Fitting Wizard" on this page: Thistutorial introduces you to the pages and controls on the Peak Fittingwizard. You will step through each page of the wizard using a sampledataset.

    "Tutorial 2, Analyzing Data with Hidden Peaks" on page 17: This

    tutorial introduces you to the Peak Fitting wizard's baseline points and peak finding algorithms. You will learn how to review the secondderivative. You will also learn how to set a lower bound on a parameter.

    "Tutorial 3, Creating a Customized Wizard" on page 25: This tutorialsteps you through the process of creating a custom wizard. You will hide

    pages on the Peak Fitting wizard. Some hidden pages will be pre-set to perform custom actions. Other pages will be set to perform no actions.You will create a custom toolbar button to run your custom wizard.

    Tutorial 1, Introduction to the Peak FittingWizard

    This tutorial introduces you to the pages and controls on the Peak Fittingwizard. Using sample data provided with the PFM, you will define a

    baseline, automatically find and manually add peaks, fine-tune the initial

  • 7/28/2019 PFM Manual

    12/124

    6 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials

    peak parameter values using an interactive display, fit the data, andcustomize the peak analysis report.

    Getting Started

    1) Start Origin and then click the Open button on the Standardtoolbar.

    2) Select PFM_Examples.OPJ from the list of available files in theOrigin folder and click the Open button. The project opens with a noteswindow active in the workspace.

    3) If the Project Explorer is not currently open, click the Project

    Explorer button on the Standard toolbar to open it.

    4) Double-click on the Chromatography Data folder in the ProjectExplorer.

    5) Activate the Graph3 - GPC Single Channel Chromatogram window by clicking on the graph's title bar or by double-clicking on the Graph3icon on the right side of the Project Explorer.

    6) Click the Enter Peak Fitting Session button on the PFM toolbar.The Peak Fitting wizard opens displaying the Graph3 data.

    The wizard map on the left side of the wizard provides navigationthrough the wizard (in addition to the Next and Back buttons). However,you can hide the wizard map so that your view of the wizard graph located on the right side of the wizard is enhanced.7) Right-click in the blank gray area of the wizard next to the Help

    button. This action opens a shortcut menu.

    8) Select Show Wizard Map from the shortcut menu. This action de-selects the menu command and hides the wizard map.

    9) Click the wizard's Maximize button to maximize the wizard'sdisplay on your screen.

    Selecting a Range of DataWhen you first open the Peak Fitting wizard, the Choose Data page isactive. You can select a different peak dataset or edit the range of thecurrently selected dataset from this page.

    1) Click the Select Range button. Data markers display at both ends of the peak data in the wizard graph. Additionally, the Current Marker Position group displays on the wizard page showing the current X and Yvalues of the active data marker.

  • 7/28/2019 PFM Manual

    13/124

    Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard 7

    Selecting a Range of Data

    2) Drag the left data marker to approximately X = 3.

    3) Drag the right data marker to approximately X = 18.

    4) Press ENTER to fix the markers and exit the range selection mode.The graph updates displaying the selected range. Additionally, the Fromand To text boxes update displaying the respective X values.

    Completing the Range Selection

  • 7/28/2019 PFM Manual

    14/124

    8 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials

    Defining the Baseline1) Click the Next button to advance to the Precondition Data wizard

    page. This page allows you to precondition and apply a smoothing filter to your data.

    2) Click the Next button to advance to the Baseline Points page. This page provides controls to select (or initialize, if you will be allowing the baseline to vary during the fit) the baseline points. You can select aconstant or a reference dataset, or you can graphically define the baseline

    points or use the Peak Fitting wizard's baseline finding algorithm. Thedefault Constant selection defines an appropriate baseline for this data.

    Constant Baseline Selection

    3) Click the Next button to advance to the Baseline Conditioning page.This page provides controls to scale the baseline along the Y axis or tosubtract the baseline from the peak data.

    4) Click the Next button to advance to the Peak Finding page.

    Finding the PeaksThe Peak Finding page provides controls to select the peak function andestimate the peak locations.

    1) With the Threshold Height radio button selected in the Find Peaksgroup, click the Pick Peaks button. Eight peaks are found and markedwith magenta vertical lines in the wizard graph.

  • 7/28/2019 PFM Manual

    15/124

    Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard 9

    Finding Peaks Automatically

    The Pick Peaks algorithm finds peaks by searching the smoothed secondderivative of the peak data looking for peaks that are above a noisethreshold. The noise threshold can be increased or decreased from theassociated combo box to drop or add peaks. As you increase this value,the algorithm finds less peaks.

    In this example, we'll mark the currently unmarked peaks at the beginning and end of the dataset manually.

    2) Click the Next button to advance to the Define Peaks page. This page provides controls to add, modify, or delete peaks from the wizard graph.

    3) Click the Enlarger button on the wizard and enlarge the twounmarked peaks in the wizard graph whose centers are approximatelylocated at X = 4 and X = 5.

    Note: If you don't enlarge the desired area, click the Rescale button

    on the wizard and then re-click the Enlarger button and drag thearea again.

  • 7/28/2019 PFM Manual

    16/124

    10 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials

    Enlarging a Section of the Wizard Graph

    4) Click the Add button and then double-click to define the two peak locations.

    Manually Adding Peaks

    5) Click the Done button.

    6) Click the Rescale button on the wizard to rescale the axes to thefull range.

  • 7/28/2019 PFM Manual

    17/124

    Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard 11

    7) Click the Enlarger button on the wizard and enlarge the last(unmarked) peak in the wizard graph whose center is approximatelylocated at X = 15.5.

    8) Click the Add button and then double-click to define the peak location.

    9) Click the Done button.

    10) Click the Rescale button on the wizard to rescale the axes to thefull range.

    Adding the Remaining Peak

    Fine-tuning the Peak Parameters1) Click the Next button to advance to the Peak Edit Control page.

    This page provides controls to select the active peak and the function tofit to that peak. It also provides an interactive peak edit view box,allowing you to fine-tune the peak parameter values for the active peak graphically.

    The peak edit view box displays the active peak data as black scatter points. The theoretical curve for the entire dataset displays as a red line plot. The theoretical curve for the active peak displays as a green line plot (this may be hidden from view by the composite theoretical curve).Both theoretical curves are based on the current parameter values and theselected fitting function(s). Three controls are provided to graphically

  • 7/28/2019 PFM Manual

    18/124

    12 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials

    improve the overlay of the theoretical curve to the data: a red peak center line, a red peak height line, and a black peak width line with redcontrol handles on the ends.

    The Peak Edit View Box with the First Peak Active

    2) Move the cursor so that it is pointing over the last peak in the wizardgraph (whose center is approximately located at X = 15.5). The mouse

    pointer will display as a hand pointer in this location.

    Selecting the Active Peak

    3) Click once on the peak to activate it.

    The peak edit view box on the left side of the wizard updates displayingthe currently selected peak and theoretical curves.

  • 7/28/2019 PFM Manual

    19/124

    Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard 13

    The Peak Edit View Box with the Last Peak Active

    4) Drag one of the width control handles in the peak edit view box andincrease the width of the peak's theoretical curve so that it resembles thewidth of the peak (black scatter points).

    You may need to click the button located in the peak edit view box torescale the view box.

    5) If necessary, adjust the peak center in the peak edit view box bydragging the peak center line left or right, as needed.

    Fine-tuning the Parameter Values using the Peak Edit View Box

    Performing the Fit1) Click the Next button to advance to the Fit page.

    This page allows you to edit several quantitative properties of the fitting procedure, as well as the confidence and prediction levels, and then perform the fit.

  • 7/28/2019 PFM Manual

    20/124

    14 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials

    2) Click the Fit button to perform, at most, 10 Levenberg-Marquardtiterations, as specified in the Number of Iterations drop-down list (andthe Tolerance text box).

    The fit should converge in only a few iterations. The output view boxlists the number of iterations performed and the reduced chi-square value.

    Additionally the updated fit curve displays in the wizard graph.

    Performing the Fit

    3) Click the Individual Peaks button located below the wizardgraph to display the fit curves for the individual peaks. These fit curvesdisplay as green line plots.

  • 7/28/2019 PFM Manual

    21/124

    Peak Fitting Wizard Tutorials Tutorial 1, Introduction to the Peak Fitting Wizard 15

    Displaying the Fit Curves for the Individual Peaks

    Reporting the Fitting Results1) Click the Next button to advance to the Results page.

    This page provides controls to create reports on the fitting function parameters, fitting statistics, and the peak characteristics. Bothworksheet and graph reports are available.

    2) Click the Confidence Bands button and the Prediction Bands

    button located below the wizard graph to display confidence and prediction bands. (The confidence levels are specified on the Fit page.)

    Note: When confidence bands, prediction bands, and individual peaksare displayed in the wizard graph, they will also be included in a graphreport.

    3) In the Peak Characterization Report group, click the Options buttonlocated to the right of the Plot button. This opens the Peak

    Characterization Report Field Details dialog box.4) Select 8 from the Total Number of Fields drop-down list.

    5) Select "Peak report field 8" in the Available Fields on Report Plot list box.

    6) Select the Resolution with Next Adjacent Peak radio button in theAvailable Results for Display group.

    (To view the results associated with report fields 1 - 7, select the desiredreport field from the Available Fields on Report Plot list box. The radio

  • 7/28/2019 PFM Manual

    22/124

    16 Tutorial 1, Introduction to the Peak Fitting Wizard Peak Fitting Wizard Tutorials

    button of the associated result will be enabled in the Available Resultsfor Display group.)

    7) Click the OK button to close the dialog box.

    8) In the Peak Characterization Report group, click the Plot button.

    The graph report is created in the Origin project. Because the wizard

    remains active, the graph displays behind the wizard.9) Minimize the Peak Fitting wizard to view the graph report.

    10) A Reminder Message may display indicating that the graph report isdisplayed using speed mode. Click the OK button if this Reminder Message displays.

    The Peak Fitting Graph Report

    11) Click the Restore button on the Peak Fitting wizard's title bar torestore the wizard's display.

    12) In the Fitting Function Parameters group, click the Worksheet button.

  • 7/28/2019 PFM Manual

    23/124

    Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks 17

    The fitting function parameters worksheet report is created in the Origin project. Because the wizard remains active, the worksheet displays behind the wizard.

    Exiting a Peak Fitting Session1) Click the Finish button to close the Peak Fitting wizard and access thegraph and worksheet reports.

    Tutorial 2, Analyzing Data with HiddenPeaks

    This tutorial introduces you to the Peak Fitting wizard's baseline and peak detection algorithms. Using sample data provided with the PFM,you will automatically find the baseline and fit the points with a linefunction, automatically find peaks and compare the results with thesecond derivative, set a parameter's lower bound, and perform the fit.

    Getting Started1) Open the PFM_Examples.OPJ file if it is not currently open.

    2) In the Project Explorer, activate the Graph1 graph window located inthe Chromatography Data folder.

    3) Click the Enter Peak Fitting Session button on the PFM toolbar.

    4) Right-click in the blank gray area of the wizard next to the Help button. This action opens a shortcut menu.

    5) Select Show Wizard Map from the shortcut menu. This action de-selects the menu command and hides the wizard map.

    6) Click the wizard's Maximize button to maximize the wizard'sdisplay on your screen. (Note: If you are continuing from Tutorial 1,you may need to Restore Down first, and then maximize the wizard.)

    7) Click the Line Plot button located below the wizard graph. The peak data displays as a line data plot in the wizard.

  • 7/28/2019 PFM Manual

    24/124

    18 Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials

    Selecting a Range of Data1) Click the Select Range button.

    2) Drag the left data marker to approximately X = 11.

    3) Press ENTER to fix the marker and exit the range selection mode.

    The graph updates displaying the selected range.

    Selecting a Range of Data

    Defining the Baseline1) Click the Next button to advance to the Precondition Data wizard

    page.

    2) Click the Next button to advance to the Baseline Points page.

    3) Select the Auto Find radio button.

    The Auto Find baseline detection algorithm looks for points in thesmoothed first and second derivatives that are within a threshold of zero. Notice that at the current threshold level, a baseline point is detected on a peak.

    Spin buttons are provided to scale the threshold up or down, thusincreasing or decreasing the number of points found.

    4) Click the Number of Points down spin button once.

    The wizard graph updates displaying the resultant baseline points. Atthis threshold level, the point on the peak is no longer detected.

  • 7/28/2019 PFM Manual

    25/124

    Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks 19

    Finding Baseline Points using the Baseline Detection Algorithm

    5) Click the Next button to advance to the Create Baseline wizard page.

    By default, the detected baseline points are fit using a line function.

    Fitting the Baseline Points with a Line Function

    6) Click the Next button to advance to the Baseline Conditioning wizard page.

  • 7/28/2019 PFM Manual

    26/124

    20 Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials

    Finding the Peaks1) Click the Next button to advance to the Peak Finding wizard page.

    2) With the Threshold Height radio button selected in the Find Peaksgroup, click the Pick Peaks button. Thirteen peaks are found and marked

    with magenta vertical lines in the wizard graph.

    Finding Peaks Automatically

    3) Click the 2nd Derivative button on the wizard to display thesecond derivative below the peak and baseline graph layer.

  • 7/28/2019 PFM Manual

    27/124

  • 7/28/2019 PFM Manual

    28/124

    22 Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials

    Updated Wizard Graph

    5) Click the Threshold Height down arrow once and then re-click thePick Peaks button. One additional peak is found in the peak data, with acenter at 13.

    Finding Additional Hidden Peaks

  • 7/28/2019 PFM Manual

    29/124

    Peak Fitting Wizard Tutorials Tutorial 2, Analyzing Data with Hidden Peaks 23

    6) Click the Rescale button on the wizard to rescale the wizardgraph axes to their full range.

    7) Click the 2nd Derivative button on the wizard to turn off thedisplay of the second derivative.

    8) Click the Next button to advance to the Define Peaks wizard page.9) Click the Add button and then double-click to define the negative

    peak at approximately X = 19.

    Manually Adding Peaks

    10) Click the Done button.

    11) Click the Next button to advance to the Peak Edit Control wizard page.

    Setting a Parameter's Lower BoundYou can set simple constraints for parameters such as lower and upper

    bounds, as well as general linear constraints. In this example, you willset a lower bound for the second peak's area parameter. You will set thislower bound to zero to prevent the area from going negative during theiterative procedure.

    1) Click the Parameter Display button on the wizard to open thePeak Parameters Display dialog box.

  • 7/28/2019 PFM Manual

    30/124

    24 Tutorial 2, Analyzing Data with Hidden Peaks Peak Fitting Wizard Tutorials

    2) For the Area parameter of peak 2, select the LBound check box. (Tip:First click on the text Area in the Parameter column for Peak #2. Thisaction highlights the entire row. Then scroll or resize the dialog box toview and select the LBound check box.)

    3) For this same parameter, double-click in the Lower Bound field toenter the editing mode. Then type 0.0 .

    Setting the Lower Bound for a Parameter

    4) Click the OK button to close the dialog box.

    Performing the Fit1) Click the Next button to advance to the Fit wizard page.

    2) Click the Fit button to perform, at most, 10 Levenberg-Marquardtiterations, as specified in the Number of Iterations drop-down list (andthe Tolerance text box).

    The fit should converge in less than 10 iterations. The output view boxlists the number of iterations performed and the reduced chi-square value.

    Additionally the updated fit curve displays in the wizard graph.

    3) Click the Individual Peaks button located below the wizardgraph to display the fit curves for the individual peaks.

  • 7/28/2019 PFM Manual

    31/124

    Peak Fitting Wizard Tutorials Tutorial 3, Creating a Customized Wizard 25

    Performing the Fit

    Reporting the Fitting Results1) Click the Next button to advance to the Results page.

    2) In the Peak Characterization Report group, click the Plot button.

    3) In the Fitting Function Parameters group, click the Worksheet button. Note: The graph and worksheet report are created in the Origin project.Because the wizard remains active, the graph and worksheet display

    behind the wizard.

    Exiting a Peak Fitting Session1) Click the Finish button to close the Peak Fitting wizard and access thegraph and worksheet reports.

    Tutorial 3, Creating a Customized WizardAs you use the Peak Fitting wizard to analyze different sets of data, youmay find that for each dataset, you perform no actions on some wizard

    pages and that you perform the same actions on other wizard pages. For

  • 7/28/2019 PFM Manual

    32/124

    26 Tutorial 3, Creating a Customized Wizard Peak Fitting Wizard Tutorials

    example, perhaps you never precondition your data or apply a smoothingfilter, and thus you perform no actions on the Precondition Data page.Similarly, perhaps you always use the wizard's baseline finding algorithmon the Baseline Points page.

    If you step through the wizard pages in a similar way when analyzingdata, you can simplify the wizard by hiding pages that you either perform

    no actions on or ones that you always perform the same actions on. Youcan then save this customized wizard to a new toolbar button for futureaccess. This tutorial steps you through the process of creating acustomized wizard.

    Note: For a list of wizard actions that can be saved to a custom wizard,see Peak Fitting Wizard Reference.

    Getting Started1) Open the PFM_Examples.OPJ file if it is not currently open.

    2) In the Project Explorer, activate the Graph5 graph window located inthe Chromatography Data folder.

    3) Click the Enter Peak Fitting Session button on the PFM toolbar.

    4) Right-click in the blank gray area of the wizard next to the Help button. This action opens a shortcut menu.

    5) Select View Mode:Full from the shortcut menu. This action addscheck boxes to the page icons on the wizard map. These check boxes

    allow you to disable the display of wizard pages.

  • 7/28/2019 PFM Manual

    33/124

    Peak Fitting Wizard Tutorials Tutorial 3, Creating a Customized Wizard 27

    Full View Mode

    Stepping Through the Wizard

    Performing Actions and Hiding PagesThe first wizard page, Choose Data, allows you to select a range of data.It also allows you to initialize settings in the Peak Fitting wizard from aninitialization file. If you do not require the range selection feature for your peak analysis, and if you do not read an initialization file, then youcan hide this wizard page from view.

    Note: If you want to read an initialization file, then you should not hidethis page from view.

    1) Click in the Choose Data check box on the wizard map to clear the

    check box.

    Clearing a Check Box on the Wizard Map

  • 7/28/2019 PFM Manual

    34/124

    28 Tutorial 3, Creating a Customized Wizard Peak Fitting Wizard Tutorials

    This action sets the Choose Data page as hidden when you exit thewizard's Full View mode. Additionally, after you save your customizedwizard to a button, this wizard page will not display when you click your custom button. Furthermore, no actions on this page will be performedwhen this page is skipped.

    2) Click in the Precondition Data check box on the wizard map to clear

    the check box. This action activates the page and also sets it as hiddenwhen you exit the wizard's Full View mode. No actions on this page will

    be performed when this page is skipped.

    3) Click in the Baseline Points check box on the wizard map to clear thecheck box. This action activates the page and sets this page as hiddenwhen you exit the wizard's Full View mode.

    4) Click the Auto Find radio button on the Baseline Points wizard page.Baseline points are found using the wizard's baseline finding algorithm.

    When this page is skipped when you run your customized wizard, thewizard will automatically perform the Auto Find baseline findingalgorithm.5) Click in the Create Baseline check box on the wizard map to clear thecheck box. This action activates the page and sets this page as hiddenwhen you exit the wizard's Full View mode.

    Note that the Create Baseline radio button on the Create Baseline wizard page is selected, and that the Use Function radio button is selected withthe line function active. When this page is skipped, the wizard willautomatically create the baseline by using the line function.

    6) Click in the Baseline Conditioning check box on the wizard map toclear the check box. This action activates the page and also sets it ashidden when you exit the wizard's Full View mode. No actions on this

    page will be performed when this page is skipped.

    7) Click in the Peak Finding check box on the wizard map to clear thecheck box. This action activates the page and sets this page as hiddenwhen you exit the wizard's Full View mode.

    8) With the Threshold Height radio button selected in the Find Peaksgroup, click the Pick Peaks button. The wizard's peak detectionalgorithm finds and marks four peaks in the wizard graph. When this

    page is skipped, the wizard will automatically find and mark peaks usingthe peak finding algorithm.

    9) Click in the Define Peaks check box on the wizard map to clear thecheck box. This action activates the page and also sets it as hidden whenyou exit the wizard's Full View mode. No actions on this page will be

    performed when this page is skipped.

    10) Click on the "Peak Edit Control" text in the wizard map (not in thecheck box). This action activates the page but does not change its viewstatus.

    11) Click on the "Fit" text in the wizard map. This action activates the page but does not change its view status.

  • 7/28/2019 PFM Manual

    35/124

    Peak Fitting Wizard Tutorials Tutorial 3, Creating a Customized Wizard 29

    12) Click the Fit button to perform, at most, 10 Levenberg-Marquardtiterations, as specified in the Number of Iterations drop-down list (andthe Tolerance text box).

    13) Click on the "Results" text in the wizard map. This action activatesthe page but does not change its view status.

    Saving the Customized Procedure File1) On the Results page, select the Save Procedure File check box.

    2) Right-click in the blank gray area of the wizard next to the Help button. This action opens a shortcut menu.

    3) Select View Mode:Normal from the shortcut menu. The wizard mapupdates displaying the Peak Edit Control, Fit, and Results wizard pageicons.

    The Updated Wizard Map

    4) Click the Finish button. This action opens the Button Settings dialog box.

  • 7/28/2019 PFM Manual

    36/124

    30 Tutorial 3, Creating a Customized Wizard Peak Fitting Wizard Tutorials

    The Button Settings Dialog Box

    5) With the top, left button selected, type Auto Find Baseline andPeaks in the Tool Tip and the Status Bar text boxes.

    6) Click the OK button to close the dialog box and the Peak Fittingwizard. Additionally, a new PFMWiz toolbar displays in the Originworkspace with the button that you just created.

    Running the Custom Wizard1) To run your custom Peak Fitting wizard, make sure that Graph5 isstill active and then click the new toolbar button you just created.

    (You are re-analyzing Graph5 because replicate datasets are not availablein this project file. You would typically activate a new graph windowcontaining similar data.)

    Your custom wizard will open displaying the Peak Edit Control wizard page. The baseline is already created and the four peaks are already

    marked.2) Click the Next button to advance to the Fit page.

    3) Click the Fit button to perform, at most, 10 Levenberg-Marquardtiterations.

    4) Click the Next button to advance to the Results page.

    5) In the Fitting Function Parameters group, click the Worksheet button.

    6) Click the Finish button to close the custom Peak Fitting wizard andaccess the worksheet report.

  • 7/28/2019 PFM Manual

    37/124

    Peak Fitting Wizard Reference Introduction 31

    Peak Fitting WizardReference

    IntroductionAfter clicking the Enter Peak Fitting Session button, the Peak Fittingwizard opens with the active dataset displaying in the wizard graph.

    To navigate through the Peak Fitting wizard, click the Next (and Back) buttons, or click the page icons on the wizard map located on the left sideof the wizard. The page icons on the wizard map are color-coded toindicate the active page (green), a page that has not been visited (yellow),a page that has already been visited or skipped (brown), and the last

    wizard page (red).

    The Peak Fitting wizard includes the following pages:

    Choose Data : This page contains controls for selecting the Y fittingdataset and for selecting a range of data for fitting. You can also selectan initialization file on this page. For more information on the datasetcontrols, see " Selecting the Peak Data" on page 35. For moreinformation on initialization files, see " Initializing the Peak FittingWizard" on page 34 and " Saving Settings to an Initialization File" on

    page 79.

    Precondition Data : This page allows you to precondition and apply asmoothing filter to your data prior to fitting. For more information onthis wizard page, see " Preconditioning the Data" on page 37.

    Baseline Points : This page is the first step in specifying the baseline before fitting your data. Edit this page to select the baseline points. For more information on this wizard page, see " Initializing the Baseline" on

    page 40.

    Create Baseline : After you have selected the baseline points from theBaseline Points wizard page, edit this page to specify how the baseline

  • 7/28/2019 PFM Manual

    38/124

    32 Introduction Peak Fitting Wizard Reference

    points will be used to create the baseline. This page also providescontrols for adding, modifying, or deleting baseline points beforecreating the baseline. For more information on this wizard page, see"Defining How the Baseline Points Should be Used to Create a Baseline "on page 42.

    Baseline Conditioning : This page allows you to condition the baseline before fitting. You can scale the baseline along the Y axis or subtract the baseline from your peak data. For more information on this wizard page,see " Conditioning the Baseline" on page 44.

    Peak Finding : This page contains controls to specify the peak functionand estimate the peak locations. For more information on this wizard

    page, see " Specifying the Peak Function and Finding the Peaks" on page46.

    Define Peaks : After defining the peak function and finding the peaks,edit this page to add, modify, or delete peaks. For more information onthis wizard page, see " Adding, Modifying, and Deleting Peaks" on page

    52. Peak Edit Control : Edit this page to set a different function for different peaks, and to visually adjust the theoretical curve to get the bestinitial parameter values. For more information on this wizard page, see"Assigning Peak-specific Functions and Initializing Parameters" on page55.

    Fit : This page allows you to control the fitting procedure and performthe fit. For more information on this wizard page, see " Controlling theFitting Procedure and Performing the Fit" on page 61.

    Results : This page allows you to create reports on the fitting function

    parameters and the fitting statistics, as well as on the peak characteristics.Additionally, this page provides an option for saving the current fittingvariable values and parameter values to an initialization file, as well asfor saving the wizard page actions to a procedure file. For moreinformation on the result reports, see " Reporting the Results" on page 66. For more information on initialization files and procedure files, see"Initializing the Peak Fitting Wizard" on page 34 and " Saving Settings toan Initialization File" on page 79, and " Creating a Custom Wizard" on

    page 80.

    The following buttons are available on the Peak Fitting wizard:

    Opens a dialog box for manually initializing the parameter values,fixing parameter values, sharing parameters among peaks, and setting

    parameter constraints including upper and lower bounds and generallinear constraints. For more information, see " Fixing and SharingParameters and Setting Constraints" on page 58.

    Enlarge a section of the wizard graph. For more information, see"Enlarging a Section of Interest in the Wizard Graph" on page 53.

  • 7/28/2019 PFM Manual

    39/124

    Peak Fitting Wizard Reference Introduction 33

    Scroll the wizard graph axes left and right after enlarging. For more information, see " Enlarging a Section of Interest in the WizardGraph" on page 53.

    Return the wizard graph to the full axis scales. For moreinformation, see " Enlarging a Section of Interest in the Wizard Graph" on

    page 53.

    Display the residual plot. For more information, see "Checking theFit By Reviewing the Residuals" on page 64.

    Display the second derivative of the peak data. For moreinformation, see " Locating Hidden Peaks" on page 53.

    Display confidence bands. For more information, see "SettingConfidence and Prediction Band Levels" on page 63.

    Display prediction bands. For more information, see "SettingConfidence and Prediction Band Levels" on page 63.

    Display the theoretical curve for the individual peaks. For moreinformation, see " Optimizing the Initial Parameter Values" on page 56.

    Display the peak data in the wizard graph as a line or scatter data plot. For more information, see " Selecting the Peak Data" on page35.

    The following shortcut menu commands are available on the Peak Fitting wizard:

    To open the Peak Fitting wizards shortcut menu, right-click in the blank gray area of the wizard next to the Help button.

    View Mode : There are two available wizard view modes, normal(default) and full. The Full view mode is a wizard design mode. Thisview mode provides check boxes next to the page icons on the wizardmap. You can hide a wizard page by clearing its check box. This allowsyou to create custom wizards for specific peak analysis. To learn moreabout hiding wizard pages and creating custom wizards, see "Tutorial 3,Creating a Customized Wizard". Additionally, see Creating a CustomWizard on page 80.

    Action Mode : There are two available action modes, active (default)and passive. The passive action mode allows you to switch wizard pageswithout initiating any actions. The passive action mode can be used withthe full view mode when creating a custom wizard. To learn more aboutcreating custom wizards, see "Tutorial 3, Creating a CustomizedWizard". Additionally, see Creating a Custom Wizard on page 80.

  • 7/28/2019 PFM Manual

    40/124

    34 Initializing the Peak Fitting Wizard Peak Fitting Wizard Reference

    Show Wizard Map : The wizard map on the left side of the wizard provides navigation through the wizard. You can hide the wizard map atany time by selecting Show Wizard Map from the shortcut menu. Whenthe wizard map is hidden, use the Next and Back buttons for navigation.

    Open Editor : The Open Editor command opens the Peak Fittingwizards script file in a new instance of the LabTalk Editor. We do not recommend that you alter the Peak Fitting wizards script file .

    Initializing the Peak Fitting WizardThe Peak Fitting wizard reads a file for initializing the following settings:

    1) Peak and baseline characteristics including the number of peaks, the peak functions, the baseline function, the initial parameter values,

    parameter sharing, fixing parameter values, and constraints includinglower and upper bounds and general linear constraints.

    2) Report settings including the results for display in the peak characterization report and the fitting function parameters report.

    3) Properties of the fitting procedure (the number of iterations and thetolerance) and confidence and prediction levels.

    The default initialization file is PFM.INI. This file is located in your Origin folder. When you start the Peak Fitting wizard, this initializationfile is selected by default on the Choose Data wizard page and is readwhen the wizard is opened. You can select a different initialization file

    by clicking the Read button and selecting the file.The last page of the Peak Fitting wizard, the Results page, provides acontrol for writing to the PFM.INI file or to a custom initialization filethat you specify. This control is available by clicking the Save button inthe Initialization File group. When you click the Save button and specifyan INI file (either PFM.INI or a custom file), the peak and baselinecharacteristics (1) and the report settings (2) are saved to the INI file.The properties of the fitting procedure and confidence and predictionlevels (3) are always saved to the INI file currently selected to write to,independent of whether you click the Save button.

    Thus, after you analyze a peak dataset with the Peak Fitting wizard, youcan save your current settings to an initialization file. Then when youselect a similar dataset for analysis, you can select this custom file for initializing the wizard.

  • 7/28/2019 PFM Manual

    41/124

    Peak Fitting Wizard Reference Selecting the Peak Data 35

    Selecting the Peak DataThe Choose Data wizard page contains controls for selecting the Y peak dataset and for selecting a range of data for fitting.

    Note: For information on initialization files, see "Initializing the Peak

    Fitting Wizard " on page 34.

    The Choose Data Wizard Page Controls

    The Dataset Drop-down List

    This drop-down list contains all the Y datasets in the current project. If you open the wizard with a worksheet active that has a Y columnselected, or if a graph with data is active, the Y worksheet column(dataset) or the Y dataset of the active data plot is automatically selectedfrom this drop-down list. To specify a different Y dataset for peak fitting, select it from the drop-down list. When you select a Y dataset,the Peak Fitting wizard automatically finds the associated X dataset,respecting column associations in the worksheet.

    When a Y dataset is selected from this drop-down list, the dataset and itsassociated X dataset are plotted in the wizard graph.

    The Select Range Button

    Click this button to define a range of data for peak analysis. After clicking this button, data markers display at both ends of the data plotand the Data Selector tool is activated in the wizard graph. Additionally,a Current Marker Position group displays on the wizard page.

  • 7/28/2019 PFM Manual

    42/124

    36 Selecting the Peak Data Peak Fitting Wizard Reference

    The Current Marker Position Group

    Selecting a Range of Data

    To define a range of data, click on the left or right marker and drag it tothe desired location. The XY values of the associated data point displayin the Current Marker Position group. When you complete your rangeselection, press ENTER or double-click on a marker to exit the rangeselection mode.

    After selecting a range of data, the From and To view boxes in theDataset group update to display the associated X data values for your range selection.

    The Full Range Button

    Click this button to select the full range of the dataset selected in theDataset drop-down list. If you previously selected a range of the dataset,clicking this button will reset the data markers to the entire range.

    Note: If you have used the Edit:Set As Begin and Set As End menucommands to set the worksheet display range before starting the PFMsession, or if you set the graph display range using the Data Selector tool

  • 7/28/2019 PFM Manual

    43/124

    Peak Fitting Wizard Reference Preconditioning the Data 37

    and the Data:Set Display Range menu command before starting thePFM session, the wizard's Full Range button will not override theserange settings.

    The From and To Text Boxes

    These text boxes display the current starting and ending X data values for your range selection. In addition to customizing the data range using theSelect Range button, you can customize the range by typing the desiredstarting and ending X values in the text box provided. After typing in avalue, press TAB to update the text box and view your change in thewizard graph.

    Displaying the Peak Data as a Line or Scatter Data Plot

    With any page of the peak fitting wizard active, you can change betweena scatter and a line peak data plot in the wizard graph by clicking the

    Line Plot or the Scatter Plot button located in the wizardgraph.

    Preconditioning the DataThe Precondition Data wizard page allows you to precondition and applya smoothing filter to your data prior to fitting.

    The Precondition Data Wizard Page Controls

  • 7/28/2019 PFM Manual

    44/124

    38 Preconditioning the Data Peak Fitting Wizard Reference

    The Data Preconditioning Group

    Click the View Options button to precondition your data prior to fitting.This button opens the Precondition Fitting Dataset dialog box.

    The Precondition Fitting Dataset Dialog Box

    Select the data preconditioning method from the Methods drop-down list.Depending on the selected method, associated text boxes display next tothe Methods drop-down list. For example, if the Subtract an Offset FromData option is selected, a Y Offset text box displays. Type the desiredvalue in the Y Offset text box. The Description view box displays adescription of the currently selected data preconditioning method. Thesedescriptions are reproduced below:

    1) Subtract an offset from data. Subtract the data by a given value Y0.

    2) Subtract mean (1) from data. Average the data between row R1 andR2, then subtract the resulting mean from the data.

    3) Subtract mean (2) from data. Average the data between X1 and X2,then subtract the resulting mean from the data.

    4) Subtract mean (3) from data. Subtract the mean of the first N rowsfrom the data.

    5) Subtract mean (4) from data. Subtract the mean of the last N rowsfrom the data.

    6) Subtract mean (5) from data. Subtract the mean of all points to theleft of X from the data.

    7) Subtract mean (6) from data. Subtract the mean of all points to theright of X from the data.

  • 7/28/2019 PFM Manual

    45/124

    Peak Fitting Wizard Reference Preconditioning the Data 39

    8) Shirley baseline subtraction (1). Subtract the data using the Shirleymethod (see Note below). R1 and R2 are the minimum and maximumrow numbers that correspond to the energy range. N0 is the requiredfinal baseline height. Note that this operation is slow.

    9) Shirley baseline subtraction (2). Subtract the data using the Shirleymethod (see Note below). E1 and E2 designate the energy range. N0 isthe required final baseline height. Note that this operation is slow.10) Tougaard baseline subtraction (1). Subtract the data using theTougaard method. R1 and R2 are the minimum and maximum rownumbers that correspond to the energy range. B1 is an adjustable

    parameter. Note that this operation is slow.

    11) Tougaard baseline subtraction (2). Subtract the data using theTougaard method. E1 and E2 designate the energy range. B1 is anadjustable parameter. Note that this operation is slow.

    12) Tougaard baseline subtraction (3). Subtract the data using theTougaard method. R1 and R2 are the minimum and maximum rownumbers that correspond to the energy range. N0 is the required final

    baseline height. Note that this operation is slow.

    13) Tougaard baseline subtraction (4). Subtract the data using theTougaard method. E1 and E2 designate the energy range. N0 is therequired final baseline height. Note that this operation is slow.

    14) Straight-line baseline subtraction (1). Subtract the data using theStraight-line method. R1 and R2 are the minimum and maximum rownumbers that correspond to the energy range. N0 is the required final

    baseline height. Note that this operation is slow.

    15) Straight-line baseline subtraction (2). Subtract the data using theStraight-line method. E1 and E2 designate the energy range. N0 is therequired final baseline height. Note that this operation is slow.

    Note: For reference information on the Tougaard baseline subtractionmethod, see S. Tougaard, Surf. Sci. 216, 343 (1989). For referenceinformation on the Shirley baseline subtraction method, see D. A.Shirley, Phys. Rev. B5, 4709 (1972). For a review of both methods, seeS. Tougaard and C. Jansson, "Comparison of Validity and Consistency of Methods for Quantitative XPS Peak Analysis", Surf. Interface Anal. 20,Issue 13, 1013.

    To perform the preconditioning method, click the Run button. When

    finished editing this dialog box, click the OK button.

    The Filters Group

    Select a smoothing filter method from the Filters drop-down list.

    1) Select Savitsky-Golay to smooth the data using the Savitsky-Golayfilter method. Specify the degree of the underlying polynomial from thePolynomial Order spin box. Specify the size of the smoothing windowfrom the Points to the Left and the Points to the Right spin boxes. (You

  • 7/28/2019 PFM Manual

    46/124

    40 Initializing the Baseline Peak Fitting Wizard Reference

    can make the smoothing window asymmetric about a particular data point.)

    Note: To use this smoothing filter method, the X data must be evenlyspaced.

    2) Select Adjacent Averaging to smooth the data using adjacentaveraging. Specify a number that controls the degree of smoothing in theassociated text box. If you enter an odd number n, then n points are usedto calculate each averaged result. If you enter an even number m, thenm+1 points are used to calculate each averaged result. The smoothedvalue at index i is the average of the data points in the interval [ i-(n-1)/2,i+(n-1)/2], inclusive.

    3) Select FFT Filter to smooth the data by FFT filtering. Specify thenumber of points at a time to be considered by the smoothing routine inthe associated text box. The smoothing is accomplished by removingFourier components with frequencies higher than 1/( n delta t ), where n isthe number of data points considered at a time and delta t is the time (or

    more generally the abscissa) spacing between adjacent data points.After selecting the smoothing filter, click the Run Filter button to

    perform the operation.

    The Restore Data Button

    Click this button to undo any preconditioning or smoothing filter that youapplied to the data.

    Initializing the BaselineThe Baseline Points wizard page is the first step in specifying the

    baseline before fitting your data. Edit this page to select (or initialize, if you will be allowing the baseline to vary during the fit) the baseline

    points. You can select a constant or a reference dataset, or you cangraphically define the baseline points or use the PFM's baseline findingalgorithm.

    If you graphically define the baseline points, use an existing dataset, or use the wizard's baseline finding algorithm, then after initializing the

    baseline points, select the Create Baseline wizard page to specify how the baseline points will be used to create the baseline. The Create Baselinewizard page is unavailable if you select a constant for the baseline.

  • 7/28/2019 PFM Manual

    47/124

    Peak Fitting Wizard Reference Initializing the Baseline 41

    The Baseline Points Wizard Page Controls

    Selecting the Baseline Points

    There are four methods for selecting the baseline points:

    1) Select the Constant radio button to specify two baseline pointsdetermined by the Y = text box value. The two baseline points are:( XBegin , Y=Value ) and ( XEnd , Y=Value ).

    Note: If you select this radio button, then the Create Baseline wizard page is not available.

    2) Select the Auto Find radio button to find baseline points based on the

    wizard's internal baseline detection algorithm. This algorithm looks for points in the smoothed first and second derivatives that are within athreshold of zero. Up and down arrow buttons are provided to scale thethreshold up (by 2) or down (by 0.5), thus increasing or decreasing thenumber of points found. Each time you click the up or down arrow

    button, the wizard graph updates displaying the resultant baseline points.

    3) Select the User Defined radio button to define baseline points usingthe Screen Reader tool. After selecting this radio button, the ScreenReader tool is activated in the wizard graph and a Current Marker Position group displays on the wizard page. As you click at a location inthe wizard graph, the XY values of the associated point display in theCurrent Marker Position group. To define a baseline point, double-click at the desired location or click once and press ENTER. When finisheddefining baseline points, click the Done button.

    To force the defined baseline points to fall on the plotted dataset, selectthe Points in Data check box. In this case, after you define the baseline

    points and click the Done button, Origin will find the nearest data point(in X) from the original dataset for each baseline point, and will thenmove the baseline point so that it shares the same Y value as this originaldataset point.

  • 7/28/2019 PFM Manual

    48/124

    42 Defining How the Baseline Points Should be Used to Create a Baseline Peak Fitting Wizard Reference

    Note: To delete the current user defined baseline points, click theRecreate button. In addition to deleting the current baseline pointsselection, this button re-activates the Screen Reader tool in the wizardgraph.

    4) Select the Use Existing Dataset radio button to specify a dataset to useas the baseline points from the associated drop-down list. The drop-down list includes all Y datasets in the project, except for the peak dataset and associated fitting datasets (if any have been created).

    Defining How the Baseline Points Shouldbe Used to Create a Baseline

    After you have initialized the baseline points from the Baseline Pointswizard page, edit the Create Baseline wizard page to specify how the baseline points will be used to create the baseline. You can also use this page to add, modify, or delete baseline points.

    Note: If you selected the Constant radio button on the Baseline Pointswizard page, then the Create Baseline wizard page is not available.

    The Create Baseline Wizard Page Controls

  • 7/28/2019 PFM Manual

    49/124

    Peak Fitting Wizard Reference Defining How the Baseline Points Should be Used to Create a Baseline 43

    Modifying the Baseline PointsSelect the Modify Baseline Points radio button to access the baselinemodification tools.

    Note: After modifying the baseline points, you must select the Create

    Baseline radio button on this wizard page to specify how the baseline points will be used to create the baseline. You cannot proceed in thewizard until completing this step.

    1) Click the Add button to add baseline points. The Add buttonactivates the Screen Reader tool in the wizard graph. Additionally, aCurrent Marker Position group displays on the wizard page. As youclick at a location in the wizard graph, the XY values of the associated

    point display in the Current Marker Position group. To add a baseline point, double-click at the desired location or click once and pressENTER. When finished adding baseline points, click the Done button.

    To force the defined baseline points to fall on the plotted dataset, selectthe Points in Data check box. In this case, after you define the baseline

    points and click the Done button, Origin will find the nearest data point(in X) from the original dataset for each baseline point, and will thenmove the baseline point so that it shares the same Y value as this originaldataset point.

    2) Click the Modify button to modify the baseline points. The Modify button activates the Data Reader tool in the wizard graph. Drag a data point to a new location. When finishing modifying the location of thedata points, click the Done button.

    3) Click the Delete button to delete a point from the baseline. The

    Delete button also activates the Data Reader tool in the wizard graph.Double-click on the desired data point to delete it. Alternatively, click ona point and press ENTER to delete it.

    Fitting the Baseline Points with aFunctionSelect the Create Baseline radio button to specify how the baseline points

    will be used to create the baseline.Select the Use Function radio button and then select a fitting functionfrom the drop-down list. The following baseline functions are provided:

    Line Poly5 ExpGrow2

    Parabola ExpDec1 Hyperbl

    Cubic ExpDec2

    Poly4 ExpGrow1

  • 7/28/2019 PFM Manual

    50/124

    44 Conditioning the Baseline Peak Fitting Wizard Reference

    For more information on these functions, see "Peak and BaselineFunction Reference".

    Connecting the Baseline Points with aLineSelect the Create Baseline radio button to specify how the baseline pointswill be used to create the baseline.

    Select the Connect Points with Line radio button to display a straight line between consecutive baseline data points.

    Connecting the Baseline Points with aSplineSelect the Create Baseline radio button to specify how the baseline pointswill be used to create the baseline.

    Select the Connect Points with Spline radio button to connect the baseline data points with a cubic spline connection.

    Note: This radio button is unavailable if the number of points in the peak dataset exceeds 900.

    Conditioning the BaselineAfter you have created the baseline, edit the Baseline Conditioningwizard page to shift the baseline along the Y axis or to subtract the

    baseline from the peak data.

    The Baseline Conditioning Wizard Page Controls

  • 7/28/2019 PFM Manual

    51/124

    Peak Fitting Wizard Reference Conditioning the Baseline 45

    Scaling the Baseline Along the Y AxisClick the Scale Baseline button to shift the baseline along the Y axis at aspecified location on the peak data plot. After clicking the ScaleBaseline button, the Data Display tool opens and a Current Marker Position group displays on the wizard page. As you click on data pointson the peak data plot in the wizard graph, the associated XY valuesdisplay in the Current Marker Position group. Double-click at thedesired location or click once and press ENTER. Origin finds thecorresponding Y value for the baseline data at this same X value. Originthen calculates the difference between the peak Y value and the baselineY value and adds this amount to the entire baseline.

    Subtracting the Baseline From the

    Peak DataIn deciding whether or not to subtract the baseline from your peak data,you should consider the relative number of peaks in the peak data, aswell as the complexity of the baseline.

    In general, if there are a large number peaks in your peak data, or if the baseline is very complex, it may be best to subtract the baseline from the peak data prior to fitting the peak data. If you don't subtract the baselinefrom the peak data, but instead fit the baseline with the peak data(allowing the baseline to vary), smaller peaks that are close to the

    baseline could cause the baseline to stray during the fitting process.Additionally, small differences in the peak shape in your peak dataversus the model could cause the baseline to stray during the fitting

    process.

    Subtracting the baseline also reduces the number of dimensions in the parameter space that the chi-square minimization algorithm has to work with, and this may improve the quality of the fit.

    The main advantage of fitting the baseline along with the peak data is toavoid any additional errors that could be introduced in the fitting process

    by the baseline subtraction process. When the baseline is fit along withthe peaks, the fitting model describes all of the data, and is therefore astatistically complete fit.

  • 7/28/2019 PFM Manual

    52/124

    46 Specifying the Peak Function and Finding the Peaks Peak Fitting Wizard Reference

    Specifying the Peak Function and Findingthe Peaks

    After creating and conditioning the baseline, edit the Peak Finding

    wizard page to specify the peak function and estimate the peak locations. Note: You can specify a different function for different peaks on thePeak Edit Control wizard page. For more information, see " AssigningPeak-specific Functions and Initializing Parameters" on page 55.

    The Peak Finding Wizard Page Controls

    Selecting the Peak Function

    Click the Set/Modify button to select a fitting function to fit the peak data. You can either select a built-in function, a user-defined function, or a modified built-in or user-defined function. After editing the associateddialog boxes and returning to the Peak Finding wizard page, the functionname displays in the associated view box.

    The Set/Modify button opens the Select Fitting Function dialog box.

  • 7/28/2019 PFM Manual

    53/124

    Peak Fitting Wizard Reference Specifying the Peak Function and Finding the Peaks 47

    The Select Fitting Function Dialog Box

    The Available Functions list box lists the available peak fitting functions.By default, the following peak functions are provided:

    Gaussian Asym2Sig Sine

    Gauss2 Weibull3 SineSqr

    EMGauss LogNormal SineDamp

    Lorentz GCAS Power2

    Voigt ECS Pulse

    PsVoigt1 CCE DLL_Func *

    PsVoigt2 BiGauss

    Pearson7 InvsPoly

    * Note: DLL_Func is a sample peak fitting function provided in anexternal DLL. For more information on using external DLL functions,see "Peak and Baseline Function Reference".

    All built-in functions are included in this list box. To modify the list of functions, edit the [FittingFunctions] section of the PFM.INI file locatedin the Origin software folder. For more information on these functions,see "Peak and Baseline Function Reference".

    When you select a function from the Available Functions list box, theFunction Name, Function Type, # of Parameters, Function Parameters,and Function Description view boxes update to display the respectivefunction information. This information is read from the function's FDFfile located in the \FITFUNC subfolder.

  • 7/28/2019 PFM Manual

    54/124

    48 Specifying the Peak Function and Finding the Peaks Peak Fitting Wizard Reference

    Modifying and Defining New FunctionsClick the Modify button to modify a function listed in the AvailableFunctions list box. Click the Define New Function button to define anew fitting function. Both buttons open a similar dialog box. However,the dialog box is titled and behaves differently depending on whether youare modifying an existing function or defining a new function.

    The Define New Peak Function (or Modify Peak Function) DialogBox

    If you are modifying an existing function, edit this dialog box to renamethe function, initialize the parameters, or define the lower and upper

    bounds. If you are modifying a user-defined function, you can alsomodify the function's definition. However, for built-in functions, youcan not modify the function description.

    If you are defining a new function, edit this dialog box to name thefunction, select the function form, define the function, initialize the

    parameters and define their lower and upper bounds.

  • 7/28/2019 PFM Manual

    55/124

    Peak Fitting Wizard Reference Specifying the Peak Function and Finding the Peaks 49

    Naming the Function

    The Name text box lists the default function name. For new functions,default names like Peak n are suggested. You can modify these names,

    but do not use names that are already in use.

    Selecting the Function FormThere are three forms of user-defined functions available in the Define

    New Peak Function dialog box:Expression: f(x)Script: y=f(x)Conv: y=f(t)*g(x-t)

    ----

    1) Expression

    Define your function in an expression format such as:

    Y0+A*X+B*X*X

    where Y0, A and B are parameters, and X is the independent variable.User-defined functions of this form are fast.

    ----

    2) Script

    This form allows you to define functions with multiple lines andintermediate variables such as:

    temp1=A*X;

    temp2=B*X*X;

    Y=temp1+temp2+C;where temp1 and temp2 are temporary variables. Y is the dependentvariable. The advantage of this form is that you can easily define a largefunction.

    The following example defines a peak function which is a modifiedversion of the Gaussian function.

    y A

    we

    x xcw

    B x xc

    w=

    +

    2

    22 4

    a. Type MyFunc in the Name text box.

    b. Select "Script y=f(x)" from the Form drop-down list.

    c. Type in the following function definition in the Fitting FunctionDefinition text box:

    temp1=(X-XC)/W;

    temp2=temp1*temp1;

    Y=A*exp(-2*(temp2+B*temp2*temp2))/(W*sqrt(PI/2));

    Temp1 and temp2 are temporary variables.

  • 7/28/2019 PFM Manual

    56/124

    50 Specifying the Peak Function and Finding the Peaks Peak Fitting Wizard Reference

    d. In the Names text box for the "Other3" parameter, type B.

    e. In the Init. Values text box for B, type 0.05 .

    f. In the L. Bounds text box for B, type 0.

    g. Make sure that the Use Area in Definition check box is selected as A is the area in this definition.

    h. Click the Save button and then click the OK button to close the dialog box.

    The MyFunc function is now available from the Available Functions list box in the Select Fitting Function dialog box.

    ----

    3) Convolution

    New fitting functions can be defined that are convolutions of built-infunctions. The following example defines a function that is aconvolution of a Lorentzian and Gaussian function (i.e. a Voigt function).

    a. Type MyConv in the Name text box. b. Select "Conv y=f(t)*g(x-t)" from the Form drop-down list.

    c. Type in the following function definition in the Fitting FunctionDefinition text box:

    %func1=gaussian(0,A,wG); /*%func1 is a placeholder.*/

    %func2=lorentz(xc,1,wL);

    y=conv(-100,+100,%func1,%func2,1.0e-3);

    In this example, Gaussian and Lorentz are two built-in functions whichtake three parameters each. In this instance, the independent variable isimplicit. Note that for a function defined as a convolution of twofunctions, certain parameters must be given simplifying values. In thisexample, the Gaussian peak center is set to zero and the Lorentzian areato 1. This is to avoid over-parameterization of the function. Though'[-100,+100]' was chosen as the X range for the convolution in thisexample, any range could be used up to a maximum range of [-1.0e-60,1.0e60]. The last argument in the conv( ) function (1.0e-3) isthe degree of precision used in evaluating the convolution.

    d. Change the name of the Width parameter from w to wG .

    e. In the Names text box for the "Other3" parameter, type wL .

    f. In the L. Bounds text box for wL, type 0.g. Make sure that the Use Area in Definition check box is selected as A is the area in this definition.

    h. Click the Save button and then click the OK button to close the dialog box.

    The MyConv function is now available from the Available Functions list box in the Select Fitting Function dialog box.

  • 7/28/2019 PFM Manual

    57/124

    Peak Fitting Wizard Reference Specifying the Peak Function and Finding the Peaks 51

    Assigning Parameter Names

    Type the parameter names in the Names text boxes provided. The firstthree parameters must be prefixed xc (center), A (area or height), and w (width).

    Note: When the Use Area in Definition check box is selected, the second parameter in the peak function definition is the area of the peak. Whencleared, it is the height of the peak. The default is to use the area.

    Assigning Initial Parameter Values

    Type the initial parameter values in the Init. Values text boxes provided.Use these values to initialize the fitting function.

    Defining the Lower and Upper Bounds

    Type the lower and upper bounds for the parameters in the L. Boundsand U. Bounds text boxes provided. The wizard always presets some

    bounds for the parameters of peak functions. For example, the area (A)and width (w) always have greater-than-zero lower bounds.

    Defining the Fitting Function

    Type the definition of the fitting function in this text box.

    Saving the Function

    Press the Save button to save the current dialog box settings to thefunction definition file. Additionally, the function is added to theAvailable Functions drop-down list in the Select Fitting Function dialog

    box.

    Automatically Finding the PeaksClick the Pick Peaks button to find positive and negative peaks in the

    peak data. Peaks are marked by vertical green lines in the wizard graph.These peak locations provide an estimate of the peak's center and height,which is used for the initial parameter values during the fitting.

    Note: You can add, modify, and delete defined peaks on the next wizard page (Define Peaks).

    1) When the Threshold Height radio button is selected and the Pick Peaks button is clicked, the peak finding algorithm searches thesmoothed second derivative of the peak data looking for peaks that areabove a noise threshold. The noise threshold is the standard deviation of the original peak data, and can be increased or decreased from theassociated combo box to drop or add peaks. (As you increase this value,the algorithm finds less peaks.)

  • 7/28/2019 PFM Manual

    58/124

    52 Adding, Modifying, and Deleting Peaks Peak Fitting Wizard Reference

    2) When the Number of Peaks radio button is selected and the Pick Peaks button is clicked, the peak finding algorithm searches thesmoothed second derivative of the peak data looking for the n tallest

    peaks, where n is specified in the associated combo box.

    After you edit the Threshold Height or the Number of Peaks combo boxes, click the Pick Peaks button to update the wizard with the resultant peak markers. To fine tune the peak finding selection, continue to re-editthe combo boxes and click the Pick Peaks button.

    Note: The Peak Finding wizard supports a maximum of 240 peaks per dataset.

    To improve your view of the peak finding algorithm results, you can

    enlarge a section of your data. To do this, click the Enlarger buttonlocated below the wizard graph and drag a region of interest in the wizardgraph. Buttons are also available to scroll the X axis and to restore thefull axes scale. For a complete discussion of these buttons, see " Adding,

    Modifying, and Deleting Peaks" on page 52. To delete the peak markers, click the Clear All button.

    Defining Peaks from a Data FileTo use a dataset (that is saved as an ASCII file) to define peak locationsin your peak data, click the Read button in the Peak Centers and Heightsgroup. This button opens the Read Peak Centers and Heights dialog box.After selecting your file and clicking the Open button, the wizard graphupdates marking the peaks based on the data file's XY values.This option is most useful when performing peak fitting on similar datasets. After performing peak fitting on the first dataset, the Resultswizard page provides a button for saving the peak centers and heights toan ASCII file. Then when you analyze the next (similar) dataset, click the Read button to access the previously saved peak centers and heightsfor determining the current dataset's peak markers.

    For more information on saving peak centers and heights to an ASCIIfile, see " Saving the Peak Locations to an ASCII File" on page 79.

    Adding, Modifying, and Deleting PeaksAfter defining the peak function and finding the peaks using the wizard'sinternal peak finding algorithm or an ASCII data file, edit the DefinePeaks wizard page to add, modify, or d