fig1 illustrates an embodiment of an oximetry system incorporating the present invention . a sensor 10 includes red and infrared leds and a photodetector . these are connected by a cable 12 to a board 14 . led drive current is provided by an led drive interface 16 . the received photocurrent from the sensor is provided to an i - v interface 18 . the ir and red voltages are then provided to a sigma - delta interface 20 incorporating the present invention . the output of sigma - delta interface 20 is provided to a microcontroller 22 which includes a 10 - bit a / d converter . controller 22 includes flash memory for a program , and eeprom memory for data . the processor also includes a controller chip 24 connected to a flash memory 26 . finally , a clock 28 is used and an interface 30 to a digital calibration in the sensor 10 is provided . a separate host 32 receives the processed information , as well as receiving an analog signal on a line 34 for providing an analog display . design summary the design of the present invention is intended to deal with unwanted noise . signal metrics are measured and used to determine filter weighting . signal metrics are things that indicate if a pulse is likely a plethysmograph or noise , such as frequency ( is it in the range of a human heart rate ), shape ( is it shaped like a heart pulse ), rise time , etc . a similar technique was used in the nellcor n200 , described in the background of this application . the new design adds a number of different features and variations , such as the use of two ensemble averagers as claimed in the present invention . details of the architecture are shown in the diagram of fig2 . this design calculates both the oxygen saturation , and the pulse rate , which are described separately below . a . signal conditioning — the digitized red and ir signals are received and are conditioned in this block by ( 1 ) taking the 1st derivative to get rid of baseline shift , ( 2 ) low pass filtering with fixed coefficients , and ( 3 ) dividing by a dc value to preserve the ratio . the function of the signal conditioning subsystem is to emphasize the higher frequencies that occur in the human plethysmograph and to attenuate low frequencies in which motion artifact is usually concentrated . the signal conditioning subsystem selects its filter coefficients ( wide or narrow band ) based on hardware characteristics identified during initialization . b . pulse identification and qualification — the low pass filtered and digitized red and ir signals are provided to this block to identify pulses , and qualify them as likely arterial pulses . this is done using a pre - trained neural network , and is primarily done on the ir signal . the pulse is identified by examining its amplitude , shape and frequency , just as was done in the nellcor n - 100 . an input to this block is the average pulse period from block d . this function is similar to the n - 100 , which changed the upfront qualification using the pulse rate . the output indicates the degree of arrhythmia and individual pulse quality . inputs —( 1 ) pre - processed red and ir signals , ( 2 ) ave . pulse period , ( 3 ) lowpass waveforms from the low pass filter . outputs —( 1 ) degree of arrhythmia , ( 2 ) pulse amplitude variations , ( 3 ) individual pulse quality , ( 4 ) pulse beep notification , ( 5 ) qualified pulse periods and age . c . compute signal quality metrics — this block determines the pulse shape ( derivative skew ), period variability , pulse amplitude and variability , ratio of ratios variability , and frequency content relative to pulse rate . inputs —( 1 ) raw digitized red and ir signals , ( 2 ) degree of arrhythmia , individual pulse quality , pulse amplitude variation ( 3 ) pre - processed red and ir signals , ( 4 ) average pulse period . outputs —( 1 ) lowpass and ensemble averaging filter weights , ( 2 ) metrics for sensor off detector , ( 3 ) normalized pre - processed waveforms , ( 4 ) percent modulation . d . average pulse periods . this block calculates the average pulse period from the pulses received . e1 . lowpass filter and ensemble averaging — block e1 low pass filters and ensemble averages the signal conditioned by block a , and normalized by block c , for the pulse rate identification . the weights for the low pass filter are determined by the signal metrics block c . the signal is also ensemble averaged ( this attenuates frequencies other than those of interest near the pulse rate and its harmonics ), with the ensemble averaging filter weights also determined by signal metrics block c . less weight is assigned if the signal is flagged as degraded . more weight is assigned if the signal is flagged as arrhythmic because ensemble - averaging is not appropriate during arrhythmia . red and ir are processed separately , but with the same filtering weights . the filtering is delayed approximately one second to allow the signal metrics to be calculated first . the filters use continuously variable weights . if samples are not to be ensemble - averaged , then the weighting for the previous filtered samples is set to zero in the weighted average , and the new samples are still processed through the code . this block tracks the age of the signal — the accumulated amount of filtering ( sum of response times and delays in processing ). too old a result will be flagged ( if good pulses haven &# 39 ; t been detected for awhile ). inputs —( 1 ) normalized pre - processed red and ir signals , ( 2 ) average pulse period , ( 3 ) low pass filter weights and ensemble averaging filter weights , ( 4 ) ecg triggers , if available , ( 5 ) ir fundamental , for zero - crossing triggers . f . estimate filtered waveform correlation and calculate averaging weight — this uses a noise metric similar to that used in the n100 and n200 described above , and doesn &# 39 ; t use feedback . the variable weighting for the filter is controlled by the ratio - of - ratios variance . the effect of this variable - weight filtering is that the ratio - of - ratios changes slowly as artifact increases and changes quickly as artifact decreases . the subsystem has two response modes . filtering in the fast mode targets an age metric of 3 seconds . the target age is 5 seconds in normal mode . in fast mode , the minimum weighting of the current value is clipped at a higher level . in other words , a low weight is assigned to the newest ratio - of - ratios calculation if there is noise present , and a high weight if no noise is present . inputs —( 1 ) filtered red and ir signals and age , ( 2 ) calibration coefficients , ( 3 ) response mode ( user speed settings ). h . calculate saturation — saturation is calculated using an algorithm with the calibration coefficients and averaged ratio of ratios . e2 . lowpass filter and ensemble averaging — block e2 low pass filters and ensemble averages the signal conditioned by block a , for the pulse rate identification . the weights for the low pass filter are determined by the signal metrics block c . the signal is also ensemble averaged ( this attenuates frequencies other than those of interest near the pulse rate and its harmonics ), with the ensemble averaging filter weights also determined by signal metrics block c . less weight is assigned if the signal is flagged as degraded . more weight is assigned if the signal is flagged as arrhythmic since filtering is not appropriate during arrhythmia . red and ir are processed separately . the process of this block is delayed approximately one second to allow the signal metrics to be calculated first . the filters use continuously variable weights . if samples are not to be ensemble - averaged , then the weighting for the previous filtered samples is set to zero in the weighted average , and the new samples are still processed through the code . this block tracks the age of the signal — the accumulated amount of filtering ( sum of response times and delays in processing ). too old a result will be flagged ( if good pulses haven &# 39 ; t been detected for awhile ). inputs —( 1 ) pre - processed red and ir signals , ( 2 ) average pulse period , ( 3 ) lowpass filter weights and ensemble averaging filter weights , ( 4 ) ecg triggers , if available , ( 5 ) ir fundamental , for zero - crossing triggers . i . filtered pulse identification and qualification — this block identifies and qualifies pulse periods from the filtered waveforms , and its results are used only when a pulse is disqualified by block b . inputs —( 1 ) filtered red and ir signals and age , ( 2 ) average pulse period , ( 3 ) hardware id or noise floor , ( 4 ) kind of sensor . j . average pulse periods and calculate pulse rate — this block calculates the pulse rate and average pulse period . k . detect venous pulsation — block k receives as inputs the pre - processed red and ir signal and age from block a , and pulse rate and provides an indication of venous pulsation as an output . this subsystem produces an ir fundamental waveform in the time domain using a single - tooth comb filter which is output to the ensemble averaging filters . l . detect sensor - off and loss of pulse amplitude — the pulse lost and sensor off detection subsystem uses a pre - trained neural net to determine whether the sensor is off the patient . the inputs to the neural net are metrics that quantify several aspects of the behavior of the ir and red values over the last several seconds . samples are ignored by many of the algorithm &# 39 ; s subsystems while the signal state is not either pulse present or sensor maybe off . the values of the signal state variable are : “ pulse present , disconnect , pulse lost , sensor maybe off , and sensor off .” ensemble averaging subsystem . the function of the ensemble averaging subsystem is to filter its input streams with a variable weighting , and output waveforms that are less distorted by noise or motion artifact . reducing the degree of artifact in the filtered waveforms enables a more robust saturation or rate estimate during motion or noise . the ensemble averaging subsystem requires ir and red inputs every sample that are zero - mean over the span of several pulses . input samples are first iir lowpass filtered with a weight received from the signal metrics subsystem ( lpf_weight ) and then stored in a one - second - delay buffer . it averages the ith ir and red samples of the current one - second delayed input pulse with the ith samples of the previous composite pulse to form the ith samples of the current composite pulse . the trigger to start the beginning of a pulse period is derived from ( in order of priority ) the r wave_occurred input and the average period input ( optical_period ). the weight given to the current sample versus the corresponding sample of the previous pulse is determined by the value of ensemble_averaging_weight value received from the signal metrics subsystem . this composite pulse is less distorted by noise or motion artifact than the filter &# 39 ; s input pulses . fig3 is a conceptual illustration of how pulses are averaged together to form the composite pulse . the subsystem receives and qualifies triggers , which should be synchronous with the heartbeat . the triggers are qualified r - wave triggers from the r - wave qualification subsystem when available . when r - wave triggers are unavailable , the triggers are generated internally from the average period input from the pulse rate calculation subsystem ( optical_period ). a “ pulse ” is considered to start at each qualified trigger and end at the next qualified trigger . in this way , consecutive triggers are used to define the ensemble averaging period . fig4 shows a representation of the subsystem &# 39 ; s response to a series of pulses corrupted by motion artifact . the vertical lines are r - wave triggers . the filtered output restores the approximate shape and size of the input pulses . the amount of averaging increases as the motion artifact increases as determined by the ensemble_averaging_weight received from signal metrics subsystem . fig4 is an example of the ensemble averaging subsystem &# 39 ; s variable weighting . r - wave triggers mark the start of each pulse . the ir input line shows pulses corrupted by motion artifact . the filtered ir line is a composite of multiple pulses that largely restores the original pulse size and shape . filtered ir is delayed by one second from the ir input . lowpass filter — the ir and red input waveforms are iir filtered using a weight ( lpf_weight ) received from the signal metrics subsystem as follows : during subsystem initialization , the weight is set to a default of 1 . 0 . one - second delay buffer — the ir and red lowpass_waveforms ( along with their associated age and status ) and the r wave_occurred input are stored in one - second long buffers ( ir_inputs , red_inputs , input_valid , age_inputs , rwave_inputs ). timestamp — the timestamp ( current_time_ctr ) is simply a 32 - bit counter that is initialized to 0 and then incremented every sample period . several received values are stored along with their timestamps in order to reconstruct their age . ensemble weight buffer — the last four ensemble_averaging_weights received and their timestamps are stored in the ensemble_average_buffer and the ensemble_weight_timestamp . this allows every entry in the one - second delay buffers to be associated with its correct weight . whenever delayed inputs are retrieved from the one - second delay buffers , the associated ensemble weight is set to the oldest weight in this buffer that is at least as recent as the delayed sample ( weight timestamp + one second ≧ current_time_ctr ). trigger qualification — the subsystem selects its trigger from one of two inputs : rwave_occurred or optical_period . rwave_occurred is the default trigger . before rwave_occurred is used as a trigger , it passes through the one - second - delay buffer mentioned earlier in order to be synchronous with the delayed ir and red samples . triggers based on optical_period input from the pulse rate calculation subsystem are only qualified when r - wave triggers have not been received for at least five seconds . this waiting period is deemed sufficient to determine that r - wave triggers are unavailable . then , the first trigger from the optical_period is delayed until the first zero - crossing of the subsystem &# 39 ; s optical_trigger_wf input waveform . subsequently , the trigger is derived solely from optical_period . ensemble averaging model — the subsystem receives ir and red input samples and a trigger to indicate the start of each pulse . note that the ir and red inputs have already been lowpass filtered and passed through the one - second - delay buffer . it estimates the pulsatile component of its current input sample by averaging the ith sample of the current pulse with the ith sample of the previous estimated pulse . the filter output is therefore a composite of multiple pulses , calculated as each sample is received . the filter has the frequency response of a comb filter that only passes frequencies at or near the pulse rate and its harmonics . the amount of averaging determines the width of the comb filter &# 39 ; s “ teeth ”. the filter assumes that the ith sample value of the current pulse is roughly equal to the ith sample of the previous pulse . note that i is a ramp function of time , t , that has a value of zero at each qualified trigger and increments at each subsequent sample . ensemble averaging filter equations and intermediate variables — the ensemble averaging filter uses the ensemble_averaging_weight , w , which is supplied by the signal metrics subsystem . the following equation shows the basic steps that must be performed at the ith sample of every pulse : where z ′ i denotes the value of z i from one pulse ago . z i is the ensemble - filtered output of the subsystem . all z i s are stored in the composite pulse buffer . x t is the most recent output sample from the one - second - delay buffer . all the variables in equation 1 are scalars . composite pulse buffers — the composite ir and red pulses are stored in separate composite pulse buffers . the index , i , is reset to the start of the buffers when a trigger is received and then incremented for each sample . the buffers must be long enough to store one 20 bpm pulse plus a 10 percent margin to allow for pulse - rate variability . therefore , the buffers are updated with at least 1 . 1 consecutive composite pulses at 20 bpm and two composite pulses at most pulse rates . if i should go past the end of the buffer , normal processing must be suspended until the next trigger , during which time the filter &# 39 ; s outputs will be set identical to its inputs . when the interval between triggers gets longer , the composite pulse buffers may not contain recent samples to average at the end of a pulse . the jth sample of the composite pulse is calculated each sample , where j = i + m and m is the number of samples between the current and previous qualified triggers , i . e the pulse period . note that j , like i , is a ramp function of t . the same value of w is used to calculate z i and z j . when j reaches the end of the buffer , calculation of z j must be suspended until j becomes valid again . changing pulse periods might cause small discontinuities in the subsystem output after each trigger is received . special processing during the first four samples after a trigger reduces this effect . the filtered output sample is interpolated between the standard output ( equation 1 ) and the second composite pulse ( equation 1b ), so that the filtered output is respectively 80 %, 60 %, 40 %, and 20 % of z j on these samples . if the second composite pulse is not available , the input waveform is used in its place . initialization , reinitialization , clearing and ignored samples — until two triggers plus one second samples have been received , j is meaningless and z j is not calculated . the subsystem contains two methods to recover from an interruption in processing . when more than five seconds elapse between triggers , the subsystem is “ cleared ” at the next qualified trigger . the clearing operation sets all of the subsystem &# 39 ; s persistent variables to their initial values , with the exception of the following variables that are essential to trigger qualification and maintaining the one - second - delay buffers : 1 . the subsystem &# 39 ; s current timestamp . 2 . the elapsed times since the last r - wave trigger and the last qualified trigger . 3 . the previous optical_trigger_waveform sample , used to detect zero crossings . 4 . the state of the trigger qualification state machine . 5 . one - second delay input buffers 6 . ensemble_averaging_weight buffer this “ clearing ” operation is performed because this condition should be rare and may indicate a lengthy interruption in processing . the filter outputs are also identical to the filter inputs whenever i overflows the end of the composite pulse buffer . when a sample is ignored ( not processed ) due to lack of valid input for periods under five seconds , the composite pulse buffer is left unchanged and the subsystem &# 39 ; s outputs are marked invalid . when processing resumes and if optical_period is non - zero , the buffer &# 39 ; s indices are reset to what they should have been an integral number of pulse periods ago and the one - second - delay buffers are reset . this is done because the composite pulse buffer should still contain an accurate representation of current pulses after a brief interruption in processing . the subsystem is “ cleared ” if the optical_period estimate is zero ( invalid ) or samples are ignored for at least five seconds . most “ ignored samples ” are expected to be due to the adjustments in the oximeter &# 39 ; s led brightness or amplifier gain , which generally take less than two seconds . the equations for resetting the indices are as follows : elapsed_periods = int ( interruption_duration / optical_period ) samples_in_fractional_period = interruption_duration — elapsed_periods * optical_period new_idx = round ( i_idx + samples_in_fractional_period ) or if new_idx ≧ optical_period , new_idx = round ( i_idx + samples_in_fractional_period — optical_period ) j = new_idx + j − i_idx , provided j has not already overflowed , and would not overflow , the composite pulse buffer . i_idx = new_idx , provided i_idx has not already overflowed , and would not overflow , the composite pulse buffer . the ensemble averaging subsystem is reinitialized when the pulse lost and sensor off detection subsystem determines that a pulse has been re - acquired after being absent for a prolonged period of time , or when a sensor is connected . “ reinitialization ” means that all of the subsystem &# 39 ; s persistent variables are set to their initial values . this is done because both of the events that invoke reinitialization make it likely that the ensemble averaging subsystem &# 39 ; s previous pulse representation is no longer current . the elapsed time intervals since the last r - wave and the last qualified trigger are incremented on ignored samples . r - waves or zero - crossings that occur during ignored samples are not used to qualify triggers . the state transition diagrams of fig5 - 7 show the state machines for updating each of the two pulses maintained in the composite pulse buffers and their indices . age metric — the subsystem receives the age in samples , age_inputs t , of its ir and red inputs and outputs the age , age_out i , of its composite pulse outputs . for each sample , age_out i , is incremented by the elapsed time since it was last updated and then averaged with age_inputs 1 , using the filter weight ( ensemble_averaging_weight ), w , used to update the composite waveforms . the formula for age_out t is : age_out i = age_out ′ i + m + w t (( age_in t + n )−( age_out ′ 1 + m )) where m is the number of samples since age_out i was last updated and n is the number of samples in one second . the timestamp at which each age_out j is updated must be stored in order to calculate m . the subsystem must also update age_out j . the formula for age_out j is as above , except that j is substituted for i . the subsystem must increment a current timestamp ( current_time_ctr ) every sample , including ignored samples . when the subsystem is cleared or reinitialized , all entries in the age_out buffer are reinitialized to age_inputs t . furthermore , all entries in the buffer for the timestamps at which the age_out entries were updated are set to the current timestamp minus 1 . these steps are taken to assure that the age_out values are no older than the elapsed time since the subsystem was cleared or reinitialized . the ensemble averaging instance whose waveforms are used for pulse qualification and pulse rate uses rate_lpf_weight , which depends solely on frequency content . the ensemble averaging instance whose waveforms are used to calculate ratio - of - ratios and saturation uses sat_lpf_weight , which also depends on whether the ror_variance metric would be better ( lower ) with the addition of lowpass filtering . these weights will range between 0 . 1 and 1 . 0 , and will not increase more than 0 . 05 in any single step . when the subsystem is notified that the pulse identification and qualification subsystem has just completed evaluation of a potential pulse , the subsystem updates ensemble - averaging weights , used by the instances of the ensemble averaging subsystem . separate weights are computed for the two ensemble averaging instances whose outputs are used in computing saturation and pulse rate . these weights are based in part on metrics provided by the instance of the pulse identification and qualification subsystem whose input waveforms have not been ensemble averaged . x = max ( short_ror_variance , pulse_qual_ror_variance / 1 . 5 )* max ( long_term_pulse_amp_ratio , 1 . 0 ) ror_variance_based_filt_wt = 0 . 5 * 0 . 05 / max ( 0 . 05 , x ) arr_prob =( period_var − 0 . 1 * short_ror_variance − 0 . 09 )/( 0 . 25 − 0 . 09 ); arr_min_filt_wt_for_sat = 0 . 05 + 0 . 5 * bound ( arr_prob , 0 , 1 . 0 ) sat_ensemble_averaging_filter_weight = max ( ror_variance_based_filt_wt , arr_min_filt_wt_for_sat )*( 1 . 0 + pulse_qual_score ) sat_ensemble_averaging_filter_weight = min ( sat_ensemble_averaging_filter_weight , 1 . 0 ) the above equations result in a default weight of 0 . 5 for low values of the ratio - of - ratios variances . short_ror_variance and pulse_qual_ror_variance are both computed over a three - second interval . the interval for pulse_qual_ror_variance ends with the qualification or rejection of the most recent pulse , which would usually include the most recent samples . the weight is reduced by high ratio - of - ratios variances , and by high values of long_term_pulse_amp_ratio that would typically indicate motion artifact . arr_min_filt_wt_for_sat imposes a minimum value on the ensemble - averaging weight ( range 0 . 05 - 0 . 55 ) based primarily on period_var , which quantifies the degree of arrhythmia . this is done because ensemble - averaging is not effective for pulses having dissimilar periods . if the most recent pulse received a good pulse_qual_score , this can increase the maximum value of sat_ensemble_averaging_filter_weight from 0 . 5 to 1 . 0 . a ) the thresholds used to compute arr_prob are somewhat lower , because it is desirable that arrhythmic pulses not be obscured by ensemble averaging prior to pulse qualification . b ) small values of short_term_pulse_amp_ratio typically indicate that motion artifact has just subsided , which means that the ensemble - averaging weight may be quickly increased . this has been found empirically to be beneficial for pulse qualification , but not for ratio - of - ratios filtering and saturation computation . c ) if the heart skips a beat , with or without prior arrhythmia , the longer - than - average qualified_pulse_period that results will increase the ensemble - averaging weight , so as not to obscure the skipped beat from subsequent pulse qualification . long_term_pulse_amp ratio — quantifies last pulse amplitude compared to historic pulse amplitude . provided by the pulse identification and qualification subsystem . values substantially larger than 1 . 0 are typically indicative of motion artifact , and result in lower ensemble_averaging_filter weights . period_var — period - variability metric from the pulse identification and qualification subsystem . used to gauge the extent of arrhythmia . pulse_qual_ror_variance — ror_variance metric from the pulse identification and qualification subsystem . for instance , a value of 0 . 10 would indicate that the average difference between consecutive pulse periods is 10 % of avg_period . pulse_qual_score — score computed by the pulse qualification neural net in the pulse identification and qualification subsystem . zero is extremely poor and 1 . 0 is excellent . qualified_pulse_period — most recent pulse period qualified by the pulse identification and qualification subsystem . lpf_ror_variance — quantifies variability of ratio - of - ratios . computed over a 9 - second window from lpf_scaled_waveforms . rate_lpf_weight — lowpass filter weight to be used by the instance of the ensemble averaging subsystem that preprocesses waveforms used for pulse qualification and pulse rate calculation . ror_variance — quantifies variability of ratio - of - ratios . computed over a 9 - second window from scaled_waveforms . a value of 0 . 10 would indicate that sample - to - sample ratio - of - ratios values differ from the mean ratio - of - ratios value by an average of 10 % of the mean ratio - of - ratios value . sat_ensemble_averaging_filter_weight — ensemble - averaging weight to be used by the instance of the ensemble averaging subsystem that preprocesses waveforms used for pulse qualification and pulse rate calculation . sat_lpf_weight — lowpass filter weight to be used by the instance of the ensemble averaging subsystem that preprocesses waveforms used for pulse qualification and pulse rate calculation . short_ror_variance — quantifies variability of ratio - of - ratios . computed over a 3 - second window from scaled_waveforms . arr_prob — likelihood of arrhythmia that would limit the amount of ensemble averaging . based on period_var , with threshold that are specific to each of the two ensemble_averaging_fiter_weights . arr_min_filt_wt_for_rate , arr_min_filt_wt_for_sat — minimum values for the two ensemble_averaging_filter_weights , based on their respective arr_prob values .
the use of two separate ensemble averagers for processing a detected waveform for use in calculating oxygen saturation and a pulse rate . the ensemble averager used for calculating oxygen saturation operates on a signal which has been normalized , while the ensemble averager for the pulse rate calculation operates on a signal which has not been normalized . the metrics chosen for the two paths through the two ensemble averagers can be varied to optimize the ensemble averaging for oxygen saturation or pulse rate calculations .