WO2004019775A2 - Capture detector - Google Patents

Capture detector Download PDF

Info

Publication number
WO2004019775A2
WO2004019775A2 PCT/EP2003/009520 EP0309520W WO2004019775A2 WO 2004019775 A2 WO2004019775 A2 WO 2004019775A2 EP 0309520 W EP0309520 W EP 0309520W WO 2004019775 A2 WO2004019775 A2 WO 2004019775A2
Authority
WO
WIPO (PCT)
Prior art keywords
signal
event
events
ecg
self
Prior art date
Application number
PCT/EP2003/009520
Other languages
French (fr)
Other versions
WO2004019775A3 (en
Inventor
Chris De Voir
Richard A Schomburg
Dirk Müssig
Volker Lang
Original Assignee
Biotronik Gmbh & Co. Kg
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Biotronik Gmbh & Co. Kg filed Critical Biotronik Gmbh & Co. Kg
Priority to EP03747937A priority Critical patent/EP1536860A2/en
Priority to AU2003267019A priority patent/AU2003267019A1/en
Publication of WO2004019775A2 publication Critical patent/WO2004019775A2/en
Publication of WO2004019775A3 publication Critical patent/WO2004019775A3/en

Links

Classifications

    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61NELECTROTHERAPY; MAGNETOTHERAPY; RADIATION THERAPY; ULTRASOUND THERAPY
    • A61N1/00Electrotherapy; Circuits therefor
    • A61N1/18Applying electric currents by contact electrodes
    • A61N1/32Applying electric currents by contact electrodes alternating or intermittent currents
    • A61N1/36Applying electric currents by contact electrodes alternating or intermittent currents for stimulation
    • A61N1/362Heart stimulators
    • A61N1/37Monitoring; Protecting
    • A61N1/371Capture, i.e. successful stimulation
    • A61N1/3712Auto-capture, i.e. automatic adjustment of the stimulation threshold
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61NELECTROTHERAPY; MAGNETOTHERAPY; RADIATION THERAPY; ULTRASOUND THERAPY
    • A61N1/00Electrotherapy; Circuits therefor
    • A61N1/18Applying electric currents by contact electrodes
    • A61N1/32Applying electric currents by contact electrodes alternating or intermittent currents
    • A61N1/36Applying electric currents by contact electrodes alternating or intermittent currents for stimulation
    • A61N1/362Heart stimulators
    • A61N1/37Monitoring; Protecting
    • A61N1/371Capture, i.e. successful stimulation

Definitions

  • the present invention relates to a device for obtaining and recognizing a sensed myocardial signal, in particular a signal related to cardiac stimulation. More particularly, the present invention relates to a detector for use in an implantable medical device for electrostimulation of the heart, such as a pacemaker or a cardioverter/defibrillator (ICD), or in a programmer for such device so that the detector may determine capture based on the signal morphology of a surface electrocardiogram (ECG). Even more, the present invention also relates to a detector for use in an implantable cardiac electrostimulation device so that comprising such a capture detector so that the detector may determine capture based on the signal morphology an intracardiac ECG. Even more particularly, the present invention also relates an implantable cardiac electrostimulation device comprising such a capture detector so that captured and non- captured events may be discriminated.
  • an implantable cardiac electrostimulation device comprising such a capture detector so that captured and non- captured events may be discriminated.
  • Capture refers to the process of applying an artificial stimulus of sufficient amplitude to myocardial tissue to result in contraction of the tissue.
  • the artificial stimulus is, in most cases, an electrical stimulus not provided by the body's electrical system.
  • Capture is an important and well-known feature that is utilized routinely in implantable devices for electrostimulation of the heart.
  • a stimulation resulting in capture exceeds the so-called “capture threshold.”
  • a successful stimulation is referred to as a "capture event " An unsuccessful stimulation, that is, one that does not exceed the capture threshold, is referred to as a "non-capture event".
  • the ability to detect capture events in the heart is important to the design of an implantable automated cardiac electrostimulation device, because only by detecting capture can one be certain that a stimulation pulse has been successful, the act of capture embodying the definition of successful cardiac stimulation.
  • the implantable devices be- come more and more sophisticated, they approach becoming a perpetually an-duty "cardiologist in the Patient" to detect rhythm abnormalities, to effectively treat the rhythm abnormality, and then to cease treatment when the abnormality has been corrected.
  • Devices for the initial detection of the abnormality are known in the prior art.
  • a capture detector and an implantable electrostimulation device that incorporates the mathematical modeling concepts described in more detail below for detecting capture events in myocardial tissue.
  • a medical device comprising
  • electrode connectors adapted to connect the medical device to intracardiac electrodes and to transmit electric stimulation pulses to electrode surfaces on the intracardiac electrodes and to receive electric signals sensed by electrode surfaces
  • a stimulation unit adapted to generate stimulation pulses and being connected to at least one electrode connector
  • an amplifier and filter unit connected to at least electrode connector and being adapted to amplify and filter sensed electric signals
  • control unit being connected to the stimulation unit, the analog to digital converter and a data memory, the data memory being adapted to store a program for controlling of the control unit and to store event data derived from data received via the analog to digital converter.
  • the program is designed to enable the control unit to carry out a method for capture recognition via evaluation of a signal representing an electro cardiogram (ECG), said ECG comprising ECG signal sections corresponding to paced of spontaneous cardiac events.
  • ECG electro cardiogram
  • the device preferably is a implantable medical device, in particular a cardiac pacemaker.
  • the method comprises
  • a first reference event signal is derived by analyzing measured
  • a second reference event signal is derived by analyzing measured ECG data corresponding to spontaneous events and
  • an event classification phase wherein signal sections representing cardiac events of a given or measured ECG signal are classified by correlating the ECG signal section to one of at least two classes of events, the first event class representing paced events and the second event class representing spontaneous events, wherein the classification comprises the step of comparison of the signal sections of the given or measured ECG signals with both, the first and the second reference events, whereby during the step of comparison it is determined, whether characteristics of the signal section to be classified are closer to characteristics to the first of the second reference event, respectively.
  • correlating is not limited to using a correlation function in a mathematical sense but shall include any form of logical association or assignment of a signal section to a given event class. This will become clear from the following description of a preferred embodiment.
  • the objects of the invention are also achieved by the afore mentioned capture detection method for a capture detector and an implantable electrostimulation device.
  • characteristic signal parameters are preferably one or more of the group of: signal amplitude, signal morphology, and signal time delay.
  • a method for adjusting a pacing output amplitude comprising in an event classification phase following the reference definition phase the steps of:
  • a pacing output amplitude change is smaller than a predetermined accuracy limit, stop the pacing output adjustment procedure.
  • Pacing output amplitude adjustment shall have the effect that the pacing amplitude is high enough to ensure reliable pacing of the myo- card above a capture threshold without being higher than necessary. To high a pacing output amplitude would only result in an unnecessary waste of energy in view of the limited energy resources of an implantable device, without any further benefit.
  • the method for adjusting a pacing output amplitude may preferably include the step of reporting a pacing threshold if a pacing output amplitude change is smaller than a predetermined accuracy limit.
  • the objects of the invention are achieved by a medical device for capture recognition via evaluation of a signal representing an electro cardiogram (ECG), said ECG comprising ECG signal sections corresponding to paced of spontaneous cardiac events.
  • ECG electro cardiogram
  • the device comprises
  • reference event definition means for defining at least two reference event signals by analysis of measured ECG data during a reference definition phase, the reference event definition means being adapted
  • event classification means being adapted to classify signal sections representing cardiac events of a given or measured ECG signal by correlating the ECG signal section to one of at least two classes of events, the first event class representing paced events and the second event class representing spontaneous events during a event classification phase.
  • the event classification means comprises a comparator being connected to the data memory and being adapted to compare a signal section of the given or measured ECG signals with both, the first and the second reference events stored in the data memory, wherein the com- parator is adapted to determine, whether characteristics of the signal section to be classified are closer to characteristics to the first of the second reference event, respectively.
  • the device is a detector for use in a programmer or a programmer for a medical device such as an implantable cardiac pacemaker or cardioverter/defibrillator.
  • the device is an implantable cardiac pacemaker or cardioverter/defibrillator.
  • a capture detector which first carries out at reference definition thereby creating at least two reference event signals and later on relies on these reference event signals for classification of a detected event, the latter being a section of an ECG signal.
  • a method for operating a capture detector of a medical stimulation device comprising two phases, a reference definition phase and a event classification phase,
  • said reference definition phase comprises the steps of:
  • said event classification phase comprising the steps of:
  • Such method and a capture detector based on said method as well as a medical electrostimulation device incorporating such capture detector allow for both, reliable capture detection and an reliable automatic pacing output amplitude adjustment.
  • Fig. 1 a composite reference event signal as derived by the method and the device of the invention
  • Fig. 2 a flow diagram of the claimed capture detection method and algorithm
  • Fig. 3 a graph describing the classification criteria within the measurement window (MW);
  • Fig. 4 the outcome of an event classification according to the invention.
  • Fig. 5 a schematic drawing of an implantable device according to the invention
  • Fig. 6 a schematical drawing of an alternative embodiment of the invention including an implantable device, in particular a pace maker, and a programmer being able to interact with the implantable device via telemetry.
  • FIG. 5 is a schematic representation of an implantable device accord- ing to the invention.
  • the implantable device 10 may be a cardiac pacemaker or a cardioverter/defibrillator or both.
  • the implantable device 10 can be connected to an electrode line via a connector (not shown).
  • the electrode line serves to sense electrical potential of the myocard and to deliver them to the implantable device 10.
  • This sensed electrical signals are amplified and filtered by an amplifier and filter section 12 of the implantable device and thereafter converted from analogue to digital by an analogue to digital converter 14.
  • the digitally sampled signal is fed to a detector unit 16 of the implantable device.
  • the detector unit 16 cares a reference event definition unit 18 and a signal classification unit 20. Both share common memory 22 for program code and data.
  • the signal classification unit 20 and the reference event definition unit 18 are realised in form of program code as given by the capture detection algorithm listed herein after.
  • the detector unit 16 therefore is part of a microcontroller in combination with a pro- gram enabling the microcontroller to act as detector unit.
  • a reference event definition phase only the reference event definition unit 18 is active. Samples of measured ECG data corresponding to paced events are fed to the reference event definition unit 18. From these data the reference event definition unit 18 calculates a composite first reference event signal representing paced events.
  • the reference event signal is described by three main criteria which are
  • the reference event definition unit 18 is also fed with spontaneous events and derives there from a composite reference event as a second reference event signal characterising spontaneous events.
  • the second reference event signal is char- acterised by the same criteria as the first reference event signal.
  • the two reference event signals or the values of the criteria describing these reference event signals, respectively, are stored in memory 22.
  • each sampled signal section coming from analogue to digital converter 14 is fed to the signal classification unit 20, which compares the characteristics of these signal sections with both, the first reference event signal and the second reference event signal and delivers an outgoing signal, depending on whether the signal section matches the first reference event signal or the second reference event signal or non of both. If the signal section to be classified matches the first reference event signal indicating a paced event a signal is fed to a stimulation unit 24 indicating, that a pacing output amplitude is above an excitation threshold of the myocard.
  • the stimulation unit 24 has sent a signal to the signal classification unit 20 indicating that the pacing stimulus was put out and the signal classifi- cation unit 20 in term determines, that the resulting ECG signal section does not match the first reference event signal indicating capture, then the pacing output amplitude is to be adjusted to a higher value.
  • the stimulation unit 22 of cause is connected to the connector for an electrode line to feat stimulation pulses to a stimulation electrode in a heart.
  • figure 5 shows an implantable medical device like a pace- maker with a built in detector unit
  • an implantable medical device 32 comprising a general control unit 34 being connected to a transceiver 36 is able to wirelessly communicate with the external programmer 30.
  • the external programmer 30 comprises a transceiver section 38 imaging the transceiver 36 of the implantable device 42.
  • the reference event definition unit 18 and the signal classification unit 20 receive intracardiac electrocardiograms.
  • a programmer may be designed to receive surface electrocardiograms since calculation of an adequate pacing output amplitude is done in the external programmer and successful stimulation resulting in a capture event can be judged from the surface electrocardiogram as well.
  • the present invention is a device that incorporates the results of mathematical modeling of the excitation mechanism of myocardial tis- sue.
  • One such mathematical model is the model developed by D. Mues- sig and B. Hensel of the Department of Biomedical Engineering at Frie- drich-Alexander University, Er Weg, Germany, and to be reported as "Mechanism for the Excitation of Myocardial Tissue: Results Based an a Three-Dimensional Numerical Model" in the September, 2002, issue of Progress in Biomedical Research. A pre-publication copy of the article is attached hereto and made a part hereof by incorporation.
  • An algorithm performing this function must contend with numerous interfering factors, and perform as accurately as an experienced human observer. Practical application requires that the algorithm has minimal effect on current consumption of the implant device, and be compatible with (and simplify the procedure for) many device types.
  • the capture detection algorithm is written in an object- oriented language (see Python 2.1.3. programming language. Reference manual available from: URL: http://www.python.org/) using a integrated development environment (IDE) (see Komodo integrated development environment. Active State, USA. Reference manual available from: URL: http://www.activestate.com/). Simulations were performed on a standard desktop computer.
  • the input data are pacemaker threshold tests formated as four channels (one marker, three surface ECG) from the ECG output of a pacemaker programmer (TMS1000, Biotronik) sampled at 1024 Hz and 12 bits per channel (DAQCard700, National Instruments, USA).
  • Pacemaker implant follow-up is the setting intended for the use of CDA.
  • the CDA will be integrated into the programmer soft- ware.
  • the requirements for the operation of the CDA are as follows.
  • the CDA requires a start signal from the user, and outputs termination, and error signals that communicate completion of classification or the need for operator intervention.
  • the CDA must have access to the programmed values for pacing rate and AV- delay to set the appropriate measurement window (MW) length.
  • the CDA must also receive pace, sense markers, and a time- sampled ECG data stream of at least one channel. Additional simultaneous ECG channels can also be used.
  • the CDA provides two outputs.
  • the principal output of the CDA is an event-by-event classification of capture/non-capture. This datum is used for adjusting subsequent pacing output voltage in the search for a threshold.
  • Second, error conditions are returned by the CDA to inform the operator of the need for adjustment of the pacemaker to control the rhythm, or that signal input is compro- mised.
  • the CDA operates in two main phases, a reference definition phase, and an event classification phase.
  • the reference definition phase collects two sets of reference events, spontaneous rhythm events, and unequivocal pacer-controlled rhythm events. Obtaining the latter may require adjustment of the basic pacing rate and the
  • FIG. 1 An example of a reference pacing event (composed from the individual events in a paced rhythm) is shown in Figure 1.
  • the reference definition phase starts a continual noise threshold calculation from sample-by- sample data.
  • Implanted devices were Actros SR(2), Actros DR (2), Dromos DR (3), Philos DR (6), Tachos DR (1 ), Gemnos IV (1 ), MycroPhylax (1 ), and Phylax XM (1 ). All devices were equipped with a bipolar lead. The time from implantation to data collection ranged from 5 to 1961 days with a median of 495 days.
  • the accuracy of the CDA was verified by a comparison of algorithm results with an event-by-event human review of the above pacing threshold test clinical data using the following methods.
  • the defining criteria for each event occurs in an MW, which is the time window comprising 512 ms for atrial pacing and 256 ms for ventricular pacing.
  • the MW commences with the pacing marker and terminates after the defined number of samples in the ECG chan- nel under consideration.
  • the three main criteria that define an event are
  • PD is defined as time from the pacing marker to the most prominent peak found within the MW.
  • a paced event earlier than the PD range is premature; if later than the PD range or entirely absent from the MW it is considered late.
  • the SA is the voltage potential from the isoelectric line to the most prominent peak in the MW.
  • An event in the classification phase must exceed the noise threshold (NT) and approximate the mean amplitude of the reference events.
  • Signal shape is the similarity of the morphology of the event to that of the reference events formed during the definition phase. Therefore, the reference definition phase (the initial ten pacing events) is inspected to familiarize the human reviewer with the fundamental timing relationships and morphologies used to analyze subsequent events in the event classification phase.
  • the classification phase follows, and the human reviewer observes pacing and sensing markers while comparing each marked event with the criteria determined in the definition phase.
  • the reviewer understands that the pacing output volt-age is being systematically reduced, thus, the ECG record evolves to non-captured events.
  • FIG. 3 An example of a ventricular paced reference event is shown in Figure 3.
  • Figure 4 shows some outcomes of event classification, the results of which are tabulated in Table 1.
  • the first marker identifies the ECG event as paced.
  • the human reviewer it is 'on- time', of typical amplitude, and shape.
  • the second, third, and fifth markers identify paces that yield no events above the NT.
  • the fourth marker is correctly identified as a sense.
  • the sixth marker identifies a pace that does not capture but yields a spontaneous event that differs visually in morphology.
  • the human reviewer established the "golden" reference classification of captured and non-captured events. In total, 615 events were classified and successfully discriminated into 538 captured and 77 non-captured events.
  • the comparison of the classification output of the CDA to the evaluation of the human resulted in a count of true positive, false positive, false negative, and true negative events (A, B, C, and D, respectively in Table 2).
  • the CDA correctly discriminated effective from ineffective pacing stimuli, fulfilling one of the essential requirements of a pacing capture algorithm (see Guilleman D, Bussilet H, Scanu P, et al. Output Adjustment with the DDD pacemaker with Automatic Capture. Prog. Biomed Res. 1999; 4: 291-294).
  • the CDA only operates on the programmer during the implant or follow-up pacing threshold test. Within this scope, the CDA can free the physician/operator to focus on higher- level tasks. Additionally, the CDA will improve the repeatability and reliability of pacing threshold tests by executing an optimized search algorithm.
  • the CDA performs this at no additional current- cost to the implanted device.
  • the CDA includes certain improvements with respect to other algorithms in the litera- ture (see Binner L, Brummer T, Hombach V, et al. Clinical Evaluation of a New DDD Pacemaker with Automatic Capture Control Using the Ventricular Evoked Response. Prog Biomed Res. 1997; 2: 69-72.).
  • An adaptive noise threshold generated in the definition phase, rejects line-frequency, quantization, and smaller artifacts
  • Event pre-processing also compensates for baseline drift.
  • the algorithm indicates to the user if the signal morphology is inconsistent or the lead system is compromised.
  • CDA has no requirement for specific event morphology, amplitude of after-potential, or special parameters entered by the user other than initial programming to control the intrinsic rhythm (see Espinosa Reynoso JJ, Hernandez Garcia HR, Sassara M, et al. First Clinical Results of a New Capture Control Algorithm Implemented in a Dual Chamber Rate- Adaptive Pacemaker.
  • CDA needs only consistent reference events from which it defines exemplars for sense and pace (see Guilleman D, Bussilet H, Scanu P, et al. Output Adjustment with the DDD pacemaker with Automatic Capture. Prog Biomed Res. 1999; 4: 291-294).
  • the algorithm is intended for use with surface ECG conveniently available from the output of a programmer. In fact, we were pleased to find that the algorithm was also robust to nonstandard lead placement of the three surface leads, such as, all leads placed within the outline of a handprint over the sternum.
  • CDA can be used with any implanted device that can be addressed through this interface. Future improvements will integrate the CDA into a pacing threshold test on the next programmer platform. At that time, a larger, on-line clinical study will be performed allowing a more significant statement of accuracy of this algorithm.
  • FIG. 4 addressed in the article above shows the classification criteria within the measurement window (MW).
  • the measurement window for the ventricular pace event here is 256 ms.
  • the peak delay (PD) for the event is 105 ms, and the signal amplitude (SA) is 420 mV (rescaled due to ECG output amplification).
  • the dynamic noise threshold (NT) is continually adjusted sample-by-sample.
  • the noise threshold is about 30 % of the signal amplitude here and represents a minimum threshold that the amplitude of an event must exceed in order to be discriminated from collinear noise.
  • append (monotonic (filtDist, noiseWin, eventLimit)) mrk. append(markerCkr (fileSpec[l] ) ) ecgChan . append(srMkrsEcg[1] [inx+1] ) paceEvntLst. append ( [ ] ] paceMagnLst. append ( [ ] ] paceNoizLst. ppend ( [ ] J mkr2PaceLst. append ( [ ] ,' sensEvntLst. append ( [] ] sensMagnLst. ppend ( [ ] ] sensNoizLst.
  • eBuf [ : ] candidate [mkr2PaceTim, paceMagn, paceEvent]
  • def trnsPoz accepts matrix data as [ [cl] , [c2] , ... , [en] ] column vectors note: single column vector [cl] must be passed as [[cl]] calls getRow to slice off a row vector for transpose to column vector. Returns [ [rl] , [r2] , ... , [rn] ] .
  • T [] for tx in range (len (data [0] )) : T. append (getRo (data, tx) ) return T CDA Version 8 Rev 2 (Python Listing)
  • prodctLst [] for fx in range (len (fltLstl) ) : prodctLst . append(fltLstl [f ] * fltLst2 [f ] ) return prodctLst
  • '''expect unknown to be a list of peak delay, magnitude, and actual event samples, in that order.
  • minPeakDelay paceStats [0] [0] - 12*paceStats[0] [1]
  • maxPeakDelay paceStats [0] [0] + 12*pa ⁇ eStats[0] [1]

Abstract

The increased functionality of implantable devices, including pacemakers and defibrillators, makes it necessary to automate tasks such as capture threshold search and signal amplitude measurements in order to relieve the physician of those duties. The invention presents a new approach for the capture threshold detection for atrial as well as ventricular pacing. The suggested algorithm analyzes the change of the signal morphology of the ECG to discriminate between captured and non-captured events. The algorithm comprises two phases, a reference event definition phase and an event classification phase.

Description

Patentanwalte Patentanwalte
Eisenf uhr, SpeiseWFPartne. European Patent Attorneys European Patent Attorneys
Dipl -Phys Heinz Noth Dipl -Ing Gunther Eisenfuhr
Dipl -Wirt -Ing Rainer Fπtsche Dipl -Ing Dieter K Speiser bm -Chem Gabnele Leiβler-Gerstl Dr-lng Werner W Rabus
Dipl -Ing Olaf Ungerer Dipl -Ing Jurgen Brugge
Patentanwalt Dipl -Ing Jurgen Klinghardt
Dipl -Chem Dr Peter Schuler Dipl -Ing Klaus G Goken
Jochen Ehlers
Alicante Dipl -Ing Mark Andres
European Trademark Attorney Dipl -Chem Dr Uwe Stilkenbohmer Dipl -Ing Jurgen Klinghardt Dipl -Ing Stephan Keck
Dipl -Ing Johannes M B Wasiljeff
Berlin Dipl -biotechnol Heiko Sendrowski
Patentanwalte
European Patent Attorneys Rechtsanwalte
Dipl -Ing Henning Christiansen Ulrich H Sander
Dipl -Ing Joachim von Oppen Christian Spintig
Dipl -Ing Jutta Kaden Sabine Richter
Dipl -Phys Dr udger Eckey Harald A Forster
Spreepalais am Dom Hamburg Anna-Louisa-Karsch-Strasse 2 Patentanwalt
Berlin, 28. August 2003 D -10178 Berlin European Patent Attorney Tel. +49-(0|30 -8 18870 Dipl -Phys Frank Meier
Unser Zeichen: BB 1423-02WO JVO/fut Fax +49-10)30-84188777
Durchwahl: 030/841 887 0 Fax +49-10)30-84188778 Rechtsanwalte mail@eisenfuhr.com Rainer Bohm http://www.eisenfuhr.com Nicol A Schromgens, L M
Anmelder/lnhaber: BIOTRONIK GmbH & Co. Amtsaktenzeichen : Prioritatsnachanmeldung basierend auf US 60/406,876;
29.08.2002
BIOTRONIK GmbH & Co. KG Woermannkehre 1 , 12359 Berlin
Capture Detector
The present invention relates to a device for obtaining and recognizing a sensed myocardial signal, in particular a signal related to cardiac stimulation. More particularly, the present invention relates to a detector for use in an implantable medical device for electrostimulation of the heart, such as a pacemaker or a cardioverter/defibrillator (ICD), or in a programmer for such device so that the detector may determine capture based on the signal morphology of a surface electrocardiogram (ECG). Even more, the present invention also relates to a detector for use in an implantable cardiac electrostimulation device so that comprising such a capture detector so that the detector may determine capture based on the signal morphology an intracardiac ECG. Even more particularly, the present invention also relates an implantable cardiac electrostimulation device comprising such a capture detector so that captured and non- captured events may be discriminated. Background of the Art
In the field of myocardial stimulation, the term "capture" refers to the process of applying an artificial stimulus of sufficient amplitude to myocardial tissue to result in contraction of the tissue. The artificial stimulus is, in most cases, an electrical stimulus not provided by the body's electrical system. Capture is an important and well-known feature that is utilized routinely in implantable devices for electrostimulation of the heart. A stimulation resulting in capture exceeds the so-called "capture threshold." A successful stimulation is referred to as a "capture event " An unsuccessful stimulation, that is, one that does not exceed the capture threshold, is referred to as a "non-capture event".
There are inherent difficulties in evaluating the influence of such artificial stimuli on myocardial tissue in vivo, in large part because of the need to not actually excite the myocardial tissue of a living subject to the point of contraction. These difficulties have caused researchers to investigate the interactions of external electrical currents and myocardial tissue external to the Body of a living subject. Hence, it has been heretofore difficult to determine the precise morphology of an electrostimulation that will provide a capture event.
Further, the ability to detect capture events in the heart is important to the design of an implantable automated cardiac electrostimulation device, because only by detecting capture can one be certain that a stimulation pulse has been successful, the act of capture embodying the definition of successful cardiac stimulation. As the implantable devices be- come more and more sophisticated, they approach becoming a perpetually an-duty "cardiologist in the Patient" to detect rhythm abnormalities, to effectively treat the rhythm abnormality, and then to cease treatment when the abnormality has been corrected. Devices for the initial detection of the abnormality are known in the prior art. It is, however, an unachieved object of the Prior art to provide an algorithm that can unequivocally determine capture in an automated manner, wherein the algorithm can be embodied in a capture detector and implanted in a human patient as a part of a implantable automated cardiac electrostimulation device.
Summary of the Invention
This and other objects of the invention are achieved by a capture detector and an implantable electrostimulation device that incorporates the mathematical modeling concepts described in more detail below for detecting capture events in myocardial tissue.
In particular, the objects of the invention are achieved by a medical device comprising
electrode connectors adapted to connect the medical device to intracardiac electrodes and to transmit electric stimulation pulses to electrode surfaces on the intracardiac electrodes and to receive electric signals sensed by electrode surfaces
a stimulation unit adapted to generate stimulation pulses and being connected to at least one electrode connector
an amplifier and filter unit connected to at least electrode connector and being adapted to amplify and filter sensed electric signals
an analog to digital converter connected to the amplifier and filter unit
and a control unit being connected to the stimulation unit, the analog to digital converter and a data memory, the data memory being adapted to store a program for controlling of the control unit and to store event data derived from data received via the analog to digital converter. The program is designed to enable the control unit to carry out a method for capture recognition via evaluation of a signal representing an electro cardiogram (ECG), said ECG comprising ECG signal sections corresponding to paced of spontaneous cardiac events.
The device preferably is a implantable medical device, in particular a cardiac pacemaker.
The method comprises
a reference definition phase, wherein two reference event signal are derived by analysis of measured ECG data,
- a first reference event signal is derived by analyzing measured
ECG data corresponding to paced events and
a second reference event signal is derived by analyzing measured ECG data corresponding to spontaneous events and
an event classification phase wherein signal sections representing cardiac events of a given or measured ECG signal are classified by correlating the ECG signal section to one of at least two classes of events, the first event class representing paced events and the second event class representing spontaneous events, wherein the classification comprises the step of comparison of the signal sections of the given or measured ECG signals with both, the first and the second reference events, whereby during the step of comparison it is determined, whether characteristics of the signal section to be classified are closer to characteristics to the first of the second reference event, respectively.
The term correlating as used herein is not limited to using a correlation function in a mathematical sense but shall include any form of logical association or assignment of a signal section to a given event class. This will become clear from the following description of a preferred embodiment.
The objects of the invention are also achieved by the afore mentioned capture detection method for a capture detector and an implantable electrostimulation device.
Preferred embodiments of the method comprise the steps of:
providing the characteristics of the signal section of the given or measured ECG signal and the characteristics of the first and the second reference events in form of a set of characteristic signal pa- rameters characterizing each signal section;
and/or
providing ECG signal data samples related to spontaneous or paced cardiac events, respectively,
and generating a mean signal from the data samples for each class of events,
and deriving characteristic signal parameters from the mean signal, wherein the characteristic signal parameters are preferably one or more of the group of: signal amplitude, signal morphology, and signal time delay.
Another preferred embodiment of the method above comprises the steps of
- deriving the parameters of claim 4 for a given or measured signal section representing a cardiac event and
- carrying out the comparison of claim 1 by determining for each pa- rameter of the signal section to be classified whether this parameter is numerically closer to the corresponding parameter of the first or the second reference event signal parameter, respectively.
The objects of the invention are as well achieved by a method, comprising in a reference definition phase alternatively or additionally the steps of:
receiving pacing program parameters,
starting dynamic noise threshold,
collecting ECG data corresponding to spontaneous events,
collecting ECG data corresponding to paced events, and
- if noise threshold is low enough, define composite reference event signals.
Based on the method as given above a method for adjusting a pacing output amplitude is preferred, comprising in an event classification phase following the reference definition phase the steps of:
- decreasing the pacing output amplitude,
classifying a paced event, and,
if a pacing output amplitude change is smaller than a predetermined accuracy limit, stop the pacing output adjustment procedure.
Said method allows for an automatic pacing output amplitude adjustment. Pacing output amplitude adjustment shall have the effect that the pacing amplitude is high enough to ensure reliable pacing of the myo- card above a capture threshold without being higher than necessary. To high a pacing output amplitude would only result in an unnecessary waste of energy in view of the limited energy resources of an implantable device, without any further benefit. The method for adjusting a pacing output amplitude may preferably include the step of reporting a pacing threshold if a pacing output amplitude change is smaller than a predetermined accuracy limit.
A further preferred method for adjusting a pacing output amplitude in- eludes the step of generating a user information message, if the signal quality degrades.
Alternatively, the objects of the invention are achieved by a medical device for capture recognition via evaluation of a signal representing an electro cardiogram (ECG), said ECG comprising ECG signal sections corresponding to paced of spontaneous cardiac events.
The device comprises
reference event definition means for defining at least two reference event signals by analysis of measured ECG data during a reference definition phase, the reference event definition means being adapted
derive a first reference event signal by analyzing measured ECG data corresponding to paced events and
derive a second reference event signal by analyzing measured ECG data corresponding to spontaneous events and
- and to store the first and the second reference event signal in a data memory being connected to the reference event definition means
event classification means being adapted to classify signal sections representing cardiac events of a given or measured ECG signal by correlating the ECG signal section to one of at least two classes of events, the first event class representing paced events and the second event class representing spontaneous events during a event classification phase. The event classification means comprises a comparator being connected to the data memory and being adapted to compare a signal section of the given or measured ECG signals with both, the first and the second reference events stored in the data memory, wherein the com- parator is adapted to determine, whether characteristics of the signal section to be classified are closer to characteristics to the first of the second reference event, respectively.
In a preferred embodiment, the device is a detector for use in a programmer or a programmer for a medical device such as an implantable cardiac pacemaker or cardioverter/defibrillator.
In an alternatively preferred embodiment, the device is an implantable cardiac pacemaker or cardioverter/defibrillator.
It is a common feature of all claimed embodiments of the invention to use a capture detector which first carries out at reference definition thereby creating at least two reference event signals and later on relies on these reference event signals for classification of a detected event, the latter being a section of an ECG signal.
Therefore, in general, a method for operating a capture detector of a medical stimulation device is claimed, said method comprising two phases, a reference definition phase and a event classification phase,
said reference definition phase comprises the steps of:
collecting ECG data corresponding to paced events;
deriving a composite reference event signal characterizing paced events, wherein the composite reference event signal is at lest characterized by numerical values for signal amplitude, signal morphology, and signal time delay,
storing the composite reference event signal characterizing paced events, said event classification phase comprising the steps of:
comparing measured ECG signal sections to the stored reference event signal characterizing paced events,
generating a capture signal indicating successful capture based on the comparison if the comparison results in a similarity between the ECG signal section and the reference event signal characterizing paced events above a predetermined level,
said steps of the event classification phase being repeated.
Such method and a capture detector based on said method as well as a medical electrostimulation device incorporating such capture detector allow for both, reliable capture detection and an reliable automatic pacing output amplitude adjustment.
The invention shall be further illustrated by the following description of embodiments of the invention and by the figures. The figures show:
Fig. 1 : a composite reference event signal as derived by the method and the device of the invention;
Fig. 2: a flow diagram of the claimed capture detection method and algorithm;
Fig. 3: a graph describing the classification criteria within the measurement window (MW);
Fig. 4: the outcome of an event classification according to the invention;
Fig. 5: a schematic drawing of an implantable device according to the invention; and Fig. 6: a schematical drawing of an alternative embodiment of the invention including an implantable device, in particular a pace maker, and a programmer being able to interact with the implantable device via telemetry.
Figures 1 to 4 are referred to in the article below "A New Approach for an Automated ECG-Morphology Based Dual Chamber Capture Detector".
Detailed Description of a Preferred Embodiment
Figure 5 is a schematic representation of an implantable device accord- ing to the invention. The implantable device 10 may be a cardiac pacemaker or a cardioverter/defibrillator or both.
The implantable device 10 can be connected to an electrode line via a connector (not shown). The electrode line serves to sense electrical potential of the myocard and to deliver them to the implantable device 10. This sensed electrical signals are amplified and filtered by an amplifier and filter section 12 of the implantable device and thereafter converted from analogue to digital by an analogue to digital converter 14. The digitally sampled signal is fed to a detector unit 16 of the implantable device. The detector unit 16 cares a reference event definition unit 18 and a signal classification unit 20. Both share common memory 22 for program code and data. In fact, both, the signal classification unit 20 and the reference event definition unit 18 are realised in form of program code as given by the capture detection algorithm listed herein after. The detector unit 16 therefore is part of a microcontroller in combination with a pro- gram enabling the microcontroller to act as detector unit.
In a reference event definition phase only the reference event definition unit 18 is active. Samples of measured ECG data corresponding to paced events are fed to the reference event definition unit 18. From these data the reference event definition unit 18 calculates a composite first reference event signal representing paced events. The reference event signal is described by three main criteria which are
peak delay (PD),
signal amplitude (SA), and
- shape
During the reference event definition phase the reference event definition unit 18 is also fed with spontaneous events and derives there from a composite reference event as a second reference event signal characterising spontaneous events. The second reference event signal is char- acterised by the same criteria as the first reference event signal.
The two reference event signals or the values of the criteria describing these reference event signals, respectively, are stored in memory 22.
In an event classification phase each sampled signal section coming from analogue to digital converter 14 is fed to the signal classification unit 20, which compares the characteristics of these signal sections with both, the first reference event signal and the second reference event signal and delivers an outgoing signal, depending on whether the signal section matches the first reference event signal or the second reference event signal or non of both. If the signal section to be classified matches the first reference event signal indicating a paced event a signal is fed to a stimulation unit 24 indicating, that a pacing output amplitude is above an excitation threshold of the myocard.
If the stimulation unit 24 has sent a signal to the signal classification unit 20 indicating that the pacing stimulus was put out and the signal classifi- cation unit 20 in term determines, that the resulting ECG signal section does not match the first reference event signal indicating capture, then the pacing output amplitude is to be adjusted to a higher value. The stimulation unit 22 of cause is connected to the connector for an electrode line to feat stimulation pulses to a stimulation electrode in a heart.
Whereas figure 5 shows an implantable medical device like a pace- maker with a built in detector unit, it is also possible to make the detector unit 16 part of an external programmer 30 as shown in figure 6. An implantable medical device 32 comprising a general control unit 34 being connected to a transceiver 36 is able to wirelessly communicate with the external programmer 30. For that purpose the external programmer 30 comprises a transceiver section 38 imaging the transceiver 36 of the implantable device 42. In the example given in figure 6 the reference event definition unit 18 and the signal classification unit 20 receive intracardiac electrocardiograms. Instead, a programmer may be designed to receive surface electrocardiograms since calculation of an adequate pacing output amplitude is done in the external programmer and successful stimulation resulting in a capture event can be judged from the surface electrocardiogram as well.
The present invention is a device that incorporates the results of mathematical modeling of the excitation mechanism of myocardial tis- sue. One such mathematical model is the model developed by D. Mues- sig and B. Hensel of the Department of Biomedical Engineering at Frie- drich-Alexander University, Erlangen, Germany, and to be reported as "Mechanism for the Excitation of Myocardial Tissue: Results Based an a Three-Dimensional Numerical Model" in the September, 2002, issue of Progress in Biomedical Research. A pre-publication copy of the article is attached hereto and made a part hereof by incorporation.
Further aspects of the invention are disclosed in an article by C. DeVoir and R.A. Schomburg of Micro Systems Engineering Inc., and C. Ramachandran and C.S. Lessard of the Department of Biomedical En- gineering at Texas MM University, College Station, TX, entitled "A New Approach for an Automated ECG-Morphology Based Dual Chamber Capture Detector", also to be published in the September 2002 issue of Progress in Biomedical Research. The following is a reprint of the article:
A New Approach for an Automated ECG-Morphology Based Dual Chamber Capture Detector
In recent years, the capability and complexity of implanted medical products have grown with the inclusion of advanced functions and treatment modes.
Although this is a broadly beneficial trend, it presents a challenge in terms of the increased clinical expertise and effort required for effective product support and utilization over a diverse patient population. Where feasible, we wish to free the physician for higher-level activities and decisions. It is therefore reasonable to examine ways in which we can automate certain common clinical tasks, which arise at device implantation or follow-up, such as cap- ture threshold test or measurement of the intrinsic signal amplitude. In doing this, it is desirable to use measurement and computational resources, which can be provided external to the implanted device. One of these essential tasks, in the case of pacing functions, is the accurate determination of patient threshold levels. Once known, they guide the selection of stimulus amplitudes to provide reliable capture, while avoiding unnecessary energy consumption within the device. A critical element, in the development of any automated method for pacing threshold measurement, is the unequivocal determination of capture. An algorithm performing this function must contend with numerous interfering factors, and perform as accurately as an experienced human observer. Practical application requires that the algorithm has minimal effect on current consumption of the implant device, and be compatible with (and simplify the procedure for) many device types. In addition, it should be usable with atrial and ventricular signals, be independ- ent of specific event morphologies, and be unaffected by the pacing artifact or after-potential characteristic of any particular lead.
Our investigations have shown that these requirements are effectively satisfied using morphology-based event discrimination meth- ods. The resulting algorithm, and related verification process, are described below, and have been developed for incorporation within the next generation of device programmers.
Materials and Methods
Capture Detection Algorithm
The capture detection algorithm (CDA) is written in an object- oriented language (see Python 2.1.3. programming language. Reference manual available from: URL: http://www.python.org/) using a integrated development environment (IDE) (see Komodo integrated development environment. Active State, USA. Reference manual available from: URL: http://www.activestate.com/). Simulations were performed on a standard desktop computer. The input data are pacemaker threshold tests formated as four channels (one marker, three surface ECG) from the ECG output of a pacemaker programmer (TMS1000, Biotronik) sampled at 1024 Hz and 12 bits per channel (DAQCard700, National Instruments, USA).
These recordings were also used to verify the accuracy of the CDA.
Pacemaker implant follow-up is the setting intended for the use of CDA. Thus, the CDA will be integrated into the programmer soft- ware. The requirements for the operation of the CDA are as follows. The CDA requires a start signal from the user, and outputs termination, and error signals that communicate completion of classification or the need for operator intervention. The CDA must have access to the programmed values for pacing rate and AV- delay to set the appropriate measurement window (MW) length. The CDA must also receive pace, sense markers, and a time- sampled ECG data stream of at least one channel. Additional simultaneous ECG channels can also be used.
The CDA provides two outputs. The principal output of the CDA is an event-by-event classification of capture/non-capture. This datum is used for adjusting subsequent pacing output voltage in the search for a threshold. Second, error conditions are returned by the CDA to inform the operator of the need for adjustment of the pacemaker to control the rhythm, or that signal input is compro- mised.
The CDA operates in two main phases, a reference definition phase, and an event classification phase. The reference definition phase collects two sets of reference events, spontaneous rhythm events, and unequivocal pacer-controlled rhythm events. Obtaining the latter may require adjustment of the basic pacing rate and the
AV-delay to ensure pacer control. An example of a reference pacing event (composed from the individual events in a paced rhythm) is shown in Figure 1. In addition, the reference definition phase starts a continual noise threshold calculation from sample-by- sample data.
From the two sets of reference events, parameters and limits are generated for the second main phase of the CDA, the classification phase. In this second phase, every marked event is evaluated against the two sets of references, paced and spontaneous. Event by event, the classification of capture/non-capture is returned as a datum to continue a threshold search. In some conditions, such as, excessively high dynamic noise threshold, the CDA returns error signals. Therefore, some outputs result in a modification of the threshold search while other errors inform the operator the need for mitigation. A flow diagram of the CDA is displayed in Figure 2. ECG Records
We analyzed six atrial and 13 ventricular threshold tests of 17 patients (58% male, 42% female, mean age = 75.3 years, range 61 - 85 years). The indications for implantation were SSS bradycardia, atrial fibrillation, atrial flutter, and ventricular tachyarrhythmia. Implanted devices (all from Biotronik) were Actros SR(2), Actros DR (2), Dromos DR (3), Philos DR (6), Tachos DR (1 ), Gemnos IV (1 ), MycroPhylax (1 ), and Phylax XM (1 ). All devices were equipped with a bipolar lead. The time from implantation to data collection ranged from 5 to 1961 days with a median of 495 days.
Study Design
The accuracy of the CDA was verified by a comparison of algorithm results with an event-by-event human review of the above pacing threshold test clinical data using the following methods. The defining criteria for each event occurs in an MW, which is the time window comprising 512 ms for atrial pacing and 256 ms for ventricular pacing. The MW commences with the pacing marker and terminates after the defined number of samples in the ECG chan- nel under consideration. Within the MW, the three main criteria that define an event are
- peak delay (PD),
- signal amplitude (SA), and
- shape.
PD is defined as time from the pacing marker to the most prominent peak found within the MW. A paced event earlier than the PD range is premature; if later than the PD range or entirely absent from the MW it is considered late. The SA is the voltage potential from the isoelectric line to the most prominent peak in the MW. An event in the classification phase must exceed the noise threshold (NT) and approximate the mean amplitude of the reference events. Signal shape is the similarity of the morphology of the event to that of the reference events formed during the definition phase. Therefore, the reference definition phase (the initial ten pacing events) is inspected to familiarize the human reviewer with the fundamental timing relationships and morphologies used to analyze subsequent events in the event classification phase. The classification phase follows, and the human reviewer observes pacing and sensing markers while comparing each marked event with the criteria determined in the definition phase. The reviewer understands that the pacing output volt-age is being systematically reduced, thus, the ECG record evolves to non-captured events.
Results
An example of a ventricular paced reference event is shown in Figure 3. Figure 4 shows some outcomes of event classification, the results of which are tabulated in Table 1. The first marker identifies the ECG event as paced. For the human reviewer it is 'on- time', of typical amplitude, and shape. The second, third, and fifth markers identify paces that yield no events above the NT. The fourth marker is correctly identified as a sense. The sixth marker identifies a pace that does not capture but yields a spontaneous event that differs visually in morphology. By following this method- ology, the human reviewer established the "golden" reference classification of captured and non-captured events. In total, 615 events were classified and successfully discriminated into 538 captured and 77 non-captured events. The comparison of the classification output of the CDA to the evaluation of the human resulted in a count of true positive, false positive, false negative, and true negative events (A, B, C, and D, respectively in Table 2). The sensitivity and specificity were 100%.
Table 1: Capture classification outcomes according to figure 4
Figure imgf000020_0001
Discussion
In an off-line test of clinical recordings of pacing thresh-old tests, the CDA correctly discriminated effective from ineffective pacing stimuli, fulfilling one of the essential requirements of a pacing capture algorithm (see Guilleman D, Bussilet H, Scanu P, et al. Output Adjustment with the DDD pacemaker with Automatic Capture. Prog. Biomed Res. 1999; 4: 291-294). Unlike full-time implanted capture algorithms, the CDA only operates on the programmer during the implant or follow-up pacing threshold test. Within this scope, the CDA can free the physician/operator to focus on higher- level tasks. Additionally, the CDA will improve the repeatability and reliability of pacing threshold tests by executing an optimized search algorithm. The CDA performs this at no additional current- cost to the implanted device. Algorithmically, the CDA includes certain improvements with respect to other algorithms in the litera- ture (see Binner L, Brummer T, Hombach V, et al. Clinical Evaluation of a New DDD Pacemaker with Automatic Capture Control Using the Ventricular Evoked Response. Prog Biomed Res. 1997; 2: 69-72.). An adaptive noise threshold, generated in the definition phase, rejects line-frequency, quantization, and smaller artifacts
(see Menezes Jr AS, Queiroz CFM, Carzola FP, et al. Ventricular Capture Control and the Increase of Pacemaker Lifetime. Prog Biomed Res. 1998; 3: 91-95). Event pre-processing also compensates for baseline drift. The algorithm indicates to the user if the signal morphology is inconsistent or the lead system is compromised. Unlike other algorithms, CDA has no requirement for specific event morphology, amplitude of after-potential, or special parameters entered by the user other than initial programming to control the intrinsic rhythm (see Espinosa Reynoso JJ, Hernandez Garcia HR, Sassara M, et al. First Clinical Results of a New Capture Control Algorithm Implemented in a Dual Chamber Rate- Adaptive Pacemaker. Prog Biomed Res. 2002; 7: 136-143). CDA needs only consistent reference events from which it defines exemplars for sense and pace (see Guilleman D, Bussilet H, Scanu P, et al. Output Adjustment with the DDD pacemaker with Automatic Capture. Prog Biomed Res. 1999; 4: 291-294). The algorithm is intended for use with surface ECG conveniently available from the output of a programmer. In fact, we were pleased to find that the algorithm was also robust to nonstandard lead placement of the three surface leads, such as, all leads placed within the outline of a handprint over the sternum. We have tested an earlier version of the algorithm on wideband IEGM and anticipate that the algorithm would also be successful on IEGM signal input through a low artifact fractal lead. Since it resides on the programmer, CDA can be used with any implanted device that can be addressed through this interface. Future improvements will integrate the CDA into a pacing threshold test on the next programmer platform. At that time, a larger, on-line clinical study will be performed allowing a more significant statement of accuracy of this algorithm.
Figure 4 addressed in the article above shows the classification criteria within the measurement window (MW). The measurement window for the ventricular pace event here is 256 ms. The peak delay (PD) for the event is 105 ms, and the signal amplitude (SA) is 420 mV (rescaled due to ECG output amplification). The dynamic noise threshold (NT) is continually adjusted sample-by-sample. The noise threshold is about 30 % of the signal amplitude here and represents a minimum threshold that the amplitude of an event must exceed in order to be discriminated from collinear noise.
Yet further aspects of the invention are disclosed in the following fifteen pages of computer code, entitled "CDA Version 8 Rev 2 (Python List- ing)". This code is referenced in the article above at page 5 as the capture detection algorithm ("CDA").
Source-code listing of one embodiment of the capture detection algorithm (CDA)
CDA Version 8 Rev 2 (Python Listing) cWaveMain2.py: source_directory = ' //vector/log7590/CaptureData_SC_JAN02/' target_directory = ' //vector/CharanyaData/Output/' golden_directory = ' //vector/CharanyaRev/Sense/' ### eσg train file list rrTranList=open(source_directory + 'capPilesS.txt', 'r') rrTranNames=[] for fNames in rrTranList. readlines () : rrTranNames . append (fNames [ : -1] ) rrTranList. close ()
### training phase noiseAdapt = 1024 filterWind = 1 numPac2Trn = 10 numSns2Trn = 1 from training2 import training from testing2 import testing from matrixθps2 import putFileNumMat, gθtFilθNumMat for filex in range (len (rrTranNames) ) : # len (rrTranNames) fileSpecs = [source_directory, rrTranNames [filex] , '.inp'] print f lex, fileSpecs templates = training (fileSpecs , filterWind, noiseAdapt, numSns2Trn, numPac2Trn, 0) sTemplate = templates [0] pTemplate = templates [1] corrSPLim = templates [2] chanSelec = templates[3] print ' testing lead ' , chanSelec results = testing (fileSpecs, filterWind, noiseAdapt, sTemplate, pTemplate, corrSPLim, chanSelec, 0) goldFil = getFileNumMat(goldβn_directory+rrTranNames [filex] +' .gld' ) for gx in range (len (goldFil [0] )) : if (goldFil [0] [gx] != results [0] [gx] ) or (int (goldFil [1] [gx] ) != results [1] [gx]) : print goldFil [0] [gx] , results [0] [gx] , goldFil [1] [gx] , results [1] [gx] training .p : from getECGRβc2 import ecgExtract from monotonic2 import monotonic from markerGen2 import mar erCkr from compose2 import compose from gaussian2cρ import pearsn from math import loglO from matrixθps2 import sortDex def training (fileSpec, filtOist, noiseWin, numSenses, numPaces, eng = 0) : srMkrsEcg = ecgExtract (fileSpec[0]+fileSpec[l] +fileSpec[2] ) samplingRate = srMkrsEcg[0] CDA Version 8 Rev 2 (Python Listing)
markerChan = srMkrsEcg[l] [0] eventLimit = samplingRate/4 # must resolve to power of 2 if eng: print ' eventLimit size = ' , eventLimit, ' samples.' mon = [] mrk = [] ecgChan = [] pacβEvntLst = paceMagnLst = paceNoizLst = mkr2PaceLst = sensEvntLst = sensMagnLst = sensNoizLst = mkr2SensLst = if eng: mLst = [] for inx in range (3) : mon. append (monotonic (filtDist, noiseWin, eventLimit)) mrk. append(markerCkr (fileSpec[l] ) ) ecgChan . append(srMkrsEcg[1] [inx+1] ) paceEvntLst. append ( [ ] ] paceMagnLst. append ( [ ] ] paceNoizLst. ppend ( [ ] J mkr2PaceLst. append ( [ ] ,' sensEvntLst. append ( [] ] sensMagnLst. ppend ( [ ] ] sensNoizLst. ppend ( [ ] ] mkr2SensLst.append( [] ] if eng: mLst . append ( [] ) ex = 0 while (ex < len (markerChan) ) : # while streaming data coming in mSample = markerCha [ex] or jnx in range (3) : if eng: mLst[jnx] . appen (0) mrk [jnx] . generate (mSample) eSample = ecgChan [jnx] [ex] mon [jnx] .buffer (eSample) mon [jnx] . slope () if mon [jnx] .eFlg: if mrk [jnx] . ready: if mrk [jnx] .pacFlag: if (len (paceEvntLst [jnx] ) < numPaces): paceEvntLst[jnx] .append (mon [jnx] .eBuf [:]) paceMagnLst [jnx] .append (mon [jnx] .pMax) paceNoizLst [jnx] .append (mon [jnx] . mpThrsh . runDev) mkr2PaceLst[jnx] .append(mrk[jnx] ,mkr2PacTime- (eventT.imit/2) ) if eng: CDA Version 8 Rev 2 (Python Listing)
mLst[jnx] [- (eventLimit/2) ] = 1 mrk [jnx] .ready = 0 mrk [jnx] .pacFlag = 0 mrk [jnx] .mkr2PacTime = 0 mon [jnx] . eFlg = 0 mon[jnx] .pMax = 0 # reset noise only if signal adjusted by operator elif mr [jnx] . snsFlag: if (len (sensEvntLst[jnx] ) < numSenses): sensEvntLst[jnx] . ppend (mon [jnx] .eBuf[ : ] ) sensMagnLst [jnx] .append (mon [jnx] . Max) sensNoizLst [jnx] .append (mon [jnx] . ampThrsh. runDev) mkr2SensLst[jnx] .append (mr [jnx] .mkr2PacTime- (eventLimit/2) ) if eng: mLst[jnx] [- (eventLimit/2) ] = -1 mrk [jnx] .ready = 0 mrk [jnx] . snsFlag = 0 mrk[jnx] .mkr2PacTime = 0 mon [jnx] .eFlg = 0 mon [jnx] .pMax = 0
# reset noise only if signal adjusted by operator else: mon [jnx] .eFlg = 0 if (len (paceEvntLst[0] ) = numPaces) and (len (sensEvntLst[0] ) == numSenses) : if (len (paceEvntLst[1] ) = numPaces) and (len (sensEvntLst[1] ) == numSenses) : if (len (paceEvntLst [ ] ) = numPaces) and (len (sensEvntLst [2] )
= numSenses) : break # events may not have identical extraction times between channels ex += 1 sComposite = [] pComposite = [] peakDelVarLst = peakAmpVarLst = corrPacPacLst = corrSnsPacLst = peakPacSNRLst = for knx in range (3) : sComposite. append (compose (sensEvntLst [knx] , sensMagnLst[knx] , sensNoizLst [knx] , mkr2SensLst[knx] ) ) pComposite. appen (compose (paceEvntLst [knx] , paceMagnLs [knx] , paceNoizLst [knx] , mkr2PaceLst [knx] ) ) corrPacPacLst. append (pComposite [knx] [3] ) corrSnsPacLst. append (pearsn (pComposite [knx] [2] , sComposit [knx] [2]) ) peakDelVarLst. append (pComposite [knx] [0] [1] ) # delay variance peakAmpVarLst. append (pComposite [knx] [1] [1] ) # amplitude variance CDA Version 8 Rev 2 (Python Listing)
peakPacSNRLst.append(pComposite[knx] [4] ) corrPacPacSrt = sortDex (corrPacPacLst) corrPacPacSr . reverse () # highest pace2pace correlation position zero corrSnsPacSrt = sortDex (corrSnsPacLst) # lowest sense2pace at zero peakDelVarSrt = sortDex (peakDelVarLst) peakAmpVarSrt = sortDex (peakAmpVarLst) peakPacSNRSrt = sortDex (peakPacSNRLst) peakPacSNRSrt. reverse () # highest pace peak SNR position zero leadScore = [0,0,0] for lnx in range (3) : leadScore [corrPacPacSrt[lnx] ] += lnx leadScore [corrSnsPacSrt [lnx] ] += lnx leadScore [peakDelVarSrt [lnx] ] += lnx leadScore [peakAmpVarSrt [lnx] ] += lnx leadScore [peakPacSNRSrt[lnx] ] += lnx leadScoreSrt = sortDex (leadScore) leadSelect = leadScoreSrt [0] corrSnsPacLimit = max ([0.50, (pComposite [leadSelect] [3] +corrSnsPacLst[leadSelect] ) /2] ) if eng: print print 'selected lead: ', leadSβlect+l print 'correlation pace with template = ', pComposite [leadSelect] [3] print 'correlation of pace with sense = ', corrSnsPacLst [leadSelect] print ' correlation limit = ' , corrSnsPacLimit print ' vg snr of pace template (db) = ', pComposite [leadSelect] [4] print print 'correlation sense and template = ', sComposite [leadSelect] [3] print 'avg snr of sense template (db) = ', sComposite [leadSelect] [4] print from scipy import gplt gplt. close () gplt. lot (pComposite [leadSelect] [2] ) gplt. hold (' on' ) gplt.plot(sComρosite[leadSelect] [2] ) raw_input () gplt. close () gpl .plot (markerChan) gplt. old ('on') gplt. lot (ecgChan [leadSelect] ) gplt .plot (mLst [leadSelect] , ' notitle with impulses') raw_input () gplt. close () return [sComposite [leadSelect] , pComposite [leadSelect] , corrSnsPacLimit, leadSelect+1] testing2.py: from getECGRec2 import ecgExtract from monotonic2 import monotonic from markerGen2 import markerCkr from evaluation2 import evaluation def testing (fileSpec, filtDist, noiseWin, senseTemp, paceTemp, corrLowLim, leadSelect, eng = 0) : CDA Version 8 Rev 2 (Python Listing)
srMkrsEcg = ecgExtract (fileSpec[0]+fileSpec[l]+fileSpec[2] ) samplingRate = srMkrsEcg[0] markerChan = srMkrsEcg[l] [0] ecgChan = srMkrsEcg[l] [leadSelect] eventLimit = samplingRate/4 # must resolve to power of 2 monl = monotonic (f ltDist, noiseWin, eventLimit) mrkl = markerCkr (fileSpec [1] ) if eng: mLst = [] paceEvntLst = [ ] sensEvntLst = [ ] paceTimeLst = [] paceClssLst = [] ex = 0 while (ex < len (ecgChan) ) : if eng: mLst. append (0) mSample = markerChan [ex] mrkl . generate (mSample) eSample = ecgChan [ex] monl .buffer (eSample) monl . slope () if mrkl . paclnterrupt : timeStamp = round ((ex - (eventLimit/2) ) /float (samplingRate) ,2) paceTimeLs . append (timeStamp) paceClssLst . append (200) mrkl .paclnterrupt = 0 if eng: mLs [-mrkl. lastPaceTim] = -3 if monl. Flg: if mrkl . read : if mrkl . acFlag: timeStamp = round ((ex - (eventLimit/2) ) /float (samplingRate) ,2) paceTimeLst . ppend (timeStamp) mkr2PaceTim = mrkl.mkr2PacTime - (eventLimit/2) paceMagn = monl .pMax paceEvent = monl . eBuf [ : ] candidate = [mkr2PaceTim, paceMagn, paceEvent] eval = evaluation (candidate, senseTemp, paceTemp, corrLowLim) paceClssLst . ppend (eval) if eng: mLst[- (θventLimit/2) ] = eval paceEvntLst . append (paceEvent) mrkl . eady = 0 mrkl . pacFlag = 0 mrkl.mkr2PacTime = 0 monl . eFlg = 0 monl . pMax = 0
# reset noise only if signal adjusted by operator elif mrkl . snsFlag : CDA Version 8 Rev 2 (Python Listing)
timeStamp = round ((ex - (eventLimit/2) ) /float (samplingRate) ,2) paceTimeLst.append (timeStamp) sensEvent = monl .eBuf[ : ] paceClssLst.append (888) if eng: mLst[- (eventLimit/2) ] = -1 sensEvntLst.appen (sensEvent) mrkl. ready = 0 mrk . snsFlag = 0 mrkl.mkr2PacTime = 0 monl.eFlg = 0 mon .pMax = 0
# reset noise only if signal adjusted by operator else: monl . eFlg = 0 ex += 1 if eng: from scipy import gplt gplt.plot (markerChan) gplt.hold ('on') gpl .plot (ecgChan) gplt.plot (mLst, 'notitle with impulses') raw_input () gplt. close () return [paceTimeLst, paceClssLst] matrixOps2.py : from math import sqrt def getRow (rectMat, rowDex) : copies and returns row of a rectangular matrix rectCol = [] rowOut = [] for rx in range (len (rectMat) ) : rectCol = rectMat[rx] rowOut. append (rectCol [rowDex] ) return rowOut
def trnsPoz (data) accepts matrix data as [ [cl] , [c2] , ... , [en] ] column vectors note: single column vector [cl] must be passed as [[cl]] calls getRow to slice off a row vector for transpose to column vector. Returns [ [rl] , [r2] , ... , [rn] ] .
T = [] for tx in range (len (data [0] )) : T. append (getRo (data, tx) ) return T CDA Version 8 Rev 2 (Python Listing)
def scalarProdct(fltLstl, fltLst2) :
"""term by term product of two equal length lists of floats' prodctLst = [] for fx in range (len (fltLstl) ) : prodctLst . append(fltLstl [f ] * fltLst2 [f ] ) return prodctLst
def summa(seq) :
"""returns the sum of list of numbers""" def add(x,y) : return (x + y) return reduce (add, seq)
def vecNrm(vec) : su OfSqrs = 0 for vx in vec: sumOfSqrs += vx**2 vecMag = sqrt (sumOfSqrs) for ux in range (len (vec) ) : vec[ux] = vec[ux] /vecMag
def gaussMean (fltLst) :
•■""Gaussian distribution arithmetic mean of elements of a vector" return summa ( ltLst) /len (fltLst)
def difVector (vecl , vec2) :
"""vector of differences of term by term (vecl - vec2)"' difLst = [] for fx in range (len (vecl) ) : difLst. append (vecl [fx] - veσ2 [fx] ) return difLst
def dotProd(vecl , vec2) :
' ' ' dot product = product corresponding terms and sum' sum = 0.0 for k in range (len (vecl) ) : sum += vecl [k] *vec2 [k] return sum
def scalarProdct (fltLstl , fltLst2) : returns term by term product of two equal length lists of floats prodctLst = [] for fx in range (len (fltLstl) ) : prodctLst. append (fltLstl [ x] * fltLst2 [fx] ) return prodctLst CDA Version 8 Rev 2 (Python Listing)
def sortDex (vec) : indexes = [] for ix in range (len (vec) ) : indexes . append (ix) indexedVec = [vec, indexes] tlndexedVec = trnsPoz (indexedVec) tlndexedVec . sort () indexedVec = trnsPoz (tlndexedVec) return indexedVec [1]
def getFileFltVec (fileSpec) :
Accepts a string type file spec as ' /dir/ ../filename. ext' . Expects data single column float
IMPORTS to list of floats stripped of ' \n' newline characters. Closes file, returns list. fltVecFile = open (fileSpec, ' r' ) fltVecLst = [] for fx in fltVecFile . readlines () : fltVecLst. append (float (fx) ) fltVecFile . close () return fltVecLst
def getFileNumMat( ileSpec) :
Accepts a string type file spec as ' /dir/.. /filename. ext' .
IMPORTS list elements rom filesystem of multi-column floats . Closes file . from string import split numMatFile = open (fileSpec, ' r' ) numMatrix = [] for nx in numMatFile. readlines () : # read all rows of file one at a time rowlnit = nx[:-l] # truncate ' \n' of a given line rowSlice = split (rowlnit) # divide floats based on whitespace str2Flt = [] for rx in range (len (rowSlice) ) : # gather floats strPiece = rowSlice [rx] if (strPiece[-l:] = ','): str2Flt . append (float (strPiece [ : -1] ) ) else: str2Flt . append (float (rowSlice [rx] ) ) numMatrix. append (str2Flt) # store a single row of floats as a column numMatFile . close () numMatrix = trnsPoz (numMatrix) return numMatrix CDA Version 8 Rev 2 (Python Listing)
def putFileNumMat (fileSpec, numMatrix): II II II
Accepts a string type file spec as ' /dir/../filename. ext' .
Accepts a rectangular (not sparse) matrix of numerics .
EXPORTS list elements to filesystem in column format. Closes file. numMatFile = open(fileSpec, 'w') for nx in range (len (numMatrix [0] )) : # number of rows rowSlice = getRow(numMatrix, nx) for ex in range (len (numMatrix) ) : # number of columns numMatFile. rite (str (rowSlice [ex] ) ) if (ex = (len (numMatrix) - 1)): numMatFile. rite (' \n' ) # newline after last numeric else: numMatFile.write (' \t' ) # tab separate numerics numMatFile .close () getECGRec2.py: import xml . sax from xml . sax.handler import ContentHandler from Stringio import StringlO from struct import unpack from binascii import hexlify class HeadlineHandler (ContentHandler) : """extracting tagged text""" def init (self) : sel . in_nc = 0 self.in_cl = 0 self. in_nm = 0 self.nm = [] sel . in_gn = 0 self.gn = [] sel . in_sr = 0 def startEle ent (self, name, attrs) : if name = 'nchannels' : self.in_nc = 1 if name = 'chlen' : self.in_cl = 1 if name = 'name' : self.in_nm = 1 if name = 'gain' : self.in_gn = 1 if name = ' sr' : self .in_sr = 1 def βndElament (self, name): if name = 'nchannels' : self.in nc = 0 if name = 'chlen' : self.in_cl = 0 if name = 'name' : self .in_nm = 0 if name = 'gain' : self.in_gn = 0 if name = ' sr' : self.in_sr = 0 def characters (self, content): if self. in_nc : self.nc = int (content) if self.in_cl: self.cl = int (content) if self. in nm: CDA Version 8 Rev 2 (Python Listing)
self . nm. append (str (content) ) if self. in_gn: self. gn. ppend (float (content) ) if self. in_sr: self.sr = int (float (content) )
def ecgExtract (fileSpec) : extract the header and ecg data from the file compositeFile = open (fileSpec, ' r' ) header = ' ' while 1 : fByte = compositeFile.read(1) if (fByte = '\0') : fByte = compositeFile. read (1) if (fByte = '\0') : compositeFile . close () break else: header = header + fByte
# instantiating the parser parser = xml . sa .make_parser () handler = HeadlineHandler () parser . setContentHandler (handler) xml . sax.parseString (header, handler) ecgData = [] compositeFile = open (fileSpec, ' rb' ) while 1: fByte = compositeFile. read(1) if (fByte = '\0') : fByte = compositeFile.read(1) if (fByte = '\0') : break f2Bytes = compositeFile. read (2) while (f2Bytes != "): ecgData. append (unpack ('h' , f2Bytes) [0]) f2Bytes = compositeFile. read (2) compositeFile . close () ecgChans = [] for ex in range (handler .no) : ecgChans .append(ecgData[ (0+cx*handler.cl) : (handle . cl+cx*handler . cl) ] ) for dx in range (handler. cl) : # data expected in mV, rescale to Volts ecgChans [ex] [dx] = ecgChans [ex] [dx] * handler .gn [ex] / 1000.0 ## print ' number of channels = ' , handle .nc ## print ' length of channel = ' , handler . cl ## print 'names of channels = ', handler. m ## print 'channel gain coeff = ', handler.gn return [handler. sr, ecgChans] monotonic2.py: CDA Version 8 Rev 2 (Python Listing)
from noiseThresh2 import noiseThresh from matrixθps2 import trnsPoz, gaussMean class monotonic: def init (self, samplDist, adaptWin, eventLxm) : self.samplDist = samplDist self.eBuf = [] or ex in range (eventLxm) : self. eBuf . append (0) self. currDir = 0 self. lastDir = 0 self.mTime = 0 sel .mAccum = 0 self . timThrsh = noiseThresh (adaptWin) self. ampThrsh = noiseThresh (adaptWin) self. eFlg = 0 self.smoothO = 0 self.smoothl = 0 self. limTimer = 0 self.eventLim = eventLxm self.tFlg = 0 self.pMax = 0 def sign (self, val) : if (0 < val) : return 1 elif (val < 0) : return -1 else: return 0 def buffer (self, sample) : self. eBuf .pop (0) self.eBuf.append (sample) self.smoothO = gaussMean (self.eBuf[- (1+self. sεunplDist) :] ) self. smoothl = gaussMean (self .eBuf [-2* (l-fself.samplDist) :- (1+self . samplDist) ] ) self.lastDir = self. currDir self.eBuf[-1] = self.smoothO if (0 < self . limTimer < sel .eventLim/2) : if (abs (self.pMax) < abs (self .smoothO) ) : self.pMax = self. smoothO self. limTimer = 1 else : self. limTimer += 1 elif (self.limTimer = self .eventLim/2) : self . limTimer = 0 self.eFlg = 1 def detect (self) : if (self. timThrsh. runDev < self.mTime) : self.tFlg = 1 else: self.tFlg = 0 if (self.ampThrsh. runDev < self .mAccum) : self.aFlg = 1 else: self.aFlg = 0 if (self.tFlg and self.aFlg): CDA Version 8 Rev 2 (Python Listing)
if (self .limTimer = 0): self. limTimer = 1 self.pMax = self.smoothO def slope (self) : self.diff = self . smoothO - self . smoothl self.currDir = self. sign (self.di f) if (self .lastDir = 0) : if (self .currDir = 0) : self .mTime = 0 self .mAccum = 0 else: self.mTime = 1 self .mAccum = abs (self.diff) elif (self.currDir = 0) : sel . timThrsh. runStat (self .mTime) self . mpThrsh. runS at (self.mAccum) self .detect () self .mTime = 0 sel .mAccum = 0 elif (self .currDir = self.lastDir) : self .mTime += 1 self .mAccum += abs (self .diff) elif (self .currDir != self.lastDir) : self. timThrsh. runStat (self.mTime) self . ampThrsh. runSta (self.mAccum) self .detect 0 sel .mTime = 1 self.mAccum = abs (self.diff) compose . y: from matrixθps2 import trnsPoz, summa, vecNrm from gaussian2cp import pearsn, gaussMean, gaussDev from math import loglO eng = 0 def sign (val) : if (0 < val) : return 1 elif (val < 0) : return -1 else: return 0 def zeroMea (fltLst) : """removes DC offset""" dcOffset = gaussMean (fltLst) for zx in range (len (fltLst) ) : fltLst[zx] = fltLst[zx] - dcOffset return dcOffset def compose (evntLst, magnLst, noizLst, marker2EventLst) polarityLst = [] amplitudLst = [] snrLst = [] CDA Version 8 Rev 2 (Python Listing)
for px in range (len (evntLst) ) : offset = zeroMean (evntLst [px] ) vecNr (evntLst [px] ) polarityLst . ppend (sig (magnLst [px] ) ) amplitudLst. append (abs (magnLst [px] - offset)) # remove dc snrLst. append (20*logl0 (abs (magnLst [px] ) /noizLst [px] ) ) if (len (evntLst) = 1) : # in case one sample, return only one there cEvnt = evntLst [0] peakDelayStat = [marker2EventLst[0] , 0.0] amplitudeStat = [amplitudLst [0] , 0.0] corrAvg = 1.0 snrAvg = snrLst[0] return [peakDelayStat, amplitudeStat, cEvnt, corrAvg, snrAvg] else: mainPolarity = summa (polarityLst) /len (polarityLst) if (mainPolarity = 0) : print ' Train events not consistent polarity over ' , len (evntLst) , ' events . ' peakDelayStat = gaussDe (marker2EventLst) amplitudeStat = gaussDev (amplitudLst) teLst = trnsPoz (evntLst) cEvnt = [] for ex in range (len (teLst) ) : cEvnt. append (gaussMean (teLst[cx] ) ) zeroMean (cEvnt) vecNrm (cEvnt) corrLst = [] for ex in evntLst: corrLst . append (pearsn (cEvnt, ex) ) corrAvg = gaussMean (corrLst) if (corrAvg < 0.95) : print ' Train events not consistent shape over ' , len (evntLst) , ' events . ' snrAvg = gaussMean (snrLst) return [peakDelayStat, amplitudeStat, cEvnt, corrAvg, snrAvg] gaussian2cp . py : from math import sqrt
def summa (seq) :
" " ■■returns the sum of list of numbers" " " def add (x, y) : return (x + y) return reduce (add, seq)
def difVec(fltLst, refVal) :
"""returns difference vector w.r.t. refVal""" difLst = [] for fx in fltLst: difLst. append (fx - refVal) return difLst CDA Version 8 Rev 2 (Python Listing)
def gaussMean (vec) :
"""Gaussian distribution arithmetic mean of elements of a vector""" return summ (vec) /float (len (vec) )
def scalarProdct (fltLstl, fltLst2) : """term by term product of two equal length lists of floats""" prodctLst = [] for fx in range (len(fltLstl) ) : prodctLst. append (fltLstl [fx] * fltLst2 [fx] ) return prodctLst
def gaussVar ( ltLst) :
"""Gaussian distribution mean and variance of a list of floats. Variance as : mean of squares minus mean squared. " "" meanVal = gaussMean ( ltLst) diffLst = [] for dx in fltLst: diffLs . append ( (meanVal - dx)**2) variance = summa (diffLst) /float (len (fltLst) -1) return [meanVal, variance]
def gaussDev( ltLst) :
"""Gaussian distribution mean and variance of a list of floats. Variance as : mean of squares minus mean squared. """ meanVal = gaussMean (fltLst) diffLst = [] for dx in fltLst: diffLst. append ( (meanVal - dx) **2) variance = summa (diffLst) /float (len (fltLst) -1) deviation = sqrt (variance) return [meanVal, deviation]
def pearsn (x, y) :
"""Given two vectors x[0..n-l] and y[0..n-l], this routine computes their pearson' s correlation coefficient"""
TINY = l.Oθ-20 # just in case x or y is a zero vector ax = gaussMean (x) ay = gaussMean (y) xt = difVec(x, ax) yt = difVec(y, ay) xx = scalarProdct (xt, xt) yy = scalarProdct (yt, yt) xy = scalarProdct (xt, yt) sxy = summa (xy) sxx = summa (xx) syy = summ (yy) r=sxy/ (sqrt (sxx*syy) +TINY) return r evaluation2.py: CDA Version 8 Rev 2 (Python Listing)
from gaussian2cp import pearsn from matrixθps2 import vecNrm from compose2 import zeroMean def evaluation (unknown, senseStats, paceStats, corrMinLxmit) :
'''expects unknown to be a list of peak delay, magnitude, and actual event samples, in that order. Stats are mean and variance of peak delay, magnitude, samples of templates, correlation minimum, and snr minimum, evaluates unknown event' ' ' result = 111 offset = zeroMean (unknown [2] ) vecNrm (unknown [2] ) minPeakDelay = paceStats [0] [0] - 12*paceStats[0] [1] maxPeakDelay = paceStats [0] [0] + 12*paσeStats[0] [1] unkPeakDelay = unknown [0] if (unkPeakDelay < minPeakDelay) : result -= 100 elif (maxPeakDelay < unkPeakDelay) : result += 100 minPeakAmplt = paceStats [1] [0] - 12*pacβStats[l] [1] maxPeakAmplt = paceStats [1] [0] + 12*paceStats[l] [1] unkPeakAmplt = abs (unknown [1] - offset) if (unkPeakAmplt < minPeakAmplt) : result -= 10 elif (maxPeakAmplt < unkPeakAmplt) : result += 10 corrPaceTemp = pearsn (paceStats [2] , unknown [2]) if (corrPaceTemp < corrMinLimit) : result -= 1 return result noiseThresh2. y: from math import sqrt class noiseThresh: def init (self, adaptWin) : self. adaptWin = adaptWin self. runMen = 0 self. runSqr = 0 self. runDev = 0 self . adaptCnt = 0 def runStat (self, datum) : if (self.adaptCnt < sel . adaptWin) : self. adaptCnt += 1 left = (self.adaptCnt - 1) /float (sel .adaptCnt) right = 1/float (self .adaptCnt) self. unMen = left*self.runMen + right*datum self.runSqr = left*self.runSqr + right* (datum**2) self. runDev = sqrt (self .runSqr - (self.runMen**2) ) def reset (self) : self . adaptCnt = 0

Claims

Claims
1. Method for capture recognition via evaluation of a signal representing an electro cardiogram (ECG), said ECG comprising ECG signal sections corresponding to paced of spontaneous cardiac events,
the method comprises
a reference definition phase, wherein at least two reference event signal are derived by analysis of measured ECG data,
a first reference event signal is derived by analyzing measured ECG data corresponding to paced events and
- a second reference event signal is derived by analyzing measured ECG data corresponding to spontaneous events and
an event classification phase wherein signal sections representing cardiac events of a given or measured ECG signal are clas- sified by correlating the ECG signal section to one of at least two classes of events, the first event class representing paced events and the second event class representing spontaneous events, wherein the classification comprises the step of comparison of the signal sections of the given or measured ECG signals with both, the first and the second reference events, whereby during the step of comparison it is determined, whether characteristics of the signal section to be classified are closer to characteristics to the first of the second reference event, respectively.
2. Method according to claim 1 , wherein the characteristics of the signal section of the given or measured ECG signal and the characteristics of the first and the second reference events are provided in form of a set of characteristic signal parameters characterizing each signal section.
3. Method according to claim 2, comprising the step of providing ECG signal data samples related to spontaneous or paced cardiac events, respectively,
- generating a mean signal from the data samples for each class of events,
- deriving characteristic signal parameters from the mean signal.
4. Method according to claim 3, wherein the characteristic signal pa- rameters are one or more of the group of: signal amplitude, signal morphology, and signal time delay.
5. Method according to claim 1 and claim 4, comprising the steps of
deriving the parameters of claim 4 for a given or measured signal section representing a cardiac event and
- carrying out the comparison of claim 1 by determining for each parameter of the signal section to be classified whether this parameter is numerically closer to the corresponding parameter of the first or the second reference event signal parameter, respectively.
6. Method according to any one of claims 1 to 5, comprising in a reference definition phase the steps of:
receiving pacing program parameters,
- starting dynamic noise threshold,
- collecting ECG data corresponding to spontaneous events,
- collecting ECG data corresponding to paced events, and - if noise threshold is low enough, define composite reference event signals.
7. Method according to claim 6, for adjusting a pacing output amplitude, comprising in an event classification phase following the refer- ence definition phase the steps of:
- decreasing the pacing output amplitude,
- classifying a paced event, and,
- if a pacing output amplitude change is smaller than a predetermined accuracy limit, stop the pacing output adjustment proce- dure.
8. Method according to claim 7, including the step of reporting a pacing threshold if a pacing output amplitude change is smaller than a predetermined accuracy limit.
9. Method according to claim 7 or 8, including the step of generating a user information message, if the signal quality degrades.
10. Method for operating a capture detector, the method comprising two phases, a reference definition phase and a event classification phase,
said reference definition phase comprises the steps of:
- collecting ECG data corresponding to paced events;
deriving a composite reference event signal characterizing paced events, wherein the composite reference event signal is at lest characterized by numerical values for signal amplitude, signal morphology, and signal time delay,
- storing the composite reference event signal characterizing paced events, said event classification phase comprising the steps of:
comparing measured ECG signal sections to the stored reference event signal characterizing paced events,
generating a capture signal indicating successful capture based on the comparison if the comparison results in a similarity between the ECG signal section and the reference event signal characterizing paced events above a predetermined level,
said steps of the event classification phase being repeated.
Medical device comprising
at least one electrode connector adapted to connect the medical device to intracardiac electrodes and to transmit electric stimulation pulses to electrode surfaces on the intracardiac electrodes and to receive electric signals sensed by electrode surfaces
a stimulation unit adapted to generate stimulation pulses and being connected to at least one electrode connector
an amplifier and filter unit connected to at least electrode connector and being adapted to amplify and filter sensed electric signals
an analog to digital converter connected to the amplifier and filter unit
and a control unit being connected to the stimulation unit, the analog to digital converter and a data memory, the data memory being adapted to store a program for controlling of the control unit and to store event data derived from data received via the analog to digital converter,
characterized by a program enabling the control unit to carry out the method according to claims 1 to 9.
2. Medical device for capture recognition via evaluation of a signal representing an electro cardiogram (ECG), said ECG comprising ECG signal sections corresponding to paced of spontaneous cardiac events,
the device comprises
reference event definition means for defining two reference event signals by analysis of measured ECG data during a reference definition phase, the reference event definition means being adapted to
- derive a first reference event signal by analyzing measured
ECG data corresponding to paced events and
derive a second reference event signal by analyzing measured ECG data corresponding to spontaneous events and
and to store the first and the second reference event signal in a data memory being connected to the reference event definition means
event classification means being adapted to classify signal sections representing cardiac events of a given or measured ECG signal by correlating the ECG signal section to one of at least two classes of events, the first event class representing paced events and the second event class representing spontaneous events during a event classification phase,
wherein the event classification means comprises a comparator being connected to the data memory and being adapted to compare a signal section of the given or measured ECG signals with both, the first and the second reference events stored in the data memory, wherein the comparator is adapted to determine, whether characteristics of the signal section to be classified are closer to characteristics to the first of the second reference event, respectively.
13. Medical device according to claim 11 or 12, wherein the medical device is a programmer for an implantable medical device such as a pacemaker or a cardioverter/defibrillator or both.
14. Medical device according to claim 11 or 12, wherein the medical device is an implantable medical device such as a pacemaker or a cardioverter/defibrillator or both.
PCT/EP2003/009520 2002-08-29 2003-08-28 Capture detector WO2004019775A2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP03747937A EP1536860A2 (en) 2002-08-29 2003-08-28 Capture detector
AU2003267019A AU2003267019A1 (en) 2002-08-29 2003-08-28 Capture detector

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US40687602P 2002-08-29 2002-08-29
US60/406,876 2002-08-29

Publications (2)

Publication Number Publication Date
WO2004019775A2 true WO2004019775A2 (en) 2004-03-11
WO2004019775A3 WO2004019775A3 (en) 2005-02-10

Family

ID=31978373

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/EP2003/009520 WO2004019775A2 (en) 2002-08-29 2003-08-28 Capture detector

Country Status (3)

Country Link
EP (1) EP1536860A2 (en)
AU (1) AU2003267019A1 (en)
WO (1) WO2004019775A2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10483007B2 (en) 2017-07-25 2019-11-19 Intouch Technologies, Inc. Modular telehealth cart with thermal imaging and touch screen user interface

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4766900A (en) * 1985-12-18 1988-08-30 Telectronics N.V. Rate responsive pacing system using the integrated cardiac event potential
US5350410A (en) * 1992-11-23 1994-09-27 Siemens Pacesetter, Inc. Autocapture system for implantable pulse generator
EP0872260A2 (en) * 1997-04-14 1998-10-21 Pacesetter, Inc. Implantable pacemaker
US5954756A (en) * 1998-04-09 1999-09-21 Medtronic, Inc. Microprocessor capture detection circuit and method
EP1023919A2 (en) * 1999-01-26 2000-08-02 Pacesetter, Inc. An implantable cardiac stimulation device
US20010049542A1 (en) * 2000-05-11 2001-12-06 Florio Joseph J. System and method for automatically verifying capture during multi-chamber stimulation
WO2002058550A2 (en) * 2000-11-10 2002-08-01 C.R. Bard, Inc. Tracking ectopic beats or deriving p-waves in electrocardiac signals having superimposed complexes

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4766900A (en) * 1985-12-18 1988-08-30 Telectronics N.V. Rate responsive pacing system using the integrated cardiac event potential
US5350410A (en) * 1992-11-23 1994-09-27 Siemens Pacesetter, Inc. Autocapture system for implantable pulse generator
EP0872260A2 (en) * 1997-04-14 1998-10-21 Pacesetter, Inc. Implantable pacemaker
US5954756A (en) * 1998-04-09 1999-09-21 Medtronic, Inc. Microprocessor capture detection circuit and method
EP1023919A2 (en) * 1999-01-26 2000-08-02 Pacesetter, Inc. An implantable cardiac stimulation device
US20010049542A1 (en) * 2000-05-11 2001-12-06 Florio Joseph J. System and method for automatically verifying capture during multi-chamber stimulation
WO2002058550A2 (en) * 2000-11-10 2002-08-01 C.R. Bard, Inc. Tracking ectopic beats or deriving p-waves in electrocardiac signals having superimposed complexes

Also Published As

Publication number Publication date
AU2003267019A8 (en) 2004-03-19
EP1536860A2 (en) 2005-06-08
AU2003267019A1 (en) 2004-03-19
WO2004019775A3 (en) 2005-02-10

Similar Documents

Publication Publication Date Title
US7657305B2 (en) Implantable medical device for improved storage of intracardiac electrograms
US6345201B1 (en) System and method for ventricular capture using far-field evoked response
US8073536B2 (en) Method and apparatus for post-processing of episodes detected by a medical device
US5350410A (en) Autocapture system for implantable pulse generator
US5458623A (en) Automatic atrial pacing threshold determination utilizing an external programmer and a surface electrogram
EP1615693B1 (en) Apparatus for identifying cardiac and non-cardiac oversensing using intracardiac electrograms
US7899520B2 (en) Medical device for monitoring biological signals
US8401644B2 (en) Method and apparatus for post-processing of episodes detected by a medical device
US20050004612A1 (en) Form analysis to detect evoked response
US9993171B2 (en) Automated screening methods and apparatuses for implantable medical devices
US20090088814A1 (en) Heart stimulating system
EP1222942B1 (en) System for automating capture verification assessment and pacing threshold assessment using a programmer
US9895074B2 (en) Methodology for automated signal morphology analysis in implantable electrotherapy and diagnostic systems
EP1536860A2 (en) Capture detector
US6473650B1 (en) Evoked response detector for a heart stimulator
EP1885446B1 (en) System for remote pacing threshold assessment
US7184816B2 (en) Cardiac stimulating and detecting device, system and method for identifying far field signals
US20220143406A1 (en) Analysis device for supporting the implantation of a system for stimulating the human or animal heart
De Voir et al. A New Approach for an Automated ECG-Morphology Based Dual Chamber Capture Detector
US8583219B1 (en) Intracardiac device and method for storing cardiac test results and associated EGM data
Ghiringhelli et al. Assessment of pacemaker function in ambulatory ECG recordings using real time analysis
Bernstein et al. Computer Applications in Medical Care. Ambulatory Care Computer Systems. Implantable Devices: Cardiac Pacemakers: Computer-Aided Detection of Pacemaker System Problems
Bernstein et al. Computer-aided detection of pacemaker system problems
Andersson et al. A software sensor using neural networks for detection of patient workload

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A2

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A2

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2003747937

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: 2003747937

Country of ref document: EP

NENP Non-entry into the national phase in:

Ref country code: JP

WWW Wipo information: withdrawn in national office

Country of ref document: JP