Extraction of respiratory signals from the electrocardiogram and photoplethysmogram: technical and physiological determinants

Objective: Breathing rate (BR) can be estimated by extracting respiratory signals from the electrocardiogram (ECG) or photoplethysmogram (PPG). The extracted respiratory signals may be influenced by several technical and physiological factors. In this study, our aim was to determine how technical and physiological factors influence the quality of respiratory signals. Approach: Using a variety of techniques 15 respiratory signals were extracted from the ECG, and 11 from PPG signals collected from 57 healthy subjects. The quality of each respiratory signal was assessed by calculating its correlation with a reference oral-nasal pressure respiratory signal using Pearson’s correlation coefficient. Main results: Relevant results informing device design and clinical application were obtained. The results informing device design were: (i) seven out of 11 respiratory signals were of higher quality when extracted from finger PPG compared to ear PPG; (ii) laboratory equipment did not provide higher quality of respiratory signals than a clinical monitor; (iii) the ECG provided higher quality respiratory signals than the PPG; (iv) during downsampling of the ECG and PPG significant reductions in quality were first observed at sampling frequencies of  <250 Hz and  <16 Hz respectively. The results informing clinical application were: (i) frequency modulation-based respiratory signals were generally of lower quality in elderly subjects compared to young subjects; (ii) the qualities of 23 out of 26 respiratory signals were reduced at elevated BRs; (iii) there were no differences associated with gender. Significance: Recommendations based on the results are provided regarding device designs for BR estimation, and clinical applications. The dataset and code used in this study are publicly available.

downsampling of the ECG and PPG significant reductions in quality were first observed at sampling frequencies of <250 Hz and <16 Hz respectively. The results informing clinical application were: (i) frequency modulationbased respiratory signals were generally of lower quality in elderly subjects compared to young subjects; (ii) the qualities of 23 out of 26 respiratory signals were reduced at elevated BRs; (iii) there were no differences associated with gender.
Significance: Recommendations based on the results are provided regarding device designs for BR estimation, and clinical applications. The dataset and code used in this study are publicly available.
Keywords: respiratory modulation, biomedical signal processing, electrocardiography, photoplethysmography, respiration (Some figures may appear in colour only in the online journal)

Introduction
Breathing rate (BR) is widely used for diagnosis and prognosis. On general hospital wards BR is usually measured by manually counting chest wall movements. This practice is timeconsuming, inaccurate, and poorly carried out (Lovett et al 2005, Cretikos et al 2008. An alternative approach may be to estimate BR from electrocardiogram (ECG) or photoplethysmogram (PPG) signals, which are already routinely measured in a wide range of clinical contexts. A recent study in a young, healthy population showed that BR can be estimated from the ECG and PPG signals with a similar precision to Impedance Pneumography, the current clinical standard for electronic BR measurement (Charlton et al 2016a). These results were obtained from young, healthy volunteers at rest using high fidelity signal acquisition equipment, so it is not yet clear whether they can be generalised to clinical settings.
A fundamental step in estimation of BR from the ECG and PPG is the extraction of a respiratory signal: a signal dominated by respiration. Respiratory signals can be extracted from the ECG and PPG using either feature-or filter-based techniques, as illustrated in figure 1. The processes for extraction of respiratory signals are demonstrated in figure 2. In this figure extraction of respiratory signals is illustrated for each of the three idealised types of respiratory modulation of the ECG and PPG: baseline wander (BW), amplitude modulation (AM), and frequency modulation (FM) (Charlton et al 2016a). If the amplitude of the respiratory signal is too small compared to the underlying noise, then the signal may not be distinguishable from the noise, preventing the precise estimation of BR. Thus, any factors which reduce the amplitude of respiratory modulations may result in reduced respiratory signal quality, affecting the estimation of BR from these signals.
The aim of the study presented in this paper was to determine how the quality of respiratory signals is affected by technical and physiological factors which may be encountered in the clinical setting. Technical factors are those which are fixed during device design, such as the choice of either ECG or PPG as the signal from which respiratory signals are extracted. It is important to understand the influence of technical factors to optimise device design. In contrast, physiological factors cannot be controlled for. The influences of physiological factors, such as age, can inform decisions on whether or not particular BR algorithms are appropriate for use in particular clinical scenarios. Quality was measured using the correlation between an extracted respiratory signal and a reference respiratory signal (see figure 1).
The paper is structured as follows. Firstly, a review is presented of previous investigations into the influence of technical and physiological factors on respiratory signals of the ECG and PPG, and the subsequent performance of BR algorithms. Secondly, the methods are described for data collection, assessment of the quality of respiratory signals, and statistical analysis. Thirdly, the results are presented for each technical and physiological factor in turn. Finally, the impacts of these factors on device designs and on the use of BR algorithms in particular clinical scenarios are discussed. The dataset, respiratory signal extraction algorithms, and analysis code used in this study are publicly available at: http://peterhcharlton.github.io/RRest.

Review of previous work
The previous work relating to each of the factors assessed in this study is now reviewed.

Technical factors
PPG probes can be positioned at a range of anatomical sites, including the finger, ear, forearm, shoulder and forehead (Nilsson et al 2007). Of these, only finger and ear measurements are widely used in clinical practice. The quality of respiratory signals extracted from the PPG may differ at different sites because of the augmentation of the systolic portion due to arterial pressure wave reflections (Elgendi 2012), and the visco-elasticity of the arterial system (Alastruey et al 2011). Indeed, previous investigations have shown that the amplitude of BW is greater when the probe is positioned at the ear than the finger (Shelley et al 2006, Nilsson et al 2007. However, further investigation is required to verify this finding and determine the effect of measurement site on AM and FM signals. This may impact device designers' considerations of the site of PPG measurement for BR estimation. The equipment used to acquire ECG and PPG signals may influence the quality of respiratory signals. This is of particular concern with the PPG, since clinical monitors commonly Figure 1. Extraction of respiratory signals using exemplary feature-and filter-based techniques. Respiratory signals have been extracted from the PPG using a feature-based technique in which pulse peak amplitudes are extracted, and a filter-based technique using the amplitude of the continuous wavelet transform. In this study the quality of extracted respiratory signals was assessed by calculating the correlation between each extracted respiratory signal and the reference respiratory signal. Adapted from Pimentel et al (2015). output a filtered version which has been optimised for display, which may differ from the measured signal (Feldman 2010). The processing procedures include auto-gain, auto-centre, and amplitude gain functions (Shelley 2007). These adaptive filters may function over a short time scale, comparable to that of breathing, therefore potentially affecting extracted respiratory signals. Indeed, a recent study reported that the AM signals extracted from PPG signals acquired from two clinical monitors were not interchangeable (Høiseth et al 2015). Since monitors' filtering characteristics are not usually published (Feldman 2010), it is not clear how extracted respiratory signals are affected by this process. If high-fidelity laboratory equipment results in higher quality respiratory signals than a clinical monitor, then device designers may need to consider modifying the hardware in devices in order to extract high quality respiratory signals prior to filtering.
The type of input signal, ECG or PPG, may impact the quality of respiratory signals since different physiological mechanisms cause the respiratory modulations in the ECG and PPG. Therefore, the strengths of individual modulations may differ between the two signals, impacting extracted respiratory signals. The physiological mechanisms have been reported previously in Bailón et al (2006a) and Meredith et al (2012), and are summarised in table 1 (although they are not fully understood). FM-based BR algorithms have previously been found to perform better when using the PPG rather than the ECG (Constant et al 1999, Dash et al 2010, Karlen et al 2011. In contrast, in our previous study of the performance of BR algorithms in young healthy subjects, we observed that algorithms tended to perform better when the ECG was used as an input signal (Charlton et al 2016a). Further research is required to determine whether one signal is superior to the other for measurement of respiratory signals.
The sampling frequency of the input signal may affect the quality of respiratory signals. This is most important for the ECG signal since many of the feature-based respiratory signals are calculated from measurements of the QRS-spike, which contains high frequency content. It is intuitively appealing to use high sampling rates to ensure that respiratory modulations are captured as precisely as possible. Indeed, several studies have used high-fidelity equipment sampling the ECG and PPG at up to 1 kHz (Bailón et al 2006b, Selvaraj et al 2009. However, it is desirable to be able to use low fidelity equipment since it will make ECG-and PPG-based BR estimation more widely accessible, particularly in resource-constrained settings. For instance, smart phones with PPG sampling rates as low as 30 Hz (Nam et al 2014) are widely accessible. Previous studies have assessed the effect of sampling frequency on ECG analyses, including the measurement of heart rate and QT interval variability (Merri et al 1990, Baumert et al 2016. These recommended avoiding the use of lower ECG sampling frequencies such as ⩽200 Hz. Any reduction in respiratory signal quality due to lower sampling frequencies must be appreciated to allow appropriate equipment to be selected for each clinical setting.

Physiological factors
Age may affect the quality of respiratory signals since some of the physiological mechanisms which cause respiratory modulations of the ECG and PPG diminish with age. In particular, respiratory sinus arrhythmia (RSA, which causes FM) and chest wall expansion (which is linked to BW and Table 1. Physiological mechanisms causing respiratory modulation of the electrocardiogram (ECG) and photoplethysmogram (PPG). For a comprehensive treatment see Bailón et al (2006a) and Meredith et al (2012).

BW
Beat morphology is influenced during respiration by two mechanisms: (i) changes in thoracic impedance, and (ii) changes in the orientation of the electrical axis of the heart relative to ECG electrodes (Bailón et al 2006a).
Changes in tissue blood volume caused by: (i) transmitted changes in intrathoracic pressure; and (ii) vasoconstriction of arteries during inhalation, transferring blood to more central veins (Nitzan et al 2006) AM Stroke volume is reduced during inhalation due to changes in intrathoracic pressure, affecting pulse amplitude (Meredith et al 2012) FM FM is due to respiratory sinus arrhythmia (RSA) which causes heart rate to increase during inspiration and decrease during exhalation. It is caused by at least three mechanisms: (i) changes in intrathoracic pressure during inhalation stretch the sino-atrial node, increasing heart rate (HR); (ii) increased vagal outflow during exhalation reduces HR; and (iii) reduced intrathoracic pressure during inhalation decreases left ventricular stroke volume, causing a baroreflex-mediated increase in HR (Larsen et al 2010) AM) both diminish with age (Moll and Wright 1972, O'Brien et al 1986, Pikkujamsa et al 1999, Charlton et al 2016a. Indeed, FM-based ECG algorithms of BR have been found to perform worse in older subjects (Cysarz et al 2008, Schäfer and Kratky 2008, Sobron et al 2010, Orphanidou et al 2013. However, a previous investigation into the effect of age on BW-based PPG algorithms of BR did not find a difference in performance with age (Nilsson et al 2000). Further investigation is required to determine the extent to which each respiratory modulation is affected by age. This is particularly important given that populations worldwide are ageing rapidly (Bloom et al 2015). It has also been suggested that gender may influence the quality of respiratory signals. The amplitude of FM in the PPG has been observed to be greater in women than men (Li et al 2010). In contrast, the amplitude of BW in the PPG does not appear to be influenced by gender (Nilsson et al 2000). If the qualities of respiratory signals differ between women and men then potentially different respiratory signals could be extracted for each gender.
It has also been reported that the amplitudes of respiratory modulations are affected by a subject's BR. This would be particularly significant if it results in a reduction in the performance of BR algorithms at abnormally low or high BRs, since it is important to be able to detect these extreme values to ensure patient safety (Seymour et al 2016). Respiratory sinus arrhythmia (RSA), the mechanism which causes FM, is reduced above a certain corner respiratory frequency (Hirsch and Bishop 1981). Furthermore, it has been observed that AM of the PPG is reduced at increasing BRs (Lázaro et al 2014b). It has been suggested that the reduced amplitude of respiratory modulations at elevated BRs causes a reduction in the performance of BR algorithms (Caggiano and Reisman 1996, Johansson and Strömberg 1999, Johnston and Mendelson 2004, Selvaraj et al 2009, Nam et al 2014. Another study found that FM-based ECG algorithms performed worse at higher BRs, whereas AM-based algorithms performed better at higher BRs (Nemati et al 2010). It has been proposed that there is a range of BRs within which BR algorithms perform best, and that performance is reduced for BRs outside of this range. However, the exact range is unclear, having being reported as 8-11 breaths per minute (Johnston and Mendelson 2004), and 16-20 breaths per minute (Orphanidou et al 2013).

Methods
The methods used for both data collection and signal processing have, in part, already been described in Charlton et al (2016a). Those relevant to this study are presented here.

Technical and physiological factors
The technical and physiological factors investigated in this study are listed in table 2. The investigations were carried out as follows. Firstly, the respective qualities of respiratory signals extracted from finger and ear PPG signals were compared. The measurement site associated with lower quality respiratory signals was eliminated from further analyses. Secondly, respiratory signals extracted from laboratory and clinical signal acquisition equipment were compared. Similarly, the signal acquisition equipment associated with lower quality respiratory signals was eliminated from further analyses. Finally, the influences of the remaining technical factors, and the physiological factors, on respiratory signal quality were assessed.

Participants
Two groups of healthy adults participated as part of the VORTAL study (National Clinical Trial 01472133): young subjects aged between 18 and 40 years, and elderly subjects aged over 70 years. Ethical approval was obtained from the London Westminster Research Ethics Committee (11/LO/1667). Subjects who had co-morbidities or were receiving medications that might significantly affect the functioning of the cardiac, respiratory and autonomic nervous systems were excluded.

Signal acquisition
High fidelity laboratory (lab) equipment was used to acquire lead II ECG, finger PPG, ear PPG, and oral-nasal pressure signals. The lab equipment consisted of a 1902 amplifier, a Power 1401 analogue-to-digital converter and Spike2 v.7.09 acquisition software (all Cambridge Electronic Design, Cambridge, UK). Finger and ear PPGs were transduced using MLT1020FC and MLT1060EC infrared reflection plethysmographs respectively (AD Instruments, CO Springs, USA). Oral-nasal pressure was transduced using an Ultima Dual Airflow differential pressure transducer (Braebon Medical Corporation, Kantata, ON, Canada) connected to a P1300 Pro-Flow oral-nasal cannula (Philips Respironics, Murrysville, PA, USA). Signals were sampled at 500 Hz.
In addition, clinical equipment was used to simultaneously acquire Lead II ECG and finger PPG signals. The signals were monitored using an IntelliVue MP30 clinical monitor (Philips Medical Systems, Boeblingen, Germany) and captured using ixTrend acquisition software (v.2.0.0 Express, Ixellence GmbH, Wildau, Germany) at 500 Hz and 125 Hz, respectively.
A 10 min recording was acquired from each subject whilst laid supine, consisting of all signals acquired simultaneously.
ECG and PPG signals were downsampled incrementally from the original sampling frequencies to 50 Hz for the ECG and 8 Hz for the PPG. They were then interpolated at the original sampling frequency using cubic-spline interpolation to assess the impact of sampling frequency.

Quality assessment
ECG, PPG and oral-nasal pressure signals were segmented into adjacent windows of 32 s duration. The quality of each signal during each window was assessed using the methods described below. Any windows in which any of the required signals were of low quality were excluded from analyses.
ECG and PPG signal quality was assessed using the algorithm described in Orphanidou et al (2015). This algorithm assesses signal quality in two stages. Firstly, the timings of heart beats are identified in each signal to check for implausibly extreme beat-to-beat intervals or average heart rates. Windows with implausible values are deemed to be low quality. Secondly, a template beat is constructed, and the correlation between each individual beat and the template is calculated. If the average correlation coefficient for the window is below an empirically determined threshold (0.66 for the ECG and 0.86 for the PPG) then the window is deemed to be of low quality.
The quality of the oral-nasal pressure signal was assessed by calculating its signal-tonoise ratio using a modified periodogram. Any windows with a low signal-to-noise ratio were deemed to be of low quality, with the threshold for exclusion set to eliminate windows in which breaths could not be identified visually.

Extraction of respiratory signals
Several techniques have been proposed for extraction of respiratory signals from the ECG and PPG. In this study the techniques listed in table 3, and reported previously in Charlton et al (2016a), were used to extract a wide range of respiratory signals.
Filter-based techniques, X A1 to X A3 , were implemented as described in table 3, followed by elimination of frequency content outside of the range of plausible respiratory frequencies by band-pass filtering.
Feature-based extraction was conducted as follows. Very high frequencies were eliminated using low-pass filters with −3 dB cutoffs of 100 and 35 Hz for the ECG and PPG, respectively. An additional 50 Hz notch filter was used to eliminate mains interference in the ECG. Beat detection was performed on the ECG using a QRS detector based upon the algorithm of Pan, Hamilton and Tompkins (Pan andTompkins 1985, Hamilton andTompkins 1986), and on the PPG using the incremental-merge segmentation (IMS) algorithm (Karlen et al 2012). R-waves and pulse peaks were detected as the maxima at or between detected beats. QRS troughs were detected as the minima within the 0.10 s prior to R-waves (Ruangsuwana et al 2010), and pulse troughs as the minima between pulse peaks (Johansson 2003). One of the beat-by-beat features, X B1 to X B13 , was obtained as described in table 3. Features derived from ectopic beats were eliminated using the algorithm described in Mateo and Laguna (2003). The beat-by-beat features were generated at a variable rate (the heart rate). The time-series of these features was resampled at 5 Hz using linear interpolation since subsequent processing required a constant sampling frequency (Karlen et al 2013). Frequency content outside of the range of plausible respiratory frequencies was eliminated by band-pass filtering.
The plausible range of respiratory frequencies was determined as follows. The lower cutoff was fixed at 4 breaths per minute. The upper limit was set to 36 breaths per minute to bisect the maximum BR and minimum heart rate (HR) in the dataset (33 breaths per minute and 40 beats per minute respectively). This ensured that the extracted respiratory signals were not contaminated with cardiac frequency content.

Respiratory signal assessment
The quality of extracted respiratory signals was assessed as follows. Signals were segmented into the 32 s windows defined during quality assessment. For each window, the extracted respiratory signals and simultaneous reference respiratory signal were resampled at 5 Hz using linear interpolation, band-pass filtered between 4 and 60 breaths per minute to remove nonrespiratory frequencies, and temporally aligned to account for any phase difference between the two signals. The quality of each extracted respiratory signal was calculated as the correlation between that extracted respiratory signal and the reference oral-nasal pressure signal (see figure 1). The correlation was calculated using Pearson's linear correlation coefficient (CC) (Li et al 2010). The remainder of the methodology varied according to the particular factor being investigated as follows: • Comparisons between subjects (e.g. young versus elderly subjects) were performed using subject-specific CCs. The subject-specific CC was found for each subject and for each respiratory signal by calculating the median of the extracted respiratory signal's CCs from each of a particular subject's windows. • Comparisons between input signals (e.g. ear versus finger PPG) were performed using subject-specific differences in CCs. The subject-specific difference in CCs was found for each subject and for each respiratory signal by calculating the median difference between the CCs for the extracted respiratory signal when extracted from a first input signal, and the CCs for the extracted respiratory signal when extracted from a second input signal.

Statistical analysis
Statistical tests were performed using a significance level of α = 0.05. The Wilcoxon signed rank test was used to compare simultaneously recorded signals, such as ear and finger PPGs. The Wilcoxon rank sum test was used for results from independent groups, such as those acquired from young and elderly subjects. When testing for trends, such as across a range of reference BRs, the Mann-Kendall monotonic trend test was used, as described in Hamed

Respiratory signal Description
Filter-based, X A1 to X A4 X A1 (BW) Band-pass filter between plausible respiratory frequencies (Lindberg et al 1992 The maximum amplitude of the continuous wavelet transform (CWT) within plausible cardiac frequencies (30-220 beats per minute) (Addison and Watson 2004) X A3 (FM) The frequency corresponding to the maximum amplitude of the CWT within plausible cardiac frequencies ( (2008). Kendall's rank CC was reported for statistically significant trends as an indicator of the strength of the trend, as described in Kendall (1938). The directionality of statistically significant differences was determined by using a normal approximation to compute a z-statistic corresponding to an approximate p-value, the polarity of which indicated directionality. During the analysis of each factor, a statistical test was performed to identify any changes in the quality of each respiratory signal. Since 12 signals were tested for the ECG, and 10 for the PPG, this would usually increase the probability of a type I error (false rejection of a null hypothesis) considerably. Therefore, a Holm-Sidak correction was made to ensure that the probability of a type I error was fixed at 5% (Sidak 1967, Holm 1979. Respiratory signals extracted from the ECG and PPG were ranked by identifying the signal with the greatest median CC (control), and assessing the probability that each other signal's CCs originated from the same distribution as the control signal.

Recruitment and data characteristics
Data were acquired from 44 young subjects (aged 18-39), and 16 elderly subjects (aged over 70) meeting the trial entry criteria. Three young subjects were excluded since their recordings were incomplete. Therefore, data from a total of 57 subjects' (41 young and 16 elderly) were analysed. The demographic characteristics of the analysed subjects are provided in table 4. Data from each subject contained a median (lq − uq) of 20 (19 − 20) 32 s windows. The number of high quality windows for each signal are given in table 5. The ranges of BR and HR in the dataset were 4-33 breaths per minute and 40-100 beats per minute, respectively.

PPG measurement site
The results of the comparisons between finger and ear PPG signals are shown in table 6. Seven out of eleven respiratory signals had significantly greater CCs when extracted from finger PPG signals than ear PPG signals.

Signal acquisition equipment
The results of the comparisons between signals acquired from laboratory and clinical equipment are shown in table 7. The respiratory signals extracted from laboratory and clinical signals were mostly comparable, with the quality of a minority of signals differing significantly in favour of one set of recording equipment. Since neither set of recording equipment provided consistently higher CCs, only clinical signals were considered in the remaining comparisons to increase the clinical applicability of the conclusions.

Input signal: ECG or PPG
The subject-specific CCs of each respiratory signal extracted from the ECG and PPG are shown in figure 3. All respiratory signals were ranked more highly when extracted from the ECG than the PPG. Indeed, all of the PPG-extracted respiratory signals had significantly lower CCs than ECG(X B2 ), the ECG-extracted respiratory signal with the greatest median CC. Despite this, ECG and PPG signals were retained in the remainder of the analysis. This ensured the results were applicable to situations where device design considerations or clinical conditions enforce the use of one particular signal for practical, rather than performance-based, reasons. Figure 4 shows the CCs of respiratory signals extracted from ECG and PPG signals at different sampling frequencies. Filter-based respiratory signals (X A1 to X A3 ) were largely unaffected by sampling frequency. The CCs of all feature-based respiratory signals (X B1 to X B13 ) extracted from the ECG except one were significantly lower at reduced sampling frequencies, beginning below 250 Hz. In contrast, CCs of feature-based respiratory signals extracted from the PPG were not reduced until the sampling frequency was below 16 Hz.

Age
The results of comparisons between young and elderly subjects are shown in table 8. The CCs of PPG(X B3 ), a respiratory signal based on FM, were significantly lower in elderly subjects than young subjects. The CCs of other respiratory signals based on FM, namely PPG(X A3 ), ECG(X A3 ) and ECG(X B3 ), were also substantially lower in elderly subjects, although these differences ( = = p p 0.04, 0.09 and p = 0.01 respectively) did not reach statistical significance, partly due to the correction for multiple comparisons. For compariso n, when the equivalent analysis was performed on laboratory signals, only the CCs of PPG(X B3 ) and PPG(X B10 ), both FM-based respiratory signals, were significantly lower in elderly subjects.

Gender
A similar sub-group analysis of male and female subjects was performed. No significant differences in quality were found for any respiratory signals between male and female subjects.

Breathing rate
The results of comparisons of respiratory signals at different reference BRs are shown in figure 5. The CCs of most respiratory signals extracted from the ECG, and all extracted from the PPG decreased significantly with increasing BR. Table 7. Comparison of laboratory and clinical equipment: subject-specific differences in correlation coefficients (CCs) of respiratory signals extracted from clinical (clin) and laboratory (lab) equipment are expressed as median (lower − upper quartiles).

Respiratory signal
Subject-specific differences in CCs

Discussion
A plethora of algorithms have been proposed for estimation of BR from the ECG and PPG by extracting a respiratory signal. In this study we investigated the effects of a range of technical and physiological factors on the quality of respiratory signals. The main conclusions are listed in table 9, and are now considered in turn.

PPG measurement site
In current clinical practice the PPG is routinely measured at either the finger or ear for determining pulse rate and arterial blood oxygen saturation. Whilst cardiac modulation of the PPG remains strong across a range of anatomical sites, the respiratory modulation is affected by probe position (Nilsson et al 2007). Our finding, that many of the respiratory signals extracted from the finger PPG were of higher quality than those from the ear PPG, informs our recommendation that the finger PPG should be used in preference to the ear PPG for BR estimation. This was the case for most of the respiratory signals based on solely BW or FM: PPG(X A1 ), PPG(X B1 ), PPG(X B4 ), PPG(X B3 ) and PPG(X B10 ). However, we did not find significant differences in the qualities of respiratory signals based on AM: PPG(X A2 ) and PPG(X B2 ). This is in direct contrast to previous work, where BW was found to be stronger at the ear than the finger (Shelley et al 2006, Nilsson et al 2007. Despite using the same transducers as in Shelley et al (2006), the finger PPG tended to have a greater signal-to-noise ratio than the ear PPG in our recordings. This may explain the observed differences between our findings and previous findings, although we are unable to determine whether the cause of the lower signal-to-noise ratio at the ear was physiological or technical. Comparison of respiratory signals extracted from the ECG and PPG: correlation coefficients (CCs) for each respiratory signal extracted from the ECG and PPG. The respiratory signal with the greatest median CC, ECG(X B2 ), was used as a control against which each respiratory signal was compared in turn. Those with significantly lower CCs than this control are indicated. Note that all of the signals extracted from the PPG had significantly lower CCs than the best ECG-extracted signal. Outliers are shown by +. Figure 4. Comparison of sampling frequencies: subject-specific correlation coefficients (CCs) are shown for each respiratory signal extracted from the ECG and PPG at different sampling frequencies. Significant reductions in CCs at lower sampling frequencies are highlighted in yellow. Filter-based respiratory signals (X A1 to X A3 ) were largely unaffected by sampling frequency, whereas the CCs of many featurebased respiratory signals (X B1 to X B13 ) were significantly reduced at lower sampling frequencies. Significant reductions in CCs of ECG-extracted respiratory signals occurred at sampling frequencies below 250 Hz, whereas reductions in CCs of PPGextracted respiratory signals occurred below 16 Hz. (a) ECG. (b) PPG.

Signal acquisition equipment
In this study the qualities of respiratory signals measured using laboratory and clinical equipment were compared to determine whether there were differences which prevented the use of clinical monitoring signals for BR estimation. Counter-intuitively, more respiratory signals were of higher quality when measured using clinical equipment than when using laboratory equipment. This suggests that BR algorithms could be applied to this particular clinical monitor without a loss in performance. This is in keeping with previously reported results . However, this conclusion cannot be extrapolated to other clinical monitors which may contain different filtering procedures. Therefore, the potential effects of signal filtering performed by commercial devices warrant further investigation.

Input signal: ECG or PPG
The vast majority of respiratory signals were ranked more highly when extracted from the ECG compared to the PPG. Therefore, we recommend that where there is a choice of signals, the ECG should be preferred to the PPG. However, when taking individual measurements the PPG is often more convenient to acquire since a PPG finger probe can be more quickly attached than ECG electrodes. In contrast, our results suggest that no trade-off is required between convenience and performance when performing continuous monitoring using wearable sensors, since in this setting ECG electrodes have been found to be better tolerated than a PPG probe .

Sampling frequency
We hypothesised that the use of higher sampling frequencies would result in higher quality respiratory signals. In the ECG, this effect continued up to 250 Hz, above which there was no significant benefit to using higher sampling frequencies. This finding supports the use of BR algorithms with current clinical monitors since wearable sensors and static monitors typically sample the ECG at up to 256 Hz (Bonnici et al 2012) and 500 Hz (this study). It is in line with previous work which recommended avoiding the use of ECG sampling frequencies of ⩽200 Hz for heart rate variability analyses (Baumert et al 2016). In the PPG, significant reductions in quality were only apparent below 16 Hz. This is promising since it suggests that nonspecialist equipment, such as smart phones (Lázaro et al 2015), tablets (Nam et al 2014), and non-contact video cameras  should not be hindered by their relatively low sampling frequencies when measuring respiratory signals.

Age
We observed that one FM-based respiratory signal was of significantly lower quality in elderly subjects compared to young subjects, and others exhibited non-significant trends towards lower quality in elderly subjects. This is in keeping with previous work, and informs our recommendation that FM-based respiratory signals should be avoided when using BR algorithms Table 9. Main conclusions on the technical and physiological factors affecting respiratory signals extracted from the ECG and PPG.

Factor Conclusion
Technical factors PPG measurement site We recommend using the finger rather than the ear PPG for measuring respiratory signals Signal acquisition equipment We did not find evidence to suggest that high fidelity laboratory equipment provided superior measurement of ECG-and PPGextracted respiratory signals when compared to a clinical monitor Input signal: ECG or PPG We recommend using the ECG rather than the PPG for measuring respiratory signals where possible Sampling frequency We recommend using sampling frequencies of ⩾250 Hz for the ECG, and ⩾16 Hz for the PPG, for measuring respiratory signals Physiological factors Age We recommend avoiding the use of FM-based respiratory signals when estimating BR in elderly subjects Gender There were no differences in the qualities of respiratory signals between women and men BR We recommend caution when using BR algorithms in settings where the detection of elevated BRs is required since the qualities of most respiratory signals were reduced at higher BRs. However, further investigations are required to confirm this finding with elderly subjects. Previously, BR algorithms which fuse estimates from different respiratory signals have commonly included FM-based signals to increase precision (Karlen et al 2013, Orphanidou et al 2013. Further research is required to determine whether the performance of these fusion algorithms could be improved in elderly subjects by exchanging the FM-based input for an alternative respiratory signal. Further investigation is also required to determine whether the quality of FM-based respiratory signals is similarly reduced in diseases associated with reduced autonomic nervous system functionality.

Gender
The lack of differences between male and female subjects in this study indicates that gender is not an important factor in determining the quality of respiratory signals. This is supported by the relatively high number of subjects in each subgroup (30 female and 27 male), suggesting that the lack of differences was not simply due to a lack of statistical power. Indeed, the present sample size is greater than in a previous analysis of differences due to gender (14 female and 14 male) (Li et al 2010).

Breathing rate
In this study most respiratory signals were of lower quality at higher BRs, in keeping with previous work. This suggests that the performance of BR algorithms may be gradually reduced as the true BR increases. This would be clinically significant since an elevated BR is a key marker of clinical deterioration (Seymour et al 2016). If this translates into an unacceptable performance of BR algorithms at elevated BRs then this would severely limit their clinical utility.
A potential concern with this analysis of the effect of BR on respiratory signal quality is that the observed reduction in quality is due to inter-subject differences in quality. For instance, a latent subgroup of subjects with lower respiratory signal quality may also breathe at higher BRs by coincidence, rather than there being a causal link between elevated BR and reduced quality.

Limitations
The key limitations to this study are as follows. Firstly, this study was conducted in a laboratory setting with healthy subjects. This allowed us to isolate the influences of technical factors, age and gender, without common confounders such as the reduction in autonomic nervous system functionality associated with diabetes. Further investigation is required prior to applying the findings to clinical settings. Secondly, we used a particular set of laboratory equipment, and a particular clinical monitor. Therefore, the findings regarding signal acquisition equipment may not be universally applicable to all manufacturers' equipment. Thirdly, a known statistical property of correcting for multiple comparisons is that the probability of a type II error is increased. Consequently, some smaller differences in signal qualities may not have been identified. Finally, only single-lead ECG signals were considered in this study. Multi-lead signals may provide higher quality respiratory signals for two reasons. Firstly, different leads may provide the highest quality respiratory signals in different subjects due to thorax anisotropy and intersubject electrical axis variability (Bailón et al 2006a). Secondly, additional techniques are available for extracting respiratory signals from multi-lead signals including: extracting the electrical axis direction; and compensating for noisy beats in individual leads whilst still extracting a respiratory signal (Bailón et al 2006b).

Conclusion
In this study we assessed the impact of technical and physiological factors on the extraction of respiratory signals from the ECG and PPG. This was achieved through analysis of ECG, PPG and reference respiratory signals from young and elderly healthy subjects. The main technical recommendations for extraction of high quality respiratory signals were: (i) to measure the PPG at the finger rather than the ear; (ii) where possible, to use the ECG rather than the PPG; and, (iii) to use sampling frequencies of ⩾250 Hz for the ECG, and ⩾16 Hz for the PPG. The main clinical recommendations were: (i) to avoid the use of FM-based respiratory signals in elderly subjects; and, (ii) to expect the qualities of respiratory signals to be reduced at higher BRs. These recommendations will be helpful to equipment manufacturers to inform the design of monitoring devices, and to clinicians for determining whether BR algorithms should be used in their particular setting.
Future work should investigate whether these findings are consistent across other datasets. In addition, further work is required to determine whether additional factors encountered in clinical practice affect the qualities of extracted respiratory signals, such as ectopic beats and pathological cardiovascular and respiratory changes.
The dataset, respiratory signal extraction algorithms, and analysis code used in this study are publicly available at http://peterhcharlton.github.io/RRest. These resources allow future researchers to reproduce the analyses presented here, and to use the dataset for additional studies.