Method and apparatus for controlling the pacing rate of a metabolic demand pacemaker
A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by any one of the patent disclosure, as it appears in the Patent and Trademark Office patent files or records, but otherwise reserves all copyright rights whatsoever. 
    
    
     FIELD OF THE INVENTION 
     This invention relates to controlling a pacemaker, and more particularly to controlling a metabolic demand pacemaker in which the pacing rate is controlled according to an indicator of the metabolic demand, namely according to the level of activity of the patient wearing the pacemaker. 
     BACKGROUND OF THE INVENTION 
     During a person&#39;s effort, i.e., a level of activity above a baseline activity level at rest, certain physiological parameters become modified. The relative changes in these parameters can in some instances be correlated to the level of effort and give information about the metabolic demand. Rate-adaptive metabolic demand pacemakers monitor such a physiological parameter and process parameter changes, based on a relationship between the monitored parameter and the cardiac rate, to determine a cardiac pacing rate. As used herein, the term &#34;pacing rate&#34; and &#34;cardiac pacing&#34; should be understood to mean the frequency or rate at which electrical pulses are delivered to a suitable location of the heart to stimulate a contraction. For example, the calculated cardiac rate may be controlled by an algorithm defining the relationship between the sensed parameter and the corresponding activity level. Thus, the calculated cardiac rate is controlled corresponding to the activity level represented by the physiological parameter. 
     In most metabolic demand pacemakers, one of these parameters is selected and monitored. A measurement of the parameter is made periodically. There is then periodically determined an increase, decrease or an upholding of the cardiac rate based on any relative change in the measured parameter. 
     One problem with these devices is that the parameter may have a non-negligible physiological variability from one measurement to the next. This in turn may lead to an error of interpretation about the real activity of the patient. For example, if the selected physiological parameter is the minute ventilation (also known as minute volume), namely a parameter corresponding to the air volume being expired during one minute, this parameter will present erratic variations called &#34;ventilation gaps&#34; during a period of effort. These ventilation gaps correspond to changes in the breathing rhythm that cause a decrease of the minute ventilation measure during a few breathing cycles. 
     The direct consequence in a controlled system responsive to such a parameter is a momentary decrease of the cardiac rate. This occurs, however, while the patient is still active and perhaps increasingly active, and is detrimental. Imagine not breathing while running up a flight of stairs and swimming underwater. Of particular concern is the occurrence of ventilation gaps during an effort phase which result in a decrease in the cardiac rate. 
     There is thus a continuing need to provide improved control of a metabolic demand pacemaker so that non-negligible physiological variations in a monitored parameter do not result in an erroneous change in the pacing rate. 
     SUMMARY OF THE INVENTION 
     It is, therefore, an object of the present invention to provide for controlling the pacing rate in response to a physiological parameter to avoid premature variations of the pacing rate. 
     It is another object of the invention to distinguish between sensed changes in the monitored parameter corresponding to artifacts and changes corresponding to the end of an effort or recovery phase. 
     It is another object of the present invention to provide an improved algorithm for correlating changes in a monitored parameter to changes in the pacing rate. 
     It is another object to distinguish between the case of an increase of the value of the parameter liable to lead to an increase of the cardiac rate, and the case of a decrease of the value of the parameter liable to lead to a decrease of the cardiac rate. 
     It is another object of the invention to minimize, if not eliminate, the occurrence of a reduction in the cardiac rate during a phase of effort. 
     The present invention provides improved control over the pacing rate provided by a pacemaker to correspond to the patient&#39;s effort such that a monitored parameter representative of metabolic demand is processed to avoid physiologic variations not representative of effort. Broadly, the invention concerns methods and apparatus for periodically determining a cardiac pacing rate in response to a monitored physiological parameter such that a first plurality of measures of the parameter are compared to a second plurality of measures of the parameter, and determining that an effort is increasing, decreasing or remaining the same in response to the comparison. Accordingly, the pacing rate may be adjusted in response to the determination. 
     One aspect of the invention is directed towards a method for controlling a metabolic demand rate responsive pacemaker wherein a calculation of the cardiac rate CR is made every nth cardiac cycle based on a monitored physiological parameter. 
     One such method includes: 
     (a) monitoring a parameter that changes in response to changes in metabolic demand; 
     (b) determining a first average of a first plurality of parameter measures; 
     (c) determining a second average of a second plurality of parameter measures, the second plurality being measured relatively later in time than the first plurality; 
     (d) comparing the first and second determined averages; and 
     (e) determining that the effort is increasing in response to the first average being less than the second average and decreasing in response to the first average being greater than the second average. 
     In one embodiment, n may be selected from between 2 and 10 cycles, and more preferably 4 cycles, such that the cardiac rate is recalculated every four cardiac cycles. Each of the first plurality and the second plurality is selected from between 2 and 32 measures, preferably each being eight measures taken over eight parameter cycles such that the second average is of the most recent eight parameter cycles and the first average is of the eight parameter cycles preceding those used in determining the first average. The term &#34;parameter cycle&#34; refers to the frequency that a measure of the parameter is acquired, for example, a breathing cycle, a cardiac cycle or some selected cycle corresponding to a selected time period, depending on the physiology of the parameter. The averages are preferably sliding averages that are updated either with each new measure or with each calculation of the cardiac rate. 
     One preferred physiological parameter is minute ventilation having a parameter cycle that is a breathing cycle. Other parameters useful as indicators of metabolic demand, e.g., blood temperature, blood pH, and cardiac output, may be used. 
     In accordance with the present invention, the determination of whether an effort is continuing or whether a recovery phase has begun is based on the relationship between the two determined averages and may be used in selecting the pacing rate. More particularly, the determination may be used to select the pacing rate as one of the existing or last calculated value and the next or new calculated value. 
     Another method of the present invention is directed to controlling a metabolic demand rate responsive pacemaker wherein the pacing rate is periodically calculated every n cardiac cycles based on a linear control relationship with the monitored parameter. One such method comprises: 
     (a) monitoring the minute ventilation as the physiological parameter; 
     (b) determining an average of the measured minute ventilation MV-8-0 over the last eight breathing cycles, i.e., from the first to the eighth last cycles; 
     (c) determining an average of the measured minute ventilation MV-8-1 over the preceding eight breathing cycles, i.e., from the ninth to the sixteenth last cycles; 
     (d) comparing the averages MV-8-0 and MV-8-1; and 
     (e) determining that an effort phase exists when MV-8-0&gt;MV-8-1, and that a recovery phase is present with MV-8-0&lt;MV-8-1. 
     Preferably, the pacing rate is controlled in response to the measured physiological parameter, the determination of whether an effort or recovery phase exists, and the prior calculated cardiac rate. For example, the present invention advantageously provides that during a determined phase of effort, the pacing rate is maintained at its prior calculated value when a ventilation gap, corresponding to a temporary decrease of the minute ventilation, leads to the calculation of a decreasing controlled cardiac rate. After the end of the ventilation gap, the pacing rate will adjusted to be at the calculated cardiac rate at that time. 
     Also, during an effort phase the pacing rate is maintained at its last calculated value in the case of a decrease of the calculated cardiac rate, until the transition from an effort phase to the recovery phase is confirmed by the comparison of MV-8-0 and MV-8-1. Thereafter, in the recovery phase, the pacing rate will be adjusted to be at the calculated cardiac rate at that time. 
     Further, the invention provides that during the recovery phase, the cardiac pacing rate is reduced, while a deceleration slope is respected, and the last minimum controlled cardiac rate is memorized during the next four breathing cycles. This provides for the recovery phase to be maintained in the case of a ventilation artifact, indicative of renewed effort, that lasts less than four breathing cycles. If the ventilation increase continues past those four breathing cycles, then it is deemed not to be an artifact and the effort phase is resumed. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     Further features of the invention, its nature and various advantages will be more apparent from the accompanying drawings and the following detailed description of the invention, in which like reference numerals refer to like elements, and in which: 
     FIG. 1 is a plot of an arbitrary measure of minute ventilation MV versus a series of breathing cycles during an effort; 
     FIG. 2 is a plot comparing the minute ventilation MV plot of FIG. 1 and the calculated cardiac rate CR determined in response to minute ventilation versus breathing cycles; 
     FIG. 3 is a plot representing an increasing minute ventilation MV parameter measured versus breathing cycles; 
     FIG. 4 is a plot representing a decreasing minute ventilation MV measured versus breathing cycles; 
     FIG. 5 is a plot representing an increasing minute ventilation MV including a ventilation gap G versus breathing cycles during an effort phase; 
     FIG. 6 is a plot comparing the applied cardiac rate ACR and the calculated cardiac rate CCR versus breathing cycles during an effort phase including a ventilation gap; 
     FIG. 7 is a plot a comparing the applied cardiac rate ACR and the calculated cardiac rate CCR versus breathing cycles during a recovery phase; 
     FIG. 8 is a plot comparing the calculated cardiac rate CCR and an arbitrary measure of the minute ventilation MV versus breathing cycles, during a recovery phase including a rebound of ventilation during recovery; 
     FIG. 9 is a plot comparing the calculated cardiac rate CCR and an arbitrary measure of the minute ventilation MV versus breathing cycles, during a transition between recovery and effort phases; 
     FIG. 10 is a state diagram in accordance with the present invention; 
     FIG. 11 is a block diagram of the apparatus of a preferred embodiment of the present invention; 
     FIG. 12 is a flow chart of the transthroacic impedance processing and minute ventilation determining functions in accordance with an embodiment of the present invention; and 
     FIGS. 13A-13D are a flow chart of the pacing rate determining functions in accordance with an embodiment of the present invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     Referring to FIGS. 1-10, a preferred embodiment of the present invention incorporates a measure of the minute ventilation parameter. FIG. 1 illustrates an arbitrary minute ventilation MV during an effort test in response to the physiological parameter monitored by a suitable sensor. The occurrence of ventilation gaps are indicated, some of which are labeled G. 
     Preferably, the minute ventilation parameter is obtained by injecting a pulsatile current (e.g., 15 microsecond pulses having an amplitude of 400 microamps at a repetition rate of 8 Hz) into the heart and measuring transthoracic impedance variations using a conventional bipolar endocardial lead in the right heart, e.g., lead Model T84, available from Ela Medical, Montrouge, France, bandpass filtering out impedance signal frequencies not related to the respiratory impedance variations, and converting the respiratory impedance maximum and minimum values and frequency variations over time into volume of air per minute. 
     The measured value MV (also referred to as &#34;sensed&#34; value) is then received for processing in accordance with the present invention. Preferably, MV is calculated every mth breathing cycle as an average of the measures acquired since the last calculation such that m is selected from between 2 and 16, preferably four. Alternate calculations may be made, for example, every breathing cycle based on an average of from 2 to 16 preceding measures. 
     Alternate techniques for acquiring minute ventilation and selecting a calculated cardiac pacing rate may, of course, be used. See for example, U.S. Pat. Nos. 4,901,725, 4,702,253 and 4,596,251. The actual acquisition of the physiological parameter and determination of the measure of minute ventilation parameter or other physiological parameter forms no part of the present invention. 
     As illustrated in FIG. 2, the curve CR shows a simulation of a control of the calculated cardiac rate CR according to the measured minute ventilation MV in accordance with the prior art. In spite of the presence of the ventilation gaps G during the effort, the rate response is relatively gradual. However, gaps GCR appear in the calculated cardiac rate during the rising phase of the activity level as a result of ventilation gaps G. Physiologically, the cardiac rate has only a very small variability as a function of the effort. 
     Advantageously, the present invention minimizes the occurrence of a decrease of the cardiac rate during a phase of effort, by distinguishing a physiological parameter from a real end of effort. 
     To achieve this, an analysis is made of the selected physiological parameters, namely, minute ventilation MV, and of its average values over a certain number of breathing cycles. The term &#34;MV-4&#34; refers to an average of the last four measured MV; the term &#34;MV-8-0&#34; refers to an average of the last eight measured MV; and the term &#34;MV-8-1&#34; refers to an average of the eight MV measured between the 9th and the 16th previous breathing cycles. 
     The principle of discriminating the ventilation gaps from an ending effort is based upon the evolution of the determined values of MV-8-0 and MV-8-1. Referring to FIG. 3, the minute ventilation parameter is shown increasing such that MV-8-0 is larger than MV-8-1. Referring to FIG. 4, the minute ventilation parameter is shown decreasing such that MV-8-0 is smaller than MV-8-1. Referring now to FIG. 5, the minute ventilation is generally increasing, and there is a ventilation gap G lasting over a few breathing cycles. However, the determined MV-8-0 remains larger than MV-8-1. 
     Accordingly, a relative decrease in the measure of minute ventilation during the effort phase can be identified. Consequently, by comparing the average minute ventilation over the last eight cycles with the average minute ventilation over the preceding last eight cycles, a genuine ending of an effort (MV-8-0&lt;MV-8-1) can be distinguished from a ventilation gap (MV-8-0&gt;MV-8-1). 
     In this regard, FIG. 6 illustrates the difference between a calculated cardiac rate CCR and an applied cardiac rate ACR during an effort. The rate CCR is calculated through the control relationship with the last measured minute ventilation (or an average of a number of measures) and the rate ACR is determined in accordance with the present invention in response to the comparison of the two averages of minute ventilation over time. The calculated rate CCR thus follows the variation of the minute ventilation whereas the applied rate ACR does not follow a decrease in minute ventilation. 
     In the case of a ventilation gap, rate CCR decreases along the dotted line. In contrast, according to the invention, in response to either a calculated decrease in minute ventilation which may correspond to a suspected ventilation gap or a detected ventilation gap, the pacing rate becomes rate ACR which corresponds to the prior rate CCR rate calculated just before the decrease, which is maintained at that prior rate. The rate ACR then restarts its increment progression, and returns to the calculated rate CCR, as soon as the ventilation activity restarts up again. There is thus avoided a temporary decrease of the cardiac rate during a phase of effort. 
     The recovery phase is situated between the end of the effort phase and the return to the resting condition. During the recovery phase, the minute ventilation decreases to its basic value at the resting condition. To avoid perceiving a ventilation gap as an ending of an effort and being immediately followed by a decrease of the cardiac rate, the present invention uses the two determined average values for confirming the end of an effort when MV-8-0 becomes smaller than MV-8-1. Until the end of the effort is confirmed or until the ventilation gap ends as described above, which ever occurs first, the applied rate ACR, rather than the calculated rate CCR, is used to control the pacing rate. 
     Referring to FIG. 7, the variations of the cardiac rate at the end of an effort phase is illustrated. The dotted line represents the rate CCR calculated through the normal control relationship. When, at the end of an effort, the minute ventilation decreases, the calculated cardiac rate CCR also is decreasing. According to the invention, in the effort phase the applied cardiac rate ACR is maintained at the last calculated value prior to the decrease until confirmation of the ending of the effort. 
     As soon as the end of effort is confirmed, operation switches to in the recovery phase. During the recovery phase, the pacing rate is controlled different than in the effort phase. In particular, the pacing rate is the calculated cardiac rate CCR which varies as a function of the measure of the minute ventilation parameter in accordance with the control function. 
     Preferably, regardless of whether the system is in an effort phase or in a recovery phase, changes in the cardiac pacing rate are limited by preselected slopes that limit the relative increase or decrease in the cardiac rate from one rate to the next. Thus there are defined an acceleration slope and a deceleration slope. These are applied in each recalculation of the cardiac rate, namely at every four cardiac cycles. The slopes are applied over the cardiac cycle period, and are therefore expressed in milliseconds (ms). 
     During the recovery phase, the calculated cardiac rate is limited in its decrease by the deceleration slope. Thus, the increase in the period between successive pacing pulses will be limited by an interval corresponding to the deceleration slope. The deceleration slope period is a programmable value selected from between 16 and 94 ms, preferably 31 ms at every four cardiac cycles. Similarly, in an effort or recovery phase, the acceleration slope limits the decrease of the period between successive pacing pulses by a programmable amount selected from between 16 and 94, preferably 31 ms at every four cardiac cycles. 
     During the recovery phase, the sensed minute ventilation parameter is not always decreasing. A sensed increase of the ventilation may be observed, and also, therefore, an increase of the calculated heart rate. If this increase persists, it is determined that the effort is resumed, and operation changes from the recovery phase to the effort phase (see FIG. 9). On the other hand, if this increase of ventilation (and thus of the controlled cardiac rate) is merely a transient occurrence, it will then be necessary not to pass on to the effort condition (see FIG. 8). In this case, the cardiac pacing pulse rate will be the calculated cardiac rate which will increase and then decrease in response to the ventilation transient. 
     In accordance with the invention, if an increase in the rate CCR calculated according to the control relationship with the physiological parameter is observed, it will be authorized and, subject to the acceleration slope, be the pacing rate. If the increase occurs in the recovery mode, there will then be stored in a memory the smallest calculated cardiac rate value attained during the previous decreasing rate cycles. If the calculated cardiac rate becomes less than the stored minimal value before the 4th recalculation of the cardiac rate (each recalculation being made every four cardiac cycles), i.e., after 16 cardiac cycles, the system will then consider that it is not dealing with a restart of the effort, and it will remain in the recovery mode (see FIG. 8). 
     However, if at the 4th recalculation the calculated cardiac rate is still above the stored minimal value, the system will then consider that there is a restart of the effort. It will then switch over to the effort phase (see FIG. 9). This means that, in order to switch back again to the recovery phase, the above-described requirements will again have to be met, and a rate plateau will be observed prior to confirming the end of effort and returning to the recovery state. 
     The method for controlling the pacemaker according to the invention is implemented in the following manner: 
     Two functions are achieved in an asynchronous manner. First, at every four cardiac cycles, a new controlled cardiac rate is calculated, according to the ventilation information. This is performed by the metabolic demand pacemaker in the known, prior art manner. Second, at each 4th breathing cycle, a new average ventilation value will be calculated. This value and the three preceding average ventilation values are used for calculating MV-8-0 and MV-8-1. 
     The controlled cardiac rate CCR is calculated in accordance with a linear relationship established between the minute ventilation and the cardiac rate. Preferably, the linear relationship uses the following linear relationship, including the average value of ventilation over the last four measured values (MV-4): 
     
         CCR=a×MV-4+b; 
    
     wherein a and b are selected to provide a basic pacing rate when the person is in a rest condition such that a is a slope or scale parameter for correlating the relative increase of MV-4 above the rest value to an incremental cardiac pacing rate and b is the constant selected to provide the basic pacing rate corresponding to MV-4 at a resting condition. A and b are programmable in accordance with the patient&#39;s rest activity level and condition. In addition, the parameters a and b may be automatically determined and adjusted in response to ventilation information and if the average pacing rate is too low or too high over a selected time period, which determinations and adjustments form no part of the present invention. 
     Starting from this average value MV-4 at rest, the system monitors the minute ventilation parameter and changes in MV value to determine the effort situation of the patient. Referring to FIG. 10 and the state diagram of a device in accordance with the present invention, three states are defined: rest REST, effort EXER and recovery RECO. REST corresponds to a pacing rate which is calculated to be below a selected threshold value (basic period - 6%). EXER corresponds to a pacing rate which is increasing beyond the selected threshold value. RECO corresponds to a pacing rate which is above the threshold value, but which is nevertheless decreasing. 
     The changes from one state to the other depend upon the outcome of certain tests about the evolution of the controlled cardiac rate. The conditions of changes of states are schematized in the diagram of states in FIG. 10 and the Table below of Functions and Transitions. In the diagram of FIG. 10, transition Tracks 1 to 5 are directional as indicated by the arrows and are defined as follows, wherein terms in quotation marks correspond to the variables used in the Table and the software listing appended to this specification as indicated. 
     Track 1 represents the period of time between successive stimulating pulses at the calculated cardiac rate &#34;Present cycle per&#34; being less than the period of time corresponding to the threshold cardiac rate &#34;Per thr&#34;. Track 2 represents the period &#34;Present cycle per&#34; falling below the threshold period &#34;Per thr&#34;. Track 2 from the RECO state to the REST state is the normal path of return to the rest state at the end of a recovery phase in response to the period of time between successive pacing pulses at the applied cardiac rate &#34;Sensor esc per&#34; being greater than or equal to the threshold period &#34;Per thr&#34; minus the period of time corresponding to the programmed deceleration slope &#34;Prg dec slope&#34;. Track 2 from the EXER state to the REST state corresponds to the fast return to the rest state in the case of a ventilation artifact during the recovery phase as illustrated in FIG. 8. Track 3 represents a restart of the effort wherein the period &#34;present cycle per&#34; remains less than the stored maximum escape period between successive pacings in the recovery phase &#34;Max sensor esc per in reco&#34; after four cardiac recalculations, i.e., the counter &#34;4 cycles index&#34; is set equal to 4 (see FIG. 9). Track 4 represents the end of the effort wherein the period &#34;resent cycle per&#34; is less than the period &#34;Sensor esc per&#34; and the average MV-8-1 &#34;Aver vent 8-1&#34; is greater than or equal to the average MV-8-0 &#34;Aver Vent 8-0&#34; (see FIG. 7). Track 5 represents the criterion of the end of the effort is not met. 
     In the Table, the Old State category identifies the existing state, and provides separate transitions to New States, if any. The term PRESCYPER is the same as &#34;present cycle per&#34; corresponding to the time interval between stimulating pulses of the calculated cardiac rate; the term &#34;PERTHR&#34; is the same as &#34;Per thr&#34; and refers to the threshold cycle period corresponding in the threshold activity rate which is a function of programmed base period &#34;Prg bas per&#34; of the basic pacing rate; the term SENSECPER is the same as &#34;sensor esc per&#34; and refers to the sensed cycle period corresponding to the time interval between stimulating pulses of the applied cardiac pacing rate; the term PDESSLOPE is the same as &#34;Prg desc slope&#34; and is the interval of the programmed deceleration slope; the term AVERVEN81 is the same as &#34;Aver vent 8-1&#34; and MV-8-1; the term AVERVEN80 is the same as &#34;Aver vent 8-0&#34; and MV-8-0; the term MAXSENREC is the same as &#34; Max sensor esc per in reco&#34;, the term &#34;CYCLIND4&#34; is the same as &#34;4 cycle index&#34; which is in the index to start sensor descent; the &#34;Vent 4 stack&#34; refers to the stack memory for acquiring the last 4 measured minute ventilation used to form the averages MV-4, MV-8-0 and MV-8-1; the term &#34;Prg accel slope&#34; refers to the interval of the programmed acceleration slope. 
     
                                           TABLE                                   
__________________________________________________________________________
old                  new                                                  
state                                                                     
    INPUT            state                                                
                         B C F G H I J A                                  
__________________________________________________________________________
REST                                                                      
    PRESCYPER &lt; PERTHR                                                    
                     EXER  C   G     J                                    
    ELSE             REST                                                 
                         B                                                
EXER                                                                      
    PRESCYPER &gt;=PERTHR                                                    
    &amp; SENSESCPER&gt;=PERTHR                                                  
    -PDESSLOPE       REST  C                                              
    PRESCYPER &gt;SENSESCPER                                                 
    &amp; AVERVEN81&gt;=AVERVEN80                                                
                     RECO    F   H     A                                  
    PRESCYPER &gt; SENSESCPER                                                
    &amp; AVERVEN81&lt;AVERVEN80                                                 
                     EXER                                                 
    ELSE             EXER              A                                  
RECO                                                                      
    PRESCYPER &gt;=PERTHR                                                    
    &amp; SENSESCPER&gt;=PERTHR                                                  
    -PDESSLOPE       REST  C                                              
    PRESCYPER &lt; MAXSENREC                                                 
    &amp; CYCLIND4 = 3   EXER              A                                  
    PRESCYPER &lt; MAXSENREC                                                 
    &amp; CYCLIND4 = 3   RECO          I   A                                  
    ELSE             RECO    F   H     A                                  
__________________________________________________________________________
 The function key for the Table is as follows:                            
 A: Calc &#34;Sensor esc per                                                  
 B: Set &#34;Sensor esc per&#34; to &#34;Prg bas                                      
 C: Set &#34;Sensor esc per&#34; to &#34;Per thr                                      
 F: Update &#34;Max sensor esc per in reco                                    
 G: Set &#34;Index to start senor descent                                     
 H: Ser &#34;4 cycles index                                                   
 I: Increment &#34;4 cycles index                                             
 J: Update Vent 4 stack if                                                
 
    
     The method of the invention is preferably performed by a computer, more preferably, an eight bit microprocessor device having software instructions in a associated memory device, an input for receiving the calculated cardiac rate based on a selected control relationship, an input of the measure of the physiological parameter, e.g., minute ventilation, and an output for providing the selected cardiac pacing rate. A preferred device is the microprocessor of a rate adaptive metabolic demand dual chamber pacemaker having input parameters programmable for the patient&#39;s characteristics, including acceleration and deceleration slopes, in the known manner. Appropriate devices for converting analog circuit signals to digital signals and vice versa may be provided. It is to be understood, however, that the method also may be performed by analog circuit devices, and by a combination of digital and analog circuits. All of the foregoing components are conventional. 
     A suitable microprocessor controlled dual chamber pacemaker for use with the present invention is to one used in the model CHORUS™ I or II, available from Ela Medical, Montrouge, France, provided that it is first modified with a sensor, circuits and signal processing algorithm to acquire the measure of minute ventilation and provided with a suitable algorithm to calculate a cardiac rate in response to the ventilation. 
     A preferred embodiment of a software program useful for controlling a microprocessor controlled metabolic demand dual-chambered pacemaker in accordance with the present invention is as follows (written in the program description language): 
     
         __________________________________________________________________________
AVERVEN80: average of the 8 most recent ventilations                      
&#34;Aver vent 8-0&#34; =                                                         
 ##STR1##                                                                 
AVERVEN81: average of the 8 ventilations preceding the 8                  
           most recent ventilations                                       
&#34;Aver vent 8-1&#34;=                                                          
 ##STR2##                                                                 
CYCLIND4 = &#34;4 cycles index&#34;                                               
MAXSENREC = &#34;Max sensor esc per in reco&#34;                                  
PDESSLOPE = &#34;Prg desc slope&#34;                                              
PERTHR = &#34;Per thr&#34;                                                        
PRESCYPER = &#34;Present cycle per&#34;                                           
SENSESCPER = &#34;Sensor esc per&#34;                                             
Calc: &#34;sensor esc per&#34;                                                    
CASE   (&#34;Sensor esc per&#34;)                                                 
PART   (&gt; &#34;Present cycle per&#34; + &#34;Prg accel slope&#34;)                        
       &#34;Sensor esc per&#34; = Sensor esc per&#34; - &#34;Prg accl slope&#34;              
PART   (&lt; &#34;Present cycle per&#34; + &#34;Prg desc slope&#34;)                         
       &#34;Sensor esc per&#34; = &#34;Sensor esc per&#34; + &#34;Prg dec slope&#34;              
ELSE                                                                      
       &#34;SENSOR esc per&#34; = Present cycle per&#34;                              
ESAC                                                                      
IF     &#34;SENSOR esc per&#34; &lt; &#34;prg sensor min per&#34;                            
THEN                                                                      
       &#34;Sensor esc per&#34; = &#34;prg sensor min per&#34;                            
ELSE                                                                      
    IF   &#34;Sensor esc per&#34; &gt; &#34;prg bas per&#34;                                 
    THEN                                                                  
         &#34;Sensor esc per&#34; = &#34;prg bas per&#34;                                 
    ELSE                                                                  
    FI                                                                    
FI                                                                        
Set                                                                       
   &#34;Sensor esc per&#34; to &#34;Prg bas per&#34;                                      
   &#34;Sensor esc per&#34; = &#34;Prg bas per&#34;                                       
Set                                                                       
   &#34;Sensor esc per&#34; to &#34;Per thr&#34;                                          
   &#34;Sensor esc per&#34; = &#34;Per thr&#34;                                           
Update &#34;Max sensor esc per in reco&#34;                                       
    &#34;Max sensor esc per in reco&#34; = &#34;Present cycle per&#34;                    
Set                                                                       
   &#34;Index to start sensor descent&#34;                                        
   &#34;Index to start sensor descent&#34; = 1024                                 
Set                                                                       
   &#34;4 cycles index&#34;                                                       
   &#34;4 cycles index&#34; = 0                                                   
Increment &#34;4 cycles index&#34;                                                
&#34;4 cycles index&#34; = &#34;4 cycles index&#34; + 1                                   
Update Vent 4 stack                                                       
IF     &#34;Prg calib&#34; = 0                                                    
THEN                                                                      
       FOR i = 0 to 3                                                     
       DO                                                                 
        Vent 4 stack ((&#34;Vent 4 ptr&#34;+i)) = &#34;Min vent cal&#34;                  
       OD                                                                 
ELSE                                                                      
FI                                                                        
CASE (&#34;Exercise state&#34;)                                                   
PART (REST)                                                               
IF                                                                        
       &#34;Present cycle per&#34; &lt; &#34;Per thr&#34;                                    
THEN                                                                      
       &#34;Exercise state&#34; = EXER                                            
       &#34;Sensor esc per&#34; = &#34;Per thr&#34;                                       
       &#34;Index to start sensor descent&#34; = 1024                             
       Update Vent 4 stack if                                             
ELSE                                                                      
       &#34;Sensor esc per&#34; = &#34;Prg bas per&#34;                                   
FI                                                                        
PART (EXER)                                                               
IF                                                                        
       AND                                                                
           &#34;Present cycle per&#34; &gt; = &#34;Per thr&#34;                              
           &#34;Sensor esc per&#34; &gt; = &#34;Per thr&#34; - &#34;Prg desc slope&#34;              
       DNA                                                                
THEN                                                                      
&#34;Exercise state&#34; = REST                                                   
&#34;Sensor esc per&#34; = &#34;Per thr&#34;                                              
ELSE                                                                      
IF                                                                        
&#34;Present cycle per&#34; &gt; &#34;Sensor esc per&#34;                                    
THEN                                                                      
&#34;Aver vent 8-0&#34; =                                                         
 ##STR3##                                                                 
&#34;Aver vent 8-1&#34; =                                                         
 ##STR4##                                                                 
IF                                                                        
         &#34;Aver vent 8-1&#34; &gt; &#34;Aver vent 8-0&#34;                                
THEN                                                                      
         &#34;Exercise state&#34; = RECO                                          
         &#34;Max sensor esc per in reco&#34; = &#34;Present cycle per&#34;               
         &#34;4 cycles index&#34; = 0                                             
         Calc &#34;Sensor esc per&#34;                                            
ELSE                                                                      
FI                                                                        
ELSE                                                                      
Calc &#34;Sensor esc per&#34;                                                     
FI                                                                        
FI                                                                        
PART (RECO)                                                               
IF                                                                        
    AND                                                                   
         &#34;Present cycle per&#34; &gt;= &#34;Per thr&#34;                                 
         &#34;Sensor esc per&#34; &gt;= &#34;Per thr&#34; - &#34;Prg desc slope&#34;                 
    DNA                                                                   
THEN                                                                      
&#34;Exercise state&#34; = REST                                                   
&#34;Sensor esc per&#34; = &#34;Per thr&#34;                                              
ELSE                                                                      
IF                                                                        
         &#34;Present cycle per&#34; &lt; &#34;Max sensor esc per in reco&#34;               
THEN                                                                      
       IF                                                                 
           &#34;4 cycles index&#34; &gt;= 3                                          
THEN                                                                      
       &#34;Exercise state&#34; = EXER                                            
ELSE                                                                      
       &#34;4 cycles index&#34; = &#34;4 cycles index&#34; + l                            
FI                                                                        
ELSE                                                                      
&#34;Max sensor esc per in reco&#34; = &#34;Present cycle per&#34;                        
&#34;4 cycles index&#34; = 0                                                      
IF                                                                        
Calc &#34;Sensor esc per&#34;                                                     
FI                                                                        
ELSE                                                                      
&#34;Ram lsb&#34; = 00H                                                           
ESAC                                                                      
__________________________________________________________________________
 
    
     A preferred software code listing of a preferred embodiment for controlling a microprocessor controlled pacemaker in accordance with the invention is set forth in the software appendix. 
     Preparation of alternate suitable software for controlling other metabolic demand microprocessor controlled pacemakers, to operate in accordance with the present invention is believed to be well within the ability of a person of ordinary skill in the art. 
     One skilled in the art will appreciate that the present invention can be practiced by other than the described embodiments which are presented for purposes of illustration and not of limitation. 
     Referring to FIGS. 11, 12, and 13A--13D, a preferred embodiment of the apparatus and method steps of the present invention are shown. With reference to FIG. 11, an apparatus of the present invention includes a pacemaker 10 having a microprocessor 12, memory devices 14 for containing software programming, counters, acquired and processed data and other software related parameters, and an interface circuit 16 which includes circuits for conditioning signals sensed from the heart activity and transthoracic impedance measurements, converting the sensed analog signals to digital signals for processing by microprocessor 12, and a stimulating pulse generator. Also included are cardiac leads 17 and 18 which are implanted in the patient&#39;s heart 20 for monitoring cardiac electrical activity, providing stimulating pulses, and sensing the transthoracic impedance variations from which the minute ventilation measure is derived as already described. 
     Referring to FIG. 12, a flow chart for the processing of the transthoracic impedance data over a respiratory cycle by the microprocessor to determine a minute ventilation measure is shown. The routine starts at step 100 and first checks at step 101 whether a breathing cycle has been completed. If not, the routine waits until it has. If a breathing cycle is completed, then at step 102 the minute ventilation measure MV is calculated for that breathing cycle and a counter RESPIRATORY --  CYCLE counter is incremented. This cycle counter is checked at step 104 and if it is not equal to three, meaning that four breathing cycles have not elapsed since the counter was reset, the routine passes to process further breath data at step 101. If the counter is equal to three, then a new average of the last four measured values MV is obtained at step 104 and the cycle counter is reset to 0 at step 105. 
     At step 104 the various minute ventilation averages are recalculated such that the new average MV4(1) (based on the last four acquired MV values for the four most recent breath cycles) is added to the prior calculated average MV4(2) for the preceding four breath cycles (the fifth to eighth preceding breath cycles). These terms are averaged to provide the parameter MV-8-0. In addition, the previously calculated averages of MV4(3) (the ninth to twelfth preceding breath cycles) and MV4(4) (the thirteenth to sixteenth preceding breath cycles) are added and averaged to provide the parameter MV-8-1. The averages MV-8-0 and MV-8-1 are used in controlling the pacing rate as described herein. Thereafter, the routine returns to Start1 at step 100 to process further breath cycle data. 
     Referring to FIGS. 13A-13D, a flow chart for the processing of the cardiac cycle data and acquired minute ventilation data to provide the calculated pacing rate and an applied pacing rate is shown. This routine operates asynchronously from the routine that acquires the minute ventilation parameters illustrated in FIG. 12. The routine starts at step 200 and at step 201 waits until a cardiac cycle has completed before proceeding. At step 202, a counter CARDIAC --  CYCLE --  COUNTER is incremented and at step 203 the routine checks whether a selected number of cardiac cycles have occurred (i.e., whether the counter CARDIAC --  CYCLE COUNTER=N). If they have, then the cardiac cycle counter is reset to zero at step 204 and the routine then determines the cardiac pacing rate. This determination is made according to the patient&#39;s state of exercise and as a function of the determined average minute ventilation values MV4(n) (n=1, 2, 3, and 4) in accordance with the aforedescribed algorithm and in the following manner. 
     If the patient&#39;s state is at REST as determined at step 210, the routine passes to subroutine P1, as illustrated in FIG. 13B, where the interval Sensor --  int, calculated based on the calculated cardiac rate according to the algorithm a×MV4(1)+b, is compared to threshold interval Threshold --  int at step 211. The interval Threshold --  int is set to be 6% greater than the programmed basic pacing interval Basic --  int. If the interval Sensor --  int is less than the interval Threshold --  int, which corresponds to an increasing pacing rate, then at step 212 the interval Paced --  int is set equal to the Threshold --  int and the patient&#39;s exercise state is changed from rest (REST) to effort (EXER) state. If instead the interval Sensor --  int is greater or equal to the Threshold --  int, then at step 213 the pacing interval Paced --  int is set equal to the interval Basic --  int for the basic pacing rate and the patient&#39;s state is maintained in the REST state. In either case, the routine then ends and returns to step 200 to wait until the next N cardiac cycles occur and the pacing rate is recalculated. 
     If the patient&#39;s state is in EXER as determined at step 220, the routine branches to the subroutine P2, as illustrated in FIG. 13C. At step 221 it is determined whether the calculated interval Sensor --  int is greater than or equal to the threshold interval Threshold --  int, and whether Paced --  int is greater than or equal to the threshold interval minus the deceleration slope interval (Threshold --  int - Decslope). If both conditions are true, then the routine proceeds to step 222 where the pacing interval Paced --  int is set equal to Basic --  int and the patient&#39;s exercise state is set to REST. The routine then ends and returns to Start2 at step 200. If both of these conditions are not true, the routine then passes to step 224 where the following occurs. A counter 4 --  Cycles --  Index is set equal to zero, a term Max --  Sensor --  Reco is set equal to the Sensor --  int, and the patient&#39;s exercise state is changed to recovery (RECO). Thus, these conditions indicate that the pacing rate has slowed and the end of effort, as represented by MV8 --  1] MV8 --  0, has occurred. In this case, the pacing interval Paced --  int is set equal to the Sensor --  int, according to the algorithm. 
     At step 225, the routine tests whether the patient is undergoing a decrease in ventilation which is not yet confirmed as an end of effort, namely a presumed ventilation gap. If it is, i.e., Sensor --  int is greater than or equal to the Paced --  int and MV8 --  1 is greater than or equal to MV8 --  0, then the Paced --  int is not recalculated, Paced --  int is kept at its prior value. If the conditions tested at step 225 are not true, then the minute ventilation is not effectively decreasing and the pacing interval Paced --  int is calculated according to the algorithm at step 226. Thereafter, the subroutine P2 ends and returns to Start2 at step 200. 
     If it is determined that the patient&#39;s state is not in REST at step 210 or EXER at step 220, then it is in RECO and routine passes to subroutine P3, which illustrated in FIG. 13D. At step 230 the routine tests whether Sensor --  int  Threshold --  int and Paced --  int is greater than or equal to (Threshold --  int - Decslope). If both conditions are true, the routine passes to step 231 where the Paced --  int is set equal to the Basic --  int and the patient&#39;s exercise state is changed to REST. If instead both conditions at step 230 are not true, the routine passes to step 232 where it is determined if the Sensor --  int is less than stored value Max --  Sensor --  Reco and the counter 4 --  Cycles --  Index=3. If these two conditions are true, meaning that the pacing rate according to the algorithm is greater than the prior maximum interval during the recovery state and this condition has continued for four calculated cycles, then the routine passes to step 233 where the patient&#39;s state is changed to the EXER state and the pacing rate is calculated according to the algorithm. If both conditions of step 232 are not true, then the routine passes to step 234 where it is determined if the Sensor --  int is less than the Max --  Sensor --  Reco value and 4 --  Cycle --  Index is less than 3. If these conditions are true, then the routine passes to step 235 where the pacing rate is calculated according to the algorithm and the counter 4 --  Cycles --  Index is incremented. If the conditions at step 234 are not true, then the routine passes to step 236 where the passing rate is calculated according to the algorithm, the counter 4 --  Cycles-Index is reset to 0, and the value Max --  Sensor --  Reco is set equal to the Sensor --  Int. Thereafter, after setting or calculating the pacing rate at steps 231, 233, 235 or 236, the routine ends and returns to Start2 at step 200 for the next series of cardiac cycles.