• No results found

Extended approach to sum of absolute differences method for improved identification of periods in biomedical time series

N/A
N/A
Protected

Academic year: 2022

Share "Extended approach to sum of absolute differences method for improved identification of periods in biomedical time series"

Copied!
21
0
0

Laster.... (Se fulltekst nå)

Fulltekst

(1)

method for improved identification of periods in biomedical time series

Tomasz Wiktorski

a,

, Aleksandra Królak

b

aDepartment of Electrical Engineering and Computer Science, University of Stavanger, Norway

bInstitute of Electronics, Lodz University of Technology, Poland

abstract

Timeseriesareacommondatatypeinbiomedicalapplications.Examplesincludeheartrate,poweroutput,and ECG.Oneofthetypicalanalysismethodsistodeterminelongestperiodasubjectspentoveragivenheartrate threshold.Whileitmightseemsimple tofindandmeasuresuchperiods,biomedicaldataareoftensubjectto significantnoiseand physiologicalartifacts.Asaresult,simplethresholdcalculationsmightnotprovidecorrect orexpectedresults.Acommonwaytoimprovesuchcalculationsistousemovingaveragefilter.Lengthofthe windowisoftendeterminedusingsumofabsolutedifferencesforvariouswindowssizes.However,forreallife biomedical datasuchapproach mightleadto extremelylongwindows that undesirablyremove physiological informationfromthedata.Inthispaper,we:

propose a new approach to finding windows length using zero-points of third gradient (jerk) of Sum of AbsoluteDifferencesmethod;

demonstratehowthesepoints canbeused todetermineperiodsand areaoveragiventhresholdwith and withoutuncertainty.

WedemonstratevalidityofthisapproachonthePAMAP2PhysicalActivityMonitoringDataSet,anopendataset fromtheUCIMachineLearningRepository,aswellasonthePhysioNetSimultaneousPhysiologicalMeasurements dataset.Itshowsthatfirstzero-pointusuallyfallsataround8and5secondwindowlengthrespectively,while secondzero-pointusuallyfallsbetween16and24and8–16srespectively.Thevalueforthefirstzero-pointcan removesimplemeasurementerrorswhendataarerecordedonceevery fewseconds.Thevalueforthesecond zero-pointcorrespondswellwithwhatisknownaboutphysiologicalresponseofhearttochangingload.

© 2020 The Authors. Published by Elsevier B.V.

ThisisanopenaccessarticleundertheCCBYlicense(http://creativecommons.org/licenses/by/4.0/)

Corresponding author.

E-mail address: [email protected] (T. Wiktorski).

https://doi.org/10.1016/j.mex.2020.101094

2215-0161/© 2020 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license ( http://creativecommons.org/licenses/by/4.0/ )

(2)

article info

Method name: Sum of absolute differences

Keywords: Moving average, SAD, Heart rate, Third gradient, Uncertainty factor

Article history: Received 11 June 2020; Accepted 4 October 2020; Available online 9 October 2020

SpecificationsTable

Subject Area: Computer Science

More specific subject area: Biomedical, time series data analysis Method name: Sum of Absolute Differences Name and reference of original

method: J. Moorer, "The optimum comb method of pitch period analysis of continuous digitized speech," in IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 22, no. 5, pp. 330–338, October 1974.

Resource availability: https://archive.ics.uci.edu/ml/datasets/PAMAP2+Physical+Activity+Monitoringht https://physionet.org/content/simultaneous-measurements/1.0.0/

Methoddetails

Signalsfrom sensors usually containsome amountof noise that canhave a negativeimpact on further data analysis. Usually, such signals are pre-processed with a form of a low-pass filter to removeunwantedelements.Oneofthetypicalandsimplestlow-passfiltersisamovingaveragefilter.

Inthisfilterawindowofacertainlengthiscontinuouslyappliedthroughthesignalandvalueforthe currenttimestepissubstitutedforaverageofcurrentandadjacentsteps.Thelengthofthewindowis decidedeitherusingdomain’sruleofthumborbyusingSumofAbsoluteDifferences(SAD)approach.

However,SADapproachmightleadtotoolargewindowlengthforsomebiomedicalsignals,e.g.heart rate.

In the regular SAD approach, a point is identified at which the SAD curve flattens. This point is then selected as the window length. We propose an extension to the SAD approach with use of third gradient, also called jerk, of the SAD curve. Zero-points of the third gradient become suggested window lengths. First point would be considered a conservative value, which preserves most information, but might also not remove all the noise. While second zero-point would be considered aliberalvalue, whichguaranteesthat mostnoise isremovedwhilestillpreservingmost importantinformation.

Generalapproachtosumofabsolutedifferences

InSADapproach,asetoffilteredversionsofthesignal iscalculatedforvaryingwindowlengths.

Then each offilteredsignals issubtracted fromtheoriginal one, point bypoint. Absolute valuesof eachpointdifferencearethensummed.Thisresultsinsetofsums,eachfordifferentwindowlength.

Thesesumswhenplottedformacurvethatusuallyflattensfromacertainwindowlength,suggesting thatthereisnofurtherfilteringeffectforlongerwindows.Thiswindowlengthisthenselectedasthe optimalforfilteringthesignalforfurtheranalysis.

However, SAD approach might lead to too large window length for some biomedical signals, e.g. heart rate. As we demonstrate inFigs. 1–5 usingPAMAP2[5] datasetand inFigs. 12–14 using

“Simultaneousphysiologicalmeasurementswithfivedevicesatdifferentcognitiveandphysicalloads”

datasetfromPhysioNetdatabase[11,12]theresultingwindowlengthwouldbecome210–230or490–

590srespectivelyforeachdatasetusingtheestablishedapproach.Itisnotonlyintuitivelytoolong, but also wouldmask physiological response to a change in physical exertion that becomes visible in lessthan a minute [9]. Beyond that point a change can still be observed, butit is then related tocardiacdrift whenmaintaininga levelofincreasedexertion[4].Insuchacase, selectingwindow lengthbasedontheSADapproachwouldresultinsignificantlossofinformationintheavailabledata.

The lossof informationisclearlyvisible intheexamples. InFig. 1asignificant increase in heart rateatpointP1fromtheoriginaldatasetcompletelydisappearsafterapplyingMovingAverage(MA) filterwithwindowlength230s,obtainedusingregular SADapproach.Adropinheartratevalueat

(3)

Fig. 1. Heart rate, sum of absolute differences, and heart rate with moving average filter with window length based on usual SAD approach, for Person 1.

Fig. 2. Heart rate, sum of absolute differences, and heart rate with moving average filter with window length based on usual SAD approach, for Person 2.

point P2 isrepresented,butits lowest value isaround 25 bpmhigher thanin theoriginal dataset.

Suchdifferenceisphysiologicallysignificant.

InFig.2wefocusontwosignificantspikesinheartrateatpointsP1andP2.Theirvalueisaround 40 bpmhigherthan thesurroundingvalues.However, afterapplyingMAfilterwithwindow length 230s,thecurvetellsacompletelydifferentstory.PointsP1andP2arepartofaconsistentheartrate increase.Asaresult,filteringmightleadtoacompletechangeintheinterpretationofthesedata.

InFigs.3–5wefurtherobservehowthewrongchoiceofwindowlengthalterscharacteristicpoints of the signal, to an extent that thesepoints blend with the remaining signal. It happens both for spikes anddrops.ForpointP1ineach ofthesethreefigures wenoticethat a strongspikeinheart rateis greatlyreduced.Whilestill visible,ithardly standsoutof thegeneraltrend.ForpointP2in each ofthesethreefigures asignificantdropisreducedtoaminorone.Reductioninrelativevalue, tothespikesthatoftensurroundsuchdrops,rangesbetween50and30bpm.

While itmightseemthatageneralshapeoftheheart ratecurve ispreservedafterapplyingMA filterwithawindowlengthbasedonregularSADapproach,weobservethatmanysignificantdetails are lost. Thisobservationisconsistent withtypical physiologicalresponse ofheart ratethat should be visibleinlessthan aminute[4].Whatsuggests, therefore,thata windowlength foraMA filter shouldnotbelonger.

(4)

Fig. 3. Heart rate, sum of absolute differences, and heart rate with moving average filter with window length based on usual SAD approach, for Person 3.

Fig. 4. Heart rate, sum of absolute differences, and heart rate with moving average filter with window length based on usual SAD approach, for Person 4.

Zero-Pointsofthirdgradient(Jerk)

Ifwe consider continuousfunction g(x), its derivative canbe defined asits rateof changewith respecttovariablex.Iffunctiong(x)isafunctionofonevariable,itsderivativeisthesameaspartial derivative,thatcanbecalculatedasadotproductofthegradientofthefunctiong(x)andunitvector u[1].Incaseofuniformlydistributedtimeserieswithstepequalto1,we canassumethattheunit vectoruisequalto1.Itleadsustoconclusionthat incaseofdiscretefunctiong(i)withsteph=1, itsderivativeisequaltothegradientofthisfunction.

Thefirstgradientofthediscretefunctiong(i)iscalculatedaspresentedinEg.(1)[2]: ˆ

g(i)(1)=g(i+1)g(i−1)

h (1)

Thecalculatedgradientmaybeburdenedwithanerrordefinedbythelimitingbehaviorofastep functionh,denotedby O(h2).Incaseofregularsamplingofthediscretetime seriesg(i)withh=1 thegradientofg(i)canbecalculatedasshowninEq.(2):

ˆ

g(i)(1)=0.5(g(i+1)g(i−1)) (2)

WecandetectfinerchangesinthebehaviorofSADcurve usingzero-pointsofthethird gradient ofthecurve. The thirdgradientofa discrete functiong(i)canbe considered asthe thirdderivative ofg(i),shouldg(i)beacontinuousfunction.Itcan beunderstoodmoreintuitively bycomparisonto thethirdderivativeofpositioninphysics,whichisknownasjerk,thetimederivativeofacceleration

(5)

Fig. 5. Heart rate, sum of absolute differences, and heart rate with moving average filter with window length based on usual SAD approach, for Person 5.

Algorithm 1 Algorithm for calculating first three zero-points of SAD curve for a given signal.

Data : TS := [v1,…vt,…,vT]list of T time-ordered values N := 250 maximum length of SAD curve

Result : ZP := [P1, P2, P3]list of 3 zero-points

1 SAD_curve := [] empty list for values of sum of absolute differences 2 for n in N:

3 SAD_curve.append((n, sum(abs(TS-moving_avg(TS,n)))) 4 3_gradient := gradient(gradient(gradient(SAD_curve))) 5 ZP := where_diff(sign(3_gradient))[:3]

[3].Forexample,theeffectofaccelerationisthefeelingofbeingpressedintotheseatofacar.Ifthe accelerationisnotconstant,wecantalkaboutjerkthatisfeltasanincreasingordecreasingforceon thebody.

Calculationofzerocrossingpointofthethirdgradientoffunctiong(i)canbeexpressedbyEq.(3): izc=ii f gˆ(i−1)(3)>0andgˆ(i)(3)<0orgˆ(i−1)(3)

0andgˆ(i)(3)

0 (3)

Ifthesubsequentzero-pointsarelocatedlessthan3time-stepsapart,thenwesuggestcombining them with the resulting value calculated as a ceiling of an arithmetic mean of these zero-points (Eq.(4)).

izc= iz−c1,iz−c2

(4) InAlgorithm1wepresentanoutlineofasimplealgorithmtocalculatefirstthreezero-pointsof third gradientofSADcurveforagivensignal TS.First,inadditionto theinputsignal,we specifyN asa maximumlengthofSADcurve. Inline1we createanempty listthat willlaterholdvaluesof sumofabsolutedifferencesfordifferentwindowlengthofamoving averagefilter.Thesevaluesare calculatedinlines2and3.

Inline4wecalculatethirdgradientoftheSADcurve.Definitionofgradientfunctionisprovided earlierinthissection andimplementationofsuchfunctionisavailableinmajordataanalyticstools, e.g.inNumPy.Finally,inline5,weextractonlythesignofthirdgradientvaluesandcheckforchange inthissign. Weselectfirstthreesuchplacesinthecurve.Thealgorithmcanbefurtherextendedby combiningzero-pointslocatedcloselytoeachother.

Selectingmovingaveragewindowsizeandcalculatingtypicalmeasures

Later, in method validation, we demonstrate that the first zero-point of jerk corresponds to 5–

8s longwindowformoving averagefilter.Itisthereforesafetoassumethatanysignalvariationin

(6)

that rangewouldbe relatedto simplemeasurement errorswhendataare recordedonce everyfew seconds.Second zero-pointofjerkcorrespondsto16–24swindowformovingaverage.Inthatrange physiologicaleffectshouldalreadybevisible[9].

Asa result,thereareatleasttwovaluesthat couldbeapplied infurtherprocessing.Wesuggest two possible approaches to how these values can be used. First approach uses one of these two zero-points ofjerk asthe window sizefor amoving average filterandany furthercalculationsare performedin astandard wayon the filteredsignal. Second approach isapproximateand combines thetwovaluestogetherwithanuncertaintyfactorinspiredbytheintervaltype-2fuzzysetfootprint ofuncertainty[10].

Twoof themost typical cumulative measures usedto evaluate the conditionofa person based on theheartratetrace are: (1)longestperiodabove thresholdvalue ofHR, and(2)area underthe plotforHRgreaterthanthethresholdvalue.Wepresenthowthesemeasuresareformallycalculated, beforeusingthemforvalidation.

In order to calculatethe longest period above the thresholdvalue throf HR we define Sto be thesetofperiodssmforthetime seriesHR,whereeachsmisaseriesofsubsequentvaluesfromHR havingvaluesHR(i) ≥thr(Eq.(5)). Totalnumberofperiodssm ingivenHRseriesisassumedto be equaltoM.

S=

{

sm

}

Mm=1 (5)

SingleelementsmofsetShaslengthlmthatisdefinedbyEq.(6.):

lm=istopistartwhere

⎧ ⎪

⎪ ⎪

⎪ ⎪

⎪ ⎪

⎪ ⎨

⎪ ⎪

⎪ ⎪

⎪ ⎪

⎪ ⎪

istart=isuchthatHR(i)thrandHR(i−1)<thr istop=isuchthatHR(i)thr andHR(i+1)<thr

i(istart,istop) HR(i)thr istop>istart

i∈[0,I]

(6)

WedefineLasthesetoflengthslm.Thelongestperiodabovethethresholdvalueisdenotedaslmax

andisthemaximumvalueofasetL(Eq.(7)):

lmax=maxL (7)

Energy is considered as the area A under the plot above the threshold value and is calculated as showninEq.(8):

A=

I

i=0

HR(i)≥thr

n·thr (8)

Number of elements in the HR sequence is defined as I and n is the number of samples in sequence HR greater or equal to thr value. Area under the plot can be expressed in beats:

heartrate[bpm]time[min],orheartrate[bpm]time[sec]/60.Incaseoftheareaundertheplotandabove thethresholdvalue,itisequaltothenumberoftotalbeatsoverthethreshold.

In Fig. 6 we present a typical plot of type-2 fuzzy set membership function with footprint of uncertaintyappliedtotwozero-pointsofthirdgradientofSADcurve.

WedefinelengthadjustedbytheuncertaintyfactorasgiveninEq.(9):

ladj=l2·UF+l1 (9)

where:

l1 – lengthofthelongestsegmentabovethethresholdforsamplingtimeequalto1stzero-point ofjerk

l2 – lengthofthelongestsegmentabovethethresholdforsamplingtimeequalto2ndzero-point ofjerk

(7)

Fig. 6. Type-2 fuzzy set membership function with footprint of uncertainty applied to two zero-points of jerk.

WedefineuncertaintyfactorinEqs.(10)and11: UF=sin

α

=a

c (10)

c=

b22+1 (11)

where:

a=1

b1 – distancebetween0andpointP1

b2 – distancebetweenpointsP1 andP2

P1 andP2 – windowsizescorrespondingto1stand2ndzero-pointofjerk

Forexample,forP1=5,P2=22,l1=950,andl2=1298;wehaveb1=5andb2=17andconsequently:

c=

172+1=17.03

UF=sin

α

=1 c =0.06

ladj=0.06·1298+950=1028

WedefineareaadjustedbytheuncertaintyfactorinEq.(12):

Aadj=(A2A1)·UF+A1 (12)

where:

A1– area undertheHR curveabovethethresholdforMovingAveragefilterwithwindowlength equalto1stzero-pointofjerk.

A2– area undertheHR curveabovethethresholdforMovingAveragefilterwithwindowlength equalto2ndzero-pointofjerk.

UsingvaluesfromtheexamplewithA1=66,253,andA2=57,314weobtain:

Aadj=(,573,14−,662,53)·0.06+66,253=65,728

(8)

Fig. 7. Heart rate, sum of absolute differences with third gradient, and heart rate with moving average filter with window length based on second zero-point of third gradient, for Person 1 from PAMAP2 dataset.

Methodvalidation

Wedemonstratethevalidityoftheproposed methodinthreedifferentways.First,weshowthat mostimportantcharacteristicsoftheheartratecurvearepreserved,whenusingfirstorsecondzero- point ofthird gradient of SAD asthe window length for a MA filter. We also make a connection betweenvalues ofthezero-points andphysiological phenomenarelatedtoheart ratedevelopment.

Subsequently, wedemonstrateimprovedresultsincalculating longestperiodovera giventhreshold value,basedonthefiltereddata.Finally,wediscussanimpactofMAfilteringonintegralofheartrate overagiventhresholdvalue.Itisanothercommonstatistic,thatmightbeimpactedinanon-obvious waybyfiltering.

Part1ofvalidation– shapeofHRcurve

We observed earlier, in Figs. 1–5, that applying MA filter with window length obtained using regularSADapproachleadstolossofsignificantdetails inheartratesignal.Moreover,such window lengthappearsalsotoconcealphysiologicalphenomena.

We applied the modified SAD approach using zero-points of third gradient, as defined in the previoussection,tothesamePAMAP2data.Firstthreezero-pointswerecalculated.Forthefirstzero- pointvaluesrangedfrom5to8sfordifferentpersons.Forthesecondzero-pointvaluesrangedfrom 16to24s.Forthethirdzero-pointvaluesrangedfrom21to32s.

It is interesting to notice that all these zero-points lie with the physiological response range for the heart rate [4]. First zero-point is at the very beginning of that range, so it can ensure that all physiological phenomenawill still be visiblein the filtered data. Window withthe length correspondingtothesecondzero-pointoffersmoresmoothing,sinceitisalmosttriplethevalue,but itstillfitswellwithinthephysiologicalrange.Usingthethirdzero-pointmightstillbeuseful,butin somecasesthewindowmightbeconsideredtoolong.Especially,whenitexceeds30s.

Based on these observations, first and second zero-points seem to be of most interest. With first zero-point being a safe choice. While the second zero-point is potentially optimal, balancing smoothingeffectwithdetailpreservation.

InFigs.7–11 weapply themodifiedSADapproachto thesamepersonsfromPAMAP2datasetas inFigs.1–5.Data filteredwithMAfilterwithwindowlengthselected usingstandard SADapproach arepresentedintheleftpartofeachfigure.Firstthreezero-pointsofthirdgradientofSADcurveare calculated andpresentedin themiddle partof each figure.Finally, thefiltered signal usingsecond zero-pointispresentedintherightpartofeachfigure.

We can notice, that in each case the shape of the heart rate curve is well preserved. All characteristicpointsthatweremisrepresentedusingstandardSADapproach,arerepresentedcorrectly withthemodifiedSADapproach.

(9)

Fig. 8. Heart rate, Sum of Absolute Differences with third gradient, and Heart Rate with Moving Average filter with window length based on second zero-point of third gradient, for Person 2 from PAMAP2 dataset.

Fig. 9. Heart rate, sum of absolute differences with third gradient, and heart rate with moving average filter with window length based on second zero-point of third gradient, for Person 3 from PAMAP2 dataset.

InFig.7asignificantincreaseinheartrateatpointP1fromtheoriginaldatasetiswellrepresented applying Moving Average (MA) filter with window length of 8 s, obtained using modified SAD approach.AdropinheartratevalueatpointP2isrepresentedwithlittledifference intheabsolute value.

InFig.8wefocusontwosignificantspikesinheartrateatpointsP1andP2.Theirvalueisaround 40bpmhigherthanthesurroundingvalues.Thischaracteristicispreservedinthesignalfilteredwith windowlengthof25s,correspondingtothesecondzero-pointofthirdgradientoftheSADcurve.So, theinterpretationofthesedataispreservedafterthefiltering.

InFigs.9–11 wefurtherobservehowthewindowlengthcorresponding tothesecondzero-point preservescharacteristics ofthe signal.Bothspikesanddropsmaintaintherightshape.ForpointP1 ineachofthesethreefigureswenoticethatastrongspikeinheartrateispreserved.ForpointP2in eachofthesethreefiguressignificantdropsarereducedonlybyafewbitsperminute.

TheproposedapproachwasfurthervalidatedusingPhysioNetdataset“Simultaneousphysiological measurements withfivedevicesatdifferentcognitiveandphysicalloads”.Resultsforthreeexample subjects are presented in Figs. 12–14. In this case, window length calculated using standard SAD approach waseven longer, ranging from490 to 590 s. We can observe very similar loss of detail asinthecaseofPAMAP2dataset.Manypotentiallyusefulheartratefluctuationsarelost,whileonly generaltrendofheartrateispreserved.

(10)

Fig. 10. Heart rate, sum of absolute differences with third gradient, and heart rate with moving average filter with window length based on second zero-point of third gradient, for Person 4 from PAMAP2 dataset.

Fig. 11. Heart rate, sum of absolute differences with third gradient, and heart rate with moving average filter with window length based on second zero-point of third gradient, for Person 5 from PAMAP2 dataset.

Windowlengthbasedonthe2ndzeropointof3rdgradientofSADcurve rangedfrom8to16s.

Theresultingheartratesignalpreservedallthemajorvariationsoftheoriginal,whileremoving the noise.

Based on the shape of the heart ratecurve, we concludethat using modified SADapproach as proposedintheprevioussection,preservescharacteristicpointsincludingshape,absolutevalue,and relativevalues.

Part2ofvalidation– longestperiod

Heart-rate related measures are one of the most commonly used markers in monitoring performance, fitness and fatigue of a person during physical effort [6]. One of the methods of evaluating person’sfitness andperformance, aswell asplanningphysicaltraining,isbasedonheart ratezones[7].Heartratezonesaredeterminedusingpredefinedpercentageofmaximumheartrate ofaperson.Inautomaticanalysisoftimespendduringextendedphysicaleffortincertainheartrate zone it iscrucial toobtain the wholeperiod ofHR above giventhreshold.Forunfiltered HR signal such periods maybe erroneously divided into shorter segments due to HR sensor inaccuracy ora singlesamplebelowtheselectedthreshold.Application oftheproposed methodallowstominimize oreliminatesucherrors.

Foranaveragemiddleagepersonzone2oftheheartrate, correspondingtothemiddleexercise intensity,isatypicalaerobic target.Thebottomvalue ofheartrateinzone 2isequaltothe60%of a maximum heart rated.We approximate thisvalue to be equal to 105bpm for average young to

(11)

9411 average filter with window length based on second zero-point of third gradient, for Person 1 from simultaneous physiological measurements dataset.

(12)

T.WiktorskiandA.Królak / MethodsX7(2020)101094

Fig. 13. Heart rate, heart rate with moving average filter with window length based on usual SAD approach, sum of absolute differences with third gradient, and heart rate with moving average filter with window length based on second zero-point of third gradient, for Person 2 from simultaneous physiological measurements dataset.

(13)

9413 average filter with window length based on second zero-point of third gradient, for Person 3 from simultaneous physiological measurements dataset.

(14)

Fig. 15. Heart rate: original signal (gray) with highlighted longest period above the threshold (black), signal with moving average filter with window length based on first and second zero-point of third gradient, for Person 1 from PAMAP2 dataset.

Fig. 16. Heart rate: original signal (gray) with highlighted longest period above the threshold (black), signal with moving average filter with window length based on first and second zero-point of third gradient, for Person 2 from PAMAP2 dataset.

Fig. 17. Heart rate: original signal (gray) with highlighted longest period above the threshold (black), signal with moving average filter with window length based on first and second zero-point of third gradient, for Person 3 from PAMAP2 dataset.

middle-agedperson.TheresultsofcalculationsofthelongestperiodofHRseriesabovethethreshold valuethr=105bpmarepresentedinFigs.15–19.Thefirstplotineachfigurerepresentstheoriginal signal, thesecond plotshowstheresults forsignalwithMovingAveragefilterwithwindowlength based on first zero-point of third gradient, while the last plot presentes the signal with Moving Averagefilterwithwindowlengthbasedonthesecondzero-pointofthirdgradient.Incaseofpersons 1,2and5wecanseeasignificantincreaseofthelongestperiodoftheHRseriesabovethedefined

(15)

Fig. 18. Heart rate: original signal (gray) with highlighted longest period above the threshold (black), signal with moving average filter with window length based on first and second zero-point of third gradient, for Person 4 from PAMAP2 dataset.

Fig. 19. Heart rate: original signal (gray) with highlighted longest period above the threshold (black), signal with moving average filter with window length based on first and second zero-point of third gradient, for Person 5 from PAMAP2 dataset.

Table 1

Longest periods of HR above the threshold value, PAMAP2 dataset.

Original signal Filter based on 1st zero-point

Filter based on 2nd zero-point

Filter for 230 Adjusted value

Max. length [ sec .]

Person 1 1371 1371 2558 2539 1489

Person 2 812 810 1103 2018 826

Person 3 606 603 598 797 602

Person 4 310 308 307 527 308

Person 5 946 943 1281 2578 963

thresholdvalueforthesecondzero-pointofthethirdgradient.Thisincreaseisequalto90%,36%and 35%respectively.IncludingtheuncertaintyfactorUFdefinedintheprevioussection,thisincreasewas lower, equalrespectivelyto8%,1.7%and1.8%forpersons1,2and5,asshowedinTable1.

Incaseofperson1wecanobserveadropintheheartratearound2600s.,howevertheheartrate drops slightlybelow thethreshold,by about1–2 bpm.The behavior ofthe HRcurve suggests that thisdecreaseisinsignificantandshouldnotinfluencetheperiodofheartrateabovethethresholdof 105bpm.Incaseoftheoriginalsignalandsignal filteredusingwindowlengthcorrespondingtothe firstzero-pointofthethirdgradient,thisdecreaseintheheartrateisreducingtheperiodoftheHR abovethethresholdbyalmosthalf,fromabout43minto22min,whatcanbecrucialduringtraining ofamiddleagedperson.

Casesforperson2andperson5aresimilar,intermsofaslightandshortdecreaseofheartrate,to person1.InbothcasestheHRdropbelowthethresholdisby1–2bpmandshouldnotbeconsidered

(16)

Table 2

Longest periods of HR above the threshold value, simultaneous physiological measurements dataset.

Original signal Filter based on 1st zero-point

Filter based on 2nd zero-point

Adjusted value

Max. length [ sec .]

Person 1 161 161 262 172

Person 2 93 210 318 217

Person 3 123 245 262 247

inthedeterminationofthevalueofthelongestperiodabove105bpm.Theincreaseofthisperiodfor persons2and5forfilteredsignalwithwindowlengthequaltothesecondzero-pointisnotaslarge asincaseofpersonone,butstillsignificant,equaltoaround5min.

Forpersons 3and4 theproposed methoddid not influencethe lengthof thelongest periodof heartrateabovethe threshold.BothHRcurvesshow momentsofdecreasedactivity, lastingforfew seconds,beforetheconsideredperiodincaseofperson3,andaftertheconsideredperiodincaseof person4.

Itisclearlyvisiblethatthelongestperiodabovethethresholdvaluecalculatedforwindowlength equalto 230issignificantly longerin caseof persons1,2,3and5.Forperson1 thisvalueis very similartotheresultcalculatedforthewindowlengthcorrespondingtothesecondzero-pointofthe thirdgradient.However, incaseofpersons2and5thesevaluescannotbe takenintoconsideration inanalysisoftheheartrateintermsofperson’sperformanceandfatigue.Aswecanobserveonthe firstplotofFigs.16and19,therearesegments ofreducedHR:forperson2thissignificantdecrease ofheartrateispresentinsegmentbetween2000s.and2800s,whileincaseofperson5theperiodof restoccursbetween2600s.and2900s.InTable1wecanseethattheincreaseoftheperiodlengthfor person2isby15minincomparisontotheresultforthewindowlengthbasedonthesecondzero- pointandby20minincomparisontothevalueobtainedfortheoriginalsignal.Incaseofperson5 thesedifferencedare evenmoresignificant,equalrespectivelyto21 minand27 min.Differencesat thislevelofvaluesmakefilteringofthesignalwithwindowlengthof230unreliable.

ThemethodwasalsovalidatedusingPhysionetdataset“Simultaneousphysiologicalmeasurements with five devices at different cognitive and physical loads”. The threshold was set to 95 bpm to evaluate the heart rate signal recorded during the period of five-minute walking on the treadmill atamoderatespeed.AsitcanbeobservedinFigs.20–22,thesignalisveryirregular.Incaseofthe original signals theelevated pulse wasevaluated to last forlessthan 3 minin all three cases.For thesignalsprocessedusingfiltersbasedonthesecond zero-pointofthethirdgradienttheresulting longest period increased by 38%, 70% and 53% for persons 1, 2 and 3 respectively. Including the uncertaintyfactor UFdefinedintheprevious section, thisincrease waslower, equalrespectivelyto 6%,68%and17%,asshowedinTable2.

The longestperiodabove thethresholdvalue calculated forwindowlength equalto540 forthe three analyzed signals is presented in Fig. 23. It can be observed that the signal is significantly smoothed, and its level decreased, what resulted in identification of the region of interest to the incorrectsignalpart,namelytheregionwhenthepersonsperformeduphillwalkingonthetreadmill.

Therefore,considerationofthelongestperiodabovethethreshold,aswellasthearea undertheHR curveandabovethethresholdincaseofthewindowofsuchlargelengthispointless.

Part3ofvalidation– areaunderthecurve

Oneoftheparametersrecommendedinanalysisofserialmeasurementsinmedicalresearchisarea underthecurve.It canbeinterpretedasakindofweightedaverageoftheanalyzedsignal andcan beusedforfindingandevaluatingpatternsamonggroupsofmonitoredpatients[8].Theareabetween theHRcurveandthethresholdlinewascalculatedfortheoriginalsignal,signalwithMovingAverage filterwithwindowlengthbasedonfirstandsecondzero-pointofthirdgradient,andlengthequalto 230.ObtainedvaluesarepresentedinTable3.Wecanobservethatfortheoriginalsignalandsignals withapplied MovingAveragefilterwithwindow length basedon firstzero-point ofthird gradient, arealmostthesame,withthedecreasingtendencyforincreasingthewindowlength.Thereasonfor

(17)

9417 Fig. 20. Heart rate: original signal (gray) with highlighted longest period above the threshold (black), signal with moving average filter with window length based on first and second zero-point of third gradient, for Person 1 from Simultaneous Physiological Measurements dataset.

(18)

T.WiktorskiandA.Królak / MethodsX7(2020)101094

Fig. 21. Heart rate: original signal (gray) with highlighted longest period above the threshold (black), signal with moving average filter with window length based on first and second zero-point of third gradient, for Person 2 from simultaneous physiological measurements dataset.

(19)

Fig. 22. Heart rate: original signal (gray) with highlighted longest period above the threshold (black), signal with moving average filter with window length based on first and second zero-point of third gradient, for Person 3 from simultaneous physiological measurements dataset.

Fig. 23. Signal with moving average filter with window length of 540 s, for Persons 1, 2 and 3 from simultaneous physiological measurements dataset.

Table 3

Area under the HR plot and above the threshold value, PAMAP2 dataset.

Original signal Filter based on 1st zero-point

Filter based on 2nd zero-point

Filter for 230 Adjusted value

Area [heart beats]

Person 1 34,235 34,233 79,858 76,390 38,772

Person 2 29,003 28,811 34,178 12,131 29,106

Person 3 23,674 23,604 23,451 18,692 23,588

Person 4 6385 6380 6365 8416 6378

Person 5 40,679 40,611 46,426 66,376 40,952

itisthefactthat thelevelofthesignal decreaseswiththeincreaseofthelengthofthewindow.In caseofthefilterbasedonthesecondzero-pointofthethirdgradienttheareaundertheHRplotand abovethethresholdvaluearesignificantlyincreasedincaseofpersons1,2and5,whatisaresultof theincreaseofthevalueofthelongestperiodabovethethresholdvalue.Thesignificantdifferenceis visiblefortheMovingaveragefilterwithwindowoflength230,wherethevaluesoftheareaunder theHRcurvedecreasesby10–20%forpersons3and4.Loweramplitudesofthefilteredsignalcanbe observedinFigs.15–19,whatisalsovisibleinvaluesofthetotalareaundertheHRplotaspresented inTable4.

Obtained results show that proposed method of filtering does not affect significantly the area undertheHRcurveandthisparametercanbeusedinanalysisofthetimeseries.Ontheotherhand, we canseethat filteringaffectstheamplitudeofthesignalandapplyingMovingAveragefilterwith

(20)

Table 4

Area under the HR plot, PAMAP2 dataset.

Original signal Filter based on 1st zero-point (decrease [%])

Filter based on 2nd zero-point (decrease [%])

Filter for 230 (decrease [%])

Area [heart beats]

Person 1 467,396 466,812 (0.12%) 465,647 (0.37%) 439,685 (5.93%) Person 2 410,011 408,778 (0.30%) 404,328 (1.39%) 356,012 (13.17%) Person 3 380,245 379,699 (0.14%) 378,606 (0.43%) 352,732 (7.24%) Person 4 302,638 301,955 (0.23%) 301,073 (0.52%) 280,685 (7.25%) Person 5 470,828 470,393 (0.09%) 46 8,573 (0.4 8%) 4 4 4,873 (5.51%)

Table 5

Area under the HR plot and above the threshold value, simultaneous physiological measurements dataset.

Original signal Filter based on 1st zero-point

Filter based on 2nd zero-point

Adjusted value

Area [heart

beats] Person 1 900 897 1164 926

Person 2 548 967 1346 993

Person 3 482 822 829 823

Table 6

Area under the HR plot, simultaneous physiological measurements dataset.

Original signal Filter based on 1st zero-point

Filter based on 2nd zero-point

Filter for 540

Area [heart beats]

Person 1 179,939 179,353 (0.33%) 178,396 (0.86%) 122,789 (31.76%) Person 2 207,506 206,904 (0.29%) 205,481 (0.98%) 151,770 (26.85%) Person 3 167,675 167,232 (0.26%) 166,240 (0.86%) 113,015 (32.59%)

long windowisnot recommendedasit significantlyaffects thearea underthecurve. Thisproblem mightmanifestoftenwhenmeasuringheartrateunderaloadlastingmorethanseveralminutes.Due toaforementioned cardiacdrift, averageheartratewillincrease withtimeeven withoutchangesto the exerciseload. It will resultinthetime series ofheartratebecoming non-stationary. What will leadtodistortionofmeasurementsifaMovingAveragefilterwithlongwindowisapplied.

The area under the HR plotand above the thresholdvalue, as well asthe total area under the HRplot,wereevaluatedalsoforthePhysioNetSimultaneousPhysiologicalMeasurementsdatasetand arepresentedinTable5andTable6.Itisclearlyvisiblethat forall theanalyzedsignalsthereisan increase of thearea under theHR plot andabove thethreshold value asthe length ofthe longest periodabove thethresholdincreasesasaresultofapplyingthefilterbasedonthefirstandsecond zero-pointofthethirdgradient.

ThevaluesofthetotalareaundertheHRplothaveslightlydecreasingtendencyasthesizeofthe windowincreases,howeverthisdecreaseisnot verysignificantforthefiltersbasedonthefirstand second zero-pointofthethird gradient.Itismuchgreaterincaseofthewindowsize of540andis equalto20–30%,asitcanbeseeninTable6.

Concludingremarks

Sumofabsolutedifferencesisan established approachtoselecting windowlength foramoving average filter. The underlying properties of a process generating the data might, however, render results of such approach detrimental to further analysisfor some signals.Biomedical signals,such as heart rate, are a good example, since underlying physiology is often well understood. As we demonstrated regular SADapproach resultsin longwindows that undesirablyremove physiological informationfromthedata.

(21)

The authors declare that they have no known competing financial interests or personal relationshipsthatcouldhaveappearedtoinfluencetheworkreportedinthispaper.

References

[1] A. Quarteroni , R. Sacco , F. Saleri , Numerical Mathematics (Texts in Applied Mathematics), Springer, New York, 2007 . [2] R. Wrede , M.R. Spiegel , Advanced Calculus, 3rd ed., 2010 Schaum’s Outline Series. ISBN 978-0-07-162366-7 . [3] Eager David , et al. , Beyond velocity and acceleration: jerk, snap and higher derivatives, Eur. J. Phys. 37 (2016) 065008 . [4] A . Jeukendrup, A .V. Diemen, Heart rate monitoring during training and competition in cyclists, J. Sports Sci. 16 (sup1)

(1998) 91–99, doi: 10.1080/026404198366722 .

[5] A. Reiss, D. Stricker, Creating and benchmarking a new dataset for physical activity monitoring, in: Proceedings of the 5th International Conference on PErvasive Technologies Related to Assistive Environments, 40, New York, NY, USA, 2012 1-40:8, doi: 10.1145/2413097.2413148 .

[6] C. Schneider , et al. , Heart rate monitoring in team sports—A conceptual framework for contextualizing heart rate measures for training and recovery prescription, Front. Physiol. 9 (2018) 639 .

[7] E.V. Neufeld , J. Wadowski , D.M. Boland , B.A. Dolezal , C.B. Cooper , Heart rate acquisition and threshold-based training increases oxygen uptake at metabolic threshold in triathletes: a pilot study, Int. J. Exerc. Sci. 12 (2) (2019) 144 .

[8] J. Matthews , D.G. Altman , M. Campbell , P. Royston , Analysis of serial measurements in medical research, Bmj 300 (6719) (1990) 230–235 .

[9] D. Velicka , Z. Kairiukstiene , K. Poderiene , A. Vainoras , J. Poderys , Interaction between cardiac functional indices during incremental exercise test reveals the peculiarities of adaptation to exercising, Medicina (B Aires) 55 (7) (2019) 314 . [10] L.A. Zadeh , The concept of a linguistic variable and its application to approximate reasoning, in: Learning Systems and

Intelligent Robots, Springer, 1974, pp. 1–10 .

[11] M. Vollmer, D. Bläsing, E. Reiser J, M. Nisser, A Buder, Simultaneous physiological measurements with five devices at different cognitive and physical loads (version 1.0.0), PhysioNet (2020) Available from: https://doi.org/10.13026/chd5-t946 . [12] Goldberger A., Amaral L., Glass L., Hausdorff J., Ivanov P.C., Mark R., Mietus J.E., Moody G.B., Peng C.K., Stanley H.E.

PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals.

Circulation [Online]. 101(23)(20 0 0), pp. e215–e220.

Referanser

RELATERTE DOKUMENTER

where Intake_diff is a sheep’s difference in intake (kg) between contaminated and clean silage during one session (i.e., intake of contaminated minus intake of clean, in kg),

The partial avoidance of WP contaminated water found in this study should reduce the risk of sheep being poisoned while grazing military training ranges; however, the danger

WS-Discovery defines a multicast protocol using SOAP over UDP to locate services, a WSDL providing an interface for service discovery, and XML schemas for discovery messages.. It

COMMUNICATION SIGNAL GENERATION AND AUTOMATIC CLASSIFICATION WITH DETECTION OF UNKNOWN FORMATS USING NEURAL NETWORKS.. IVERSEN Alexander,

The dense gas atmospheric dispersion model SLAB predicts a higher initial chlorine concentration using the instantaneous or short duration pool option, compared to evaporation from

Figure 5.3 Measured time series of the pressure for HK 416 N at two different directions from the shooting direction, with and without flash suppressor, at 84 cm from the muzzle..

The samples include a carbon fiber epoxy composite and a sandwich-structured composite panel with an aramid fiber honeycomb core in between two skin layers of fiberglass

Combining infliximab with clinical relevant concentrations of hydrocortisone resulted in additive effects on several cytokine concentrations in plasma after a challenge with LPS..