Top Banner
© A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine, dissolved in CDCl3 This demonstration develops the inverse relationship between time and frequency as we go back and forth between the FID, which occurs in time (it is time‐domain data) and the NMR spectrum, which is displayed over a frequency axis (it is frequency‐domain data). Weighting functions are developed as a way to decrease the contribution to the spectrum of noise, and to correct for data truncation. They can also be used to enhance resolution, provided the data are of good quality. Improving signal/noise with weighting Again, we begin by acquiring a nice 1‐dimensional spectrum. Now click on the FID display button [1] to look at the corresponding FID (Figure 1 ). Note that the axis is now a time axis [2], and it runs from zero to the value you used as the acquisition time (at ) [3]. For best spectral resolution, the FID should have decayed to zero by the time at ends. However making at much longer collects noise only, and decreases the quality of the spectrum, because every point in the FID is combined to generate each point in the spectrum, by the Fourier transformation. Look at the X‐axis while displaying the FID. Decide at what time the signal is essentially gone, and choose that time for use as your improved acquisition time [4]. Thus, in this instance, a better choice of at is 1.6 seconds. You can make this decision at the same time as you adjust the sweep width, based on a trial spectrum. You can also cause the software to simply not use all of the digitized data as input to the FID, and you can do so in a tapered way. Under Processing>Weighting (Figure 2 , [0]) activate 'Interactive Weighting' [1]. In the graphical display window, the bottom panel shows the FID [2], the middle panel shows the function that will be multiplied point‐for‐point with the FID [3] and the top panel shows what the Fourier transform of this product will be [4]. Neither of the latter two panels display anything yet. Click next to 'sinebell' to activate a sine function [5]. Now the middle panel shows a sine function (Figure 3 , [1]). Click in the upper panel using the RightMouse (RM) [2]. The anticipated spectrum appears as a preview (not shown).
13

Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

Mar 29, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

©A.‐F.Miller WeightingandLinearPrediction

1

Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction

Strychnine,dissolvedinCDCl3

ThisdemonstrationdevelopstheinverserelationshipbetweentimeandfrequencyaswegobackandforthbetweentheFID,whichoccursintime(itistime‐domaindata)andtheNMRspectrum,whichisdisplayedoverafrequencyaxis(itisfrequency‐domaindata).

Weightingfunctionsaredevelopedasawaytodecreasethecontributiontothespectrumofnoise,andtocorrectfordatatruncation.Theycanalsobeusedtoenhanceresolution,providedthedataareofgoodquality.

Improving signal/noise with weighting Again,webeginbyacquiringanice1‐dimensionalspectrum.

NowclickontheFIDdisplaybutton[1]tolookatthecorrespondingFID(Figure1).

Notethattheaxisisnowatimeaxis[2],anditrunsfromzerotothevalueyouusedastheacquisitiontime(at)[3].

Forbestspectralresolution,theFIDshouldhavedecayedtozerobythetimeatends.Howevermakingatmuchlongercollectsnoiseonly,anddecreasesthequalityofthespectrum,becauseeverypointintheFIDiscombinedtogenerateeachpointinthespectrum,bytheFouriertransformation.LookattheX‐axiswhiledisplayingtheFID.Decideatwhattimethesignalisessentiallygone,andchoosethattimeforuseasyourimprovedacquisitiontime[4].Thus,inthisinstance,abetterchoiceofatis1.6seconds.

Youcanmakethisdecisionatthesametimeasyouadjustthesweepwidth,basedonatrialspectrum.

YoucanalsocausethesoftwaretosimplynotuseallofthedigitizeddataasinputtotheFID,andyoucandosoinataperedway.

UnderProcessing>Weighting(Figure2,[0])activate'InteractiveWeighting'[1].Inthegraphicaldisplaywindow,thebottompanelshowstheFID[2],themiddlepanelshowsthefunctionthatwillbemultipliedpoint‐for‐pointwiththeFID[3]andthetoppanelshowswhattheFouriertransformofthisproductwillbe[4].Neitherofthelattertwopanelsdisplayanythingyet.

Clicknextto'sinebell'toactivateasinefunction[5].

Nowthemiddlepanelshowsasinefunction(Figure3,[1]).ClickintheupperpanelusingtheRightMouse(RM)[2].Theanticipatedspectrumappearsasapreview(notshown).

Page 2: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

©A.‐F.Miller WeightingandLinearPrediction

2

Thespectrumthatresultshasdistortedpeakshapes(Figure4[1]).GotoProcess>Display,click'Transform'and'DisplaySpectrum'togetabetterview.Clickon'Transform'inordertoperformanewweightedFouriertransformincorporatingtheweightingfunctionyoujustchose(Figure5).

ThestrongnegativeexcursionsoneachsideofeachsignalarebecausethefirstpointoftheweightedFIDwillbezero,becausethefirstpointoftheweightingfunctioniszero.ThevalueofthefirstpointinthetimedomaindeterminesthetotalintegralunderthespectrumafterFouriertransformation.Thusinthesine‐weightedspectrum,allthepeakshaveasmuchnegativeareaaspositivearea,foratotalareaofzero,intheory.

Topreventthefirstpointfromhavingazerovaluewhilenonethelessexploitingthesinefunction'sdecaytozeroatlongtimes,weshiftit.InProcessing>Weightingactivate'InteractiveWeighting'[1]againandactivate'shift'[2](Figure6).ActivatethespectrumpreviewbyclickinginthetoppanelwiththeRM[3].Forshift,enter‐1*thevalueyouhavenextto'sinebell'.Nowyouseethatthepeaksarebroaderbutnolongerhavenegativedipsonbothsides.Theirintegralsarepositive.Toshiftthesinebellsothatitspeakisattime=0,settheshiftequalto‐1*thesinewidth.

Thelinesarebroadenednowbecausedataarebeingsqueezedtozerobytheweightingfunctionattimeequaltothevalueusedforthe'sinebell'parameter(lookatthetimeaxisinthelowerpaneloftheinteractiveweightingdisplay[4]).

Afterprocessingwithyournewweightingfunction,the'shiftedsinebell',determinethewidthathalf‐heightofthesignalsinthefrequency‐domainspectrumbygoingtoProcess>Cursors/LineLists,andclickingon'Transform'(Figure7).UsethetoolsontheRHStozoominonarepresentativepeak[0],placethecursoronitandclick'Placeonnearestline'[1]then'Showlinewidth'[2].Inthespaceabovethecommandline,aswellastheRHresponseboxatthebottom,thelinewidthathalfheightisprovided(2.55Hz)alongwiththedigitalresolution[3].

Notethatthisscreenalsogivesyouthepossibilityofmakingthechosenlinethecenterofthenextspectrumyoucollect,byclickingon'Movetransmitter'[4].Thiswillchangethevalueoftof(carrierfrequency='transmitteroffset')withoutchangingthesweepwidthsw.

GobacktoProcessing>Weightingandactivate'interactiveWeighting'again.Nowsettheshifttoonly‐1*halfthevalueinsinebell.Thisisa45°shiftedsinebell,asopposedtotheprevious90°shiftedsinebell.Thepeakswillnowbealittleshorter,buttheirlinewidthsshouldbealittlelonger.Thisweightingfunctionalsohasthebeneficialeffectofcancellingout'feet'thatoftenaccompanypeaks,complicatingintegralsandcausingstreaksin2Dspectra.Thus,itisoftenused.

Youcanalsoselectotherweightingfunctions.TheGaussianfunctionandthelinebroadening(anexponentialdecrease)bothhavefullamplitudeatthefirstpointandthereforedonotrequireshifting,althoughshiftingisoftenhelpful(seeabove)andispossiblewiththeGaussian.Trythedifferentoptions!

Page 3: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

©A.‐F.Miller WeightingandLinearPrediction

3

Correcting for short a at with weighting SometimesweintentionallydonotdigitizetheFIDforaslongasittakestodecaytozero.SometimesthisisbecausethesamplecontainsonespecieswithaverylongT2andthatspeciesisnotofinteresttoussowehaveoptimizedtheexperimentparameterinfavourofotherspeciespresent.Sometimesitistokeepthedatasetsizesmallerandeasiertomanipulate(eg.for2Dspectra).TheresultofhavingstoppeddatacollectionbeforetheFIDisreallyoverisshowninFigure8.Inthiscase,theatchosenwaslongerthantheT2ofthemajorconstituentofthesample(strychnine),butitwasshorterthantheT2oftheTMS.Thuswesee'sincwiggles'(feet)atthebaseoftheTMSline[1]whichissharp(longT2).Thesearea'truncationartifact'.(Notethatthelinesofstrychninewhicharebroader(shorterT2)donothavesincwiggles[2].)

Therearetwowaysto'fix'truncationartifactswithoutre‐collectingthedata.Oneistoapplyaweightingfunctionthatcompressesthedatatozeroatthetimewhenthedatacollectionceased.Theotheristoapplylinearpredictiontoextenttheacquireddatawithsynthetic'predicted'data.

Figure9showstheProcesss>WeightinginteractivedisplaywiththetruncatedFID.(Notehowtheoscillationscontinueattheendofthedata.)

ActivateaGaussianweightingfunction(Figure10,[1]),clickinthemiddlepanelusingtheLMtoextendorcompresstheGaussianinteractively[2](thehorizontalpositionofthemousemattersbutnottheverticalpositionwithinthemiddlepanel)andnotetheeffectonthepreviewofthefrequencydomainspectruminthetoppanel[3]oftheinteractiveweightingdisplay.Thesincwigglesaregone,butthesharplineisbroadened.Ineachinstance,youwillhavetodecidewhichismoreimportant:nosincwigglesorsharperlines.

Clickon'Transform'toapplyyournewweightingfunctionandFouriertransformthespectrum.(Figure11[1]).Comparetheresultwiththespectruminfigure8thatwasnotweightedpriortotransformation.

Linear Prediction Iftheatisshorterthanthedecayofthedata,youcanhavesincwiggles.Ifyouwanttoremovethosewithoutbroadeningyourlines,youneedmoretime‐domaindata(narrowerfreq‐domainlinesneedlongertime‐domaindata).

Thesoftware'knows'thatthedatayoucollectedshouldbethesumofmanycosinefunctionseachwiththefrequencyofonepeakandeachdampedaccordingtothatpeak'sT2(1/πΔν).Thus,ifyoutellithowmanystronglinesthereareinyourspectrum(approximately),thesoftwarewillfityouracquireddataintermsofasumofdampedCos'toobtainsetsofνandT2s.(Itwillalsogeneratephasesandamplitudesforeach.)Thenthesoftwareusesthissetofparameterstocalculatewhatthe'ideal'FIDshouldbeforanytimepointsyouwant.IfwewanttoextendashortFID,wewillaskfor'forward'linearpredictionandwewillaskthesoftwaretopredicttheperfectFIDfortimepointsafterwestoppedactuallydigitizingdata.

Page 4: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

©A.‐F.Miller WeightingandLinearPrediction

4

InFigure12,theactualdataareinblackandthepredicteddataareinblue.

Togeneratesynthetic(predicted)pointsthatdoublethedata,gotoProcess>More1D(Figure13).

Anumberofdecisionsarerequired.Weneedtotellthesoftwarewhethertolinearpredictforwardintimeorbackward(parameterlpop='f'or'b')(Figure13[1]).

WeneedtospecifyhowmanypeaksaretobeassumedinfittingourdataandwhichactualdatapointsaretobethebasisforthefittodeterminepeakνandT2foreachpeak.Havingseenyourspectrum,estimatethenumberofstrongpeaks,forexample16(don'tbetoogreedy).Enterthisnextto'coeff'[2](parameter=lpfilt).Forforwardlinearpredictionwedothisbyspecifyingthenumberofpointstobeused[3](parameterlpnuptscanbeaslargeasnp,thenumberofpointsyouhave),andthelastdatapointtobeused(strtlp,'startlp'inFigure13[4]).Thusifyouwanttousepoints1‐609,give609asthenumberofbasispoints[3]and609asthelastpoint[4].(Thisiscalledthe'startingpoint',butthesoftwarelooksbackwardfromthatpointwhendoingforwardlinearprediction.Justoneofthosethings....)

Ifyouchosetosimulate'n'signalsyouwillneedaminimumof2*ndatapoints,butyoushouldreallyuseatleasttwicethatmany.Ichosetogeneratepointsbasedonamodeldominatedby16signals.ThisrequiresthatIuseatleast32pointsasabasisformysimulation.Inourcase,withnicestrongdata,wecanaffordtousemanymorepointsthanthat.TousetheentirefirsthalfoftheFID,use609points,frompoint609backtothestart.

Enterthenumberof'predictedpoints'youwouldliketoaddtoyourFID[5](parameterlpext).TodoublethelengthofyourFIDenterthesamenumberasyouseebelowinthebox'Acquiredpoints'[6].Thisnumberisfixedatthetimeyoucollectdata,itisreportedhereforyourconvenience(parameternamenp).Ifthesearetobeaddedafterthelastactualdatapoint,thenthefirstpredictedpointis1+np.Enterthisvaluenextto'startingat'[7](parameterstrtext).

ThereisanotherchoicerelatedtoyourFouriertransformationoperation.Eventhoughwehavenp=1218,wecanchooseanypoweroftwofortheoutputofourFouriertransform.Touseall1218inputpoints,wewouldchoosetooutputto2048(nextbiggestpowerof2).Whatisdoneisthattheinputisaugmentedto2048pointstoobyadditionofastringofzerosafterthelastdatapoint(zero‐filling).Whenwelinearpredict,wewillbedoingabetterjob,butputtingsimulateddatathereinstead.HoweverifoursimulatedpointsmaketheFIDsomuchlongerthatitnowexcees2048points,wemayincreasetheFouriertransformsizeto4096,or4k[8](parameterfn,orFouriernumber).

Thiswilldeterminethedigitalresolution,thenumberofHzperpoint.Sinceyouwouldlikedigitalresolutionbetterorequaltoyourspectralresolution(thatistosayasmallernumberofHz/point),makefnlargeenoughthatthedigitalresolutionisasmallernumberthan1/2yoursharpestline'swidthathalfheight.ThesevaluescanbecheckedonalinebygoingtoProcess>Weighting,placingthecursoronthe

Page 5: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

©A.‐F.Miller WeightingandLinearPrediction

5

lineandclickingon'DisplayLinewidth'(Figure11[4]).(Alternately,typedres).Youdon'tneedtocollectnewdataiffnistoosmall,justincreaseitandFouriertransformagainbyclickingon'Transform'.

Figure14showsthespectrumthatwasacquiredwithaveryshort0.3sat,butaugmentedwithlinearpredictiontodoubletheFIDlength.Inthiscasenoweightingwasappliedinordertoshowtheeffectoflinearpredictionalone.TheanalogousspectrumthatwasnotlinearpredictedisshowninFigure15.

Togetthebestpossiblespectrumfromtheshort‐atdataset,combinetheuseoflinearpredictionandweighting,byactivatingweightinginthelinearpredictionwindow(Figure15[1]).(gotoProcessing>WeightingtodoubletheGaussianlengthinaccordancewithyournewdoubledFIDlength.IfyouusedashiftedGaussian,alsodoubletheshift.)Youcandoubletheseinthecommandlinebytypinggf=2*gf(GaussianfunctionisnowtwicethepreviousGaussianfunction)andgfs=2*gfs(GaussianshiftisnowtwicethepreviousGaussianshift).

Infigures13,14and15compareboththelinewidthsofthesignalsandthemagnitudeoftruncationartifacts(sincwigglesatthebaseofsharpsignals).

Forcompleteness'sake,Figure16showshowthemeaningsofthelinearpredictionparameterschangewhenoneuseslinearpredictiontofixearlypoints,by'backward'linearprediction(blackdataareactualdatatobeusedasthebasisforafitandbluearedatathatarepredictedandwilloverwritebadinitialdatapoints).Inthiscasethechoiceofthenumberofsignalstomodel('coef'orlpfilt)andnumberofactualdataarethesame,butnowthedatapointstobeusedasthebasisforthefitextendfromthefirstpointtobeused('startingat'=strtlp)outtolatertimesbyanumberofpointscalled'basispts'orlpnpts.Thefirstpredictedpointwillbeat'startingat'(strtext)andwillextendbackwardsforanumberofpointsyouenteras'predictedpoints'(lpext)

Page 6: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction[1]

[2]

[3]

1

[4]

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

[1]

[2]

[3]

[4]

[5]

[0]

2

Page 7: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

[1]

[2]

3

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

[1]

[2]

4

Page 8: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

5

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

[1]

[2]

[3]

[4]

6

Page 9: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

[1]

[2]

[3]

[0]

[4]

7

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

[1]

[2]

8

Page 10: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

9

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

[1][2]

[3]

10

[4]

[5]

Page 11: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

[1]

11

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

12

Page 12: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

13

[1]

[2][3]

[4][5]

[8]

[6][7]

[8]

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

14

Page 13: Practicum 4, Fall 2010 The acquisition time: …...A.‐F. Miller Weighting and Linear Prediction 1 Practicum 4, Fall 2010 The acquisition time: weighting and linear prediction Strychnine,

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

15

[1]

Figure

© A.-F. Miller 2010

Weighting & Linear Prediction

16