the methods and systems in accordance with the embodiments of the present invention are directed towards the selection of ensemble averaging weights used for ensemble averaging of signals that correspond with detected waveforms from a pulse oximeter . the selection of ensemble averaging weights are based on one or more or a combination of various signal quality metrics or indicators . the embodiments of the present invention are particularly applicable to and will be explained by reference to measurements of oxygen saturation of hemoglobin in arterial blood and pulse or heart rate , as in pulse oximeter monitors and pulse oximetry sensors . however , it should be realized that the embodiments of the present invention are equally applicable to any generalized patient monitor and associated patient sensor , such as ecg , blood pressure , etc ., and are thus also applicable to non oximetry or pulse oximetry devices . a typical pulse oximeter measures two physiological parameters , percent oxygen saturation of arterial blood hemoglobin ( spo 2 or sat ) and pulse rate . oxygen saturation can be estimated using various techniques . in one common technique , the photocurrent generated by the photo - detector is conditioned and processed to determine the ratio of modulation ratios ( ratio of ratios ) of the red to infrared ( ir ) signals . this modulation ratio has been observed to correlate well to arterial oxygen saturation . pulse oximeters and sensors may be empirically calibrated by measuring the modulation ratio over a range of in vivo measured arterial oxygen saturations ( sao 2 ) on a set of patients , healthy volunteers , or animals . the observed correlation is used in an inverse manner to estimate blood oxygen saturation ( spo 2 ) based on the measured value of modulation ratios of a patient . the estimation of oxygen saturation using modulation ratios is described in u . s . pat . no . 5 , 853 , 364 , entitled “ method and apparatus for estimating physiological parameters using model - based adaptive filtering ,” issued dec . 29 , 1998 , and u . s . pat . no . 4 , 911 , 167 , entitled “ method and apparatus for detecting optical pulses ,” issued mar . 27 , 1990 , which are both herein incorporated by reference in their entirety for all purposes . the relationship between oxygen saturation and modulation ratio is described , for example , in u . s . pat . no . 5 , 645 , 059 , entitled “ medical sensor with modulated encoding scheme ,” issued jul . 8 , 1997 , which is herein incorporated by reference in its entirety for all purposes . most pulse oximeters extract the plethysmographic signal having first determined saturation or pulse rate , both of which are susceptible to interference . fig1 is a block diagram of one embodiment of a pulse oximeter that may be configured to implement the embodiments of the present invention . the embodiments of the present invention may be implemented as a data processing algorithm that is executed by the microprocessor 122 , described below . light from light source 110 passes into a blood perfused tissue 112 , and is scattered and detected by photodetector 114 . a sensor 100 containing the light source and photodetector may also contain an encoder 116 which provides signals indicative of the wavelength of light source 110 to allow the oximeter to select appropriate calibration coefficients for calculating oxygen saturation . encoder 116 may , for instance , be a resistor . sensor 100 is connected to a pulse oximeter 120 . the oximeter includes a microprocessor 122 connected to an internal bus 124 . also connected to the bus is a ram memory 126 and a display 128 . a time processing unit ( tpu ) 130 provides timing control signals to light drive circuitry 132 which controls when light source 110 is illuminated , and if multiple light sources are used , the multiplexed timing for the different light sources . tpu 130 also controls the gating - in of signals from photodetector 114 through an amplifier 133 and a switching circuit 134 . these signals are sampled at the proper time , depending upon which of multiple light sources is illuminated , if multiple light sources are used . the received signal is passed through an amplifier 136 , a low pass filter 138 , and an analog - to - digital converter 140 . the digital data is then stored in a queued serial module ( qsm ) 142 , for later downloading to ram 126 as qsm 142 fills up . in one embodiment , there may be multiple parallel paths of separate amplifier , filter and a / d converters for multiple light wavelengths or spectra received . based on the value of the received signals corresponding to the light received by photodetector 114 , microprocessor 122 will calculate the oxygen saturation using various algorithms . these algorithms require coefficients , which may be empirically determined , corresponding to , for example , the wavelengths of light used . these are stored in a rom 146 . in a two - wavelength system , the particular set of coefficients chosen for any pair of wavelength spectra is determined by the value indicated by encoder 116 corresponding to a particular light source in a particular sensor 100 . in one embodiment , multiple resistor values may be assigned to select different sets of coefficients . in another embodiment , the same resistors are used to select from among the coefficients appropriate for an infrared source paired with either a near red source or far red source . the selection between whether the near red or far red set will be chosen can be selected with a control input from control inputs 154 . control inputs 154 may be , for instance , a switch on the pulse oximeter , a keyboard , or a port providing instructions from a remote host computer . furthermore , any number of methods or algorithms may be used to determine a patient &# 39 ; s pulse rate , oxygen saturation or any other desired physiological parameter . the brief description of an exemplary pulse oximeter set forth above , serves as a basis for describing the methods for adjusting ensemble averaging weights for an ensemble averager , which are described below , in conjunction with fig2 . the embodiments of the present invention may be implemented as a part of a larger signal processing system used to process optical signals for the purposes of operating a pulse oximeter . such a signal processing system is shown in fig2 , which is a block diagram 200 of a signal processing architecture of a pulse oximeter in accordance with one embodiment of the present invention . the signal processing architecture 200 in accordance with the embodiments of the present invention may be implemented as a software algorithm that is executed by a processor of a pulse oximeter . in addition to calculating oxygen saturation and pulse rate , the system 200 measures various signal metrics that are used to determine filter weighting coefficients . signal metrics are things that indicate if a pulse is likely a plethysmograph or noise . signal metrics may be related to , for example , frequency ( is it in the range of a human heart rate ), shape ( is it shaped like a cardiac pulse ), rise time , etc . the system shown in fig2 calculates both the oxygen saturation , and the pulse rate . the system 200 is also used for detecting venous pulsation and sensor off and lost pulse conditions , which are described separately below . block 202 represents the operation of the signal conditioning block . the digitized red and ir signals or waveforms are received and are conditioned in this block by : ( 1 ) taking the 1 st 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 . inputs to block 202 are digitized red and ir signals , and its outputs are pre - processed red and ir signals . block 204 represents the operation of the pulse identification and qualification block . the low pass filtered 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 net , and is primarily done on the ir signal . the pulse is identified by examining its amplitude , shape and frequency . an input to this block is the average pulse period from block 208 . this function changes the upfront qualification using the pulse rate . the output of block 204 indicates the degree of arrhythmia and individual pulse quality . inputs to block 204 are : ( 1 ) pre - processed red and ir signals , ( 2 ) average pulse period , and ( 3 ) lowpass waveforms from the low pass filter . outputs from block 204 include : ( 1 ) degree of arrhythmia , ( 2 ) pulse amplitude variations , ( 3 ) individual pulse quality , ( 4 ) pulse beep notification , and ( 5 ) qualified pulse periods and age . block 206 is used to compute signal quality metrics . this block ( block 206 ) determines the pulse shape ( e . g ., derivative skew ), period variability , pulse amplitude and variability , ratio of ratios variability , and frequency content relative to pulse rate . inputs to block 206 include : ( 1 ) raw digitized red and ir signals , ( 2 ) degree of arrhythmia , individual pulse quality , pulse amplitude variation , ( 3 ) pre - processed red and ir signals , and ( 4 ) average pulse period . outputs from block 206 include : ( 1 ) lowpass and ensemble averaging filter weights , ( 2 ) metrics for sensor off detector , ( 3 ) normalized pre - processed waveforms , and ( 4 ) percent modulation . block 208 computes average pulse periods . this block ( block 208 ) calculates the average pulse period from the pulses received . inputs to block 208 include : qualified pulse periods and age . an output from block 208 includes the average pulse period . block 210 represents the functioning of the lowpass filter and ensemble averaging subsystem . block 210 low pass filters and ensemble averages normalized and preprocessed waveforms processed by block 206 . the weights for the low pass filter are determined by the signal metrics block 206 . the signal is also ensemble averaged ( i . e ., frequencies other than those of interest near the pulse rate and its harmonics are attenuated ), with the ensemble averaging filter weights also determined by signal metrics block 206 . 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 waveforms are processed separately , but with the same filtering weights . the filtering is delayed ( e . g ., 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 algorithm . this block tracks the age of the signal and / or the accumulated amount of filtering ( e . g ., sum of response times and delays in processing ). too old a result will be flagged , if good pulses haven &# 39 ; t been detected for a while . the inputs to block 210 include : ( 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 , and ( 5 ) ir fundamental , for zero - crossing triggers . outputs from block 210 include : ( 1 ) filtered red and ir signals , and ( 2 ) age . block 212 represents operations that estimate the ratio - of - ratios variance for the filtered waveforms and calculate averaging weights . 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 , including fast and normal modes . for example , filtering in the fast mode targets an age metric of 3 seconds , and the target age may be 5 seconds in the normal mode . in the 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 . the inputs to block 212 include : ( 1 ) filtered red and ir signals and age , ( 2 ) calibration coefficients , and ( 3 ) response mode ( e . g ., user speed settings ). outputs from block 212 include an averaging weight for ratio - of - ratios calculation . the averaging weight is used as an input to block 214 along with filtered ir and red waveforms to calculate averaged ratio of ratios and age . block 216 represents operations that calculate oxygen saturation . saturation is calculated using an algorithm with the calibration coefficients and averaged ratio of ratios . inputs to block 116 include : ( 1 ) averaged ratio - of - ratios , and ( 2 ) calibration coefficients . an output from block 216 is the oxygen saturation value . block 218 low pass filters and ensemble averages the signal ( s ) conditioned by block 202 , for the pulse rate identification . the weights for the low pass filter are determined by the signal metrics block 206 . the signal is also ensemble averaged ( i . e ., frequencies other than those of interest near the pulse rate and its harmonics are attenuated ), with the ensemble averaging filter weights also determined by signal metrics block 206 . 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 . the filtering is delayed ( e . g ., 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 algorithm . this block ( block 218 ) tracks the age of the signal and / or 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 to block 218 include : ( 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 , and ( 5 ) ir fundamental , for zero - crossing triggers . outputs from block 218 include : ( 1 ) filtered red and ir signals and ( 2 ) age . block 220 , or the filtered pulse identification and qualification block , calculates the pulse periods from the filtered waveforms , and its results are used only when a pulse is disqualified by block 204 . inputs to block 220 include : ( 1 ) filtered red and ir signals and age , ( 2 ) average pulse period , ( 3 ) hardware id or noise floor , ( 4 ) and the kind or type of sensor that is used to detect the ir and red energies . output from block 220 includes qualified pulse periods and age . block 222 , or the average pulse periods and calculate pulse rate block , calculates the pulse rate and average pulse period . this block ( block 222 ) receives qualified pulse periods and age as inputs and provides : ( 1 ) average pulse period and ( 2 ) pulse rate as outputs . block 224 , or the detect venous pulsation block receives as inputs the pre - processed red and ir signals and age from block 202 , and pulse rate and provides an indication of venous pulsation as an output . block 224 also provides an ir fundamental waveform in the time domain using a single - tooth comb filter which is output to the ensemble averaging filters ( e . g ., block 210 and 218 ). inputs to block 224 include : ( 1 ) filtered red and ir signals and age and ( 2 ) pulse rate . outputs from block 124 include : an indication of venous pulsation and ir fundamental . in one embodiment , block 224 measures the “ openness ” of an ir - red lissajous plot to determine the whether a flag ( e . g ., venous_pulsation ) should be set . the output flag ( e . g ., venous_pulsation ) is updated periodically ( e . g ., every second ). in addition , the ir fundamental waveform is output to the ensemble averaging filters . block 226 , or the detect sensor - off and loss of pulse amplitude block , uses a pre - trained neural net to determine whether the sensor is off the surface of the blood - perfused tissue , for example , of a 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 system 200 &# 39 ; s subsystems while the signal state is either not indicative of a pulse being present , or indicative that a sensor is not on a monitoring site ( e . g ., pulse present , disconnect , pulse lost , sensor may be off , and sensor off ). inputs to block 226 include : ( 1 ) signal quality metrics , and ( 2 ) the oximeter &# 39 ; s led brightness , amplifier gain , and ( 3 ) an id indicating the oximeter &# 39 ; s hardware configuration . outputs from block 226 include a signal state including sensor - off indication . in the architecture 200 described above , the function of block 226 , pulse lost and pulse search indications , may be derived using information from several parts of the signal processing architecture . in addition , the signal processing architecture will not use the received ir and red waveforms to compute oxygen saturation or pulse rate if a valid sensor is not connected , or if the sensor - off or loss of pulse amplitude are detected by the signal processing architecture . the brief description of an embodiment of a pulse oximeter signal processing architecture in accordance with the present invention , set forth above , serves as a basis for describing the methods and devices that are directed towards the selection of ensemble averaging weights used for ensemble averaging of signals that correspond with detected waveforms from a pulse oximeter , as is generally indicated by blocks 210 and 218 above . as set forth above , the selection of ensemble averaging weights are based on one or more or a combination of various signal quality metrics or indicators . in particular , in one embodiment , the metrics that are used to adjust ensemble - averaging weight , includes a measure of the degree of arrhythmia . this metric is used to reduce the degree of ensemble - averaging when the patient appears to be arrhythmic , as ensemble - averaging works less well for signals having highly variable frequency content . another metric used to adjust ensemble - averaging weight includes a measure of the degree of variability of ratio - of - ratios ( e . g ., lack of similarity or correlation between ir and red waveforms ). this metric is sensitive to the presence of motion or other noise sources . this metric is different from that of other known techniques such as conlon &# 39 ; s , in that conlon teaches a metric that compares the similarity between current and previous - pulse waveforms , presumably from the same wavelength , but not the similarity between two simultaneous waveforms at different wavelengths . another metric used to adjust ensemble - averaging weight includes a ratio of a current pulse amplitude to the long - term average pulse amplitude . a long - term average pulse amplitude refers to an average that has a response time of perhaps a minute when all pulses are qualified , and several times longer if most pulses are being disqualified . this metric is designed to capture the degree of motion artifact , similar to conlon &# 39 ; s , however , this metric is an analog metric , whereas conlon &# 39 ; s metric has just a few discrete states ( e . g ., no artifact , low artifact , high artifact ). another metric used to adjust ensemble - averaging weight includes a ratio of a current pulse amplitude to the previous pulse amplitude . this metric is used to quickly change the ensemble - averaging weight when large motion artifact start or stop . another metric used to adjust ensemble - averaging weight includes a measure of the overall signal quality metric for a single pulse , which metric is itself a combination of several other metrics , including the metrics described above . this metric is used to quickly reduce the ensemble filtering when motion artifact subsides and the input waveform is presumed to be of better quality than a heavily ensemble - averaged waveform . another metric used to adjust ensemble - averaging weight includes a ratio of a current pulse period to the average pulse period . this metric is used to reduce the ensemble filtering in the event that the heart skips a beat , which can happen occasionally on many people . when the subsystem ( 210 and / or 218 ) is notified that the pulse identification and qualification subsystem ( 204 ) 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 . 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 time interval ( e . g ., 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 less 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 . in one aspect , the ensemble averaging weights that have been determined as described above , are used for 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 . a pulse oximeter with separate ensemble averaging for oxygen saturation and heart rate is described in patent application ser . no . 11 / 412 , 483 assigned to the assignee herein , and titled : pulse oxiemter with separate ensemble averaging for oxygen saturation and heart rate , is hereby incorporated herein by reference , in its entirety for all purposes . in that patent application , 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 . for example , a lower threshold is used for a metric to detect arrhythmic pulses when used to calculate pulse rate , as compared to calculating oxygen saturation . also , a metric for a short term pulse amplitude ratio will be small when motion artifact has just subsided , and this is given more weight in the pulse rate calculation than in the oxygen saturation calculation . 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 . 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 . for example , 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 — uantifies 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_filter_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 . mean_ir_frequency_content — estimate of mean frequency content of the ir input waveform . used to compute frequency_ratio metric . accordingly , as will be understood by those of skill in the art , the present invention which is related to the selection of ensemble averaging weights , may be embodied in other specific forms without departing from the essential characteristics thereof . for example , while the present embodiments have been described in the time - domain , frequency - based methods are equally relevant to the embodiments of the present invention . accordingly , the foregoing disclosure is intended to be illustrative , but not limiting , of the scope of the invention , which is set forth in the following claims .
a method and a system for ensemble averaging signals in a pulse oximeter , including receiving first and second electromagnetic radiation signals from a blood perfused tissue portion corresponding to two different wavelengths of light , obtaining an assessment of the signal quality of the electromagnetic signals , selecting weights for an ensemble averager using the assessment of signal quality , and ensemble averaging the electromagnetic signals using the ensemble averager .