., v9¢ltlll$¢xflli§llxnys ‘Iuo‘l q !Influunaudulutn (nu-uh. ,~.nuu..‘ ”In. .,I.: haw-1:...” ‘Al.“:‘ 1.1-. AIOD 'I‘Iy'\ H: DIEM“ l Michigan State University This is to certify that the thesis entitled ANALOG DESIGN FOR A HEART AND BREATH RATE MONITOR, WITH APPLICATIONS TO THE PROCESSING OF BREATH SIGNALS presented by ANNE MILLER PHILLIPS has been accepted towards fulfillment of the requirements for M S . degree in W Ewaxugeiwlr Major professor Date M4; ’>]_ I990 0-7639 MS U is an Aflirnum'vc Action/Equal Opportunity Institution . d_ ;v ANALOG DESIGN FOR A MICROWAVE HEART AND BREATH RATE MONITOR. \VITH APPLICATIONS TO THE PROCESSING OF BREATH SIGNALS By Anne Miller Phillips A THESIS Submitted to Michigan State University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE Department of Electrical Engineering and Systems Science 1990 ABSTRACT ANALOG DESIGN FOR A MICROWAVE HEART AND BREATH RATE MONITOR. WITH APPLICATIONS TO THE PROCESSING OF BREATH SIGNALS By Anne Miller Phillips A heart rate monitor, using a microwave detection system. has been expanded to also monitor the respiratory rate. This report addresses the design of the monitor's filtering system that preprocesses both an analog heart and a breath signal (the analog board). and then investigates various algorithmic methods for processing the digitized respiratory signal. Chapter One summarizes the monitor's history. Chapter Two specifies the analog board design, including: the role of a logarithmic amplifier in increasing the monitor's dynamic range, the additional flexibility provided by switched capacitor filters (SCFs), the various amplification stages, the monitor power system and the external switch used to select either heart or breath rate processing. The monitoring device has been implemented, and has been used to collect both heart and breath signal data. Chapter Three then summarizes algorithmic methods for calculating respiratory rates, including: integration, auto-correlation, power spectrum analysis and recursive maximum likelihood (RML) estimation. DEDICATION To my husband Rod. For all your help and love. ACKNOWLEDGEMENTS I would like to thank Dr. Marvin Siegel for the chance to work on this project and for his suggestions concerning my thesis. Also, I would like to thank Greg D. Hoshal for all of his help. This thesis resulted from research that was sponsored by a grant from the Naval RMD Command, contract number NOOO-82-C-O454. iv LIST OF TABLES TABLE OF CONTENTS LIST OF FIGURES Chapter 1 Section 1.1 Section 1.2 Section 1.2-1 Section 1.2-2 Chapter 2 Section 2.1 Section 2.1-1 Section 2.1-2 Section 2.2 Section 2.2-1 Section 2.2—2 Section 2.2-3 Section 2.2-4 Section 2.3 Section 2.3-1 Section 2.3-2 Section 2.3-3 Introduction The Monitor Overview The Analog Board Signals The Input Signal The Output Signal The Analog Board Design Dynamic Range The Logarithmic Amplifier The Log Amp Design Filtering Switched Capacitor Filters The Lowpass SCF Design The Highpass SCF Design The SCF System Amplification Stages First Stage Second Stage Level Shift Stage V viii ~03me 14 15 15 18 23 24 27 29 33 35 37 42 46 Section 2.4 Section 2.4-1 Section 2.4-2 Section 2.4-3 Chapter 3 Section 3.1 Section 3.2 Section 3.3 Section 3.4 Chapter 4 Section 4.1 Section 4.2 APPENDICES APPENDIX A APPENDIX B APPENDIX C APPENDIX D APPENDIX E vi Design Results The Analog Board Design The Power System Analog Output Signals Processing the Breath Signal Integration Auto-correlation Power Spectrum Analysis Recursive Maximum Likelihood Estimation Conclusions Conclusions: Analog Design Conclusions: Respiratory Processing Logarithmic Amplifier Switched Capacitor Filters Trimming Sampling Constraints A Recursive Maximum Likelihood Program LIST OF REFERENCES 81 86 94 104 109 114 114 117 120 123 132 135 138 144 Table 1 Table 2 Table 3 Table 4 Table 5 Table 6 Table 7 Table 8 Table 9 Table Table Table Table Table Table Table Table Table 10 11 12 13 14 15 16 17 18 Table A1 LIST OF TABLES Bipolar Log Amp's Effect on Dynamic Range Log's Components Lowpass Filter Components Highpass Filter Components First Stage Components Second Stage Components Level Shift Components Analog Board Resistors Analog Board Capacitors Component Devices and Voltage Requirements Ideal Signal Characteristics Actual Signal Characteristics Integrated Signal Characteristics Auto-correlation Characteristics Power Spectrum Characteristics RML Results Expected Input Ranges Throughout the Analog Board Algorithm Breath Rate Summary Sampling Constraints vii 62 85 85 93 103 109 113 116 118 137 Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 7 Figure 8 Figure 9 Figure 1 1 Figure 12 Figure 13 Figure 14 Figure 16 Figure 19 Figure 20 Figure 21 Figure 21' Figure 22 Figure 23 Figure 24 Figure 25 Figure 26 Figure 26' LIST OF FIGURES The Monitor The First Part The Digital Board Din is Sampled Am“ Analog's Input - Am Power Spectrum of Am Generalized Power Spectrum Amt" Magnitude Beyond Range A Logarithmic Amplifier Log Amp Design Rivet Circuit Resulting Logarithmic Signal Parallel Switched Capacitor The Lowpass SCF The Highpass SCF The SCF System Analog Board's Block Diagram Linear Amp #1 The First Stage Linear Amp #2 The Second Stage Voltage Shifting Amp Level Shift Results viii Figure 27 Figure 28 Figure 29 Figure 30 Figure 31 Figure 32 Figure 33 Figure 34 Figure 35 Figure 36 Figure 37 Figure 38 Figure 39 Figure 40 Figure 41 Figure 42 Figure 43 Figure 44 Figure 45 Figure 46 Figure 47 Figure 48 Figure 49 Figure 50 Figure 51 ix The Level Shift The Analog Board Design First Part First Stage Log Amp Rivet Circuit Second Stage Lowpass SCF Highpass SCF Level Shift Digital Preparation External Switch Ribbon Cable Interface DC/DC Converter (0V, i5V, +12V) Voltage Converter (-12V) Voltage Regulator (+8.0V) Voltage Regulator (+2.5V) Pulser: Viout (Output of the First Stage) Pulser: V30“ (Output of the Analog Board) Heart Signal: V30ut (Output of the Analog Board) Absolute Value of the Heart Signal Power Spectrum of the Heart Signal Power Spectrum of I Heart I Breath Signal #1 Breath Signal #2 74 75 76 76 78 79 Figure 52 Breath Signal #3 80 Figure 53 Analog Input (#4) 82 Figure 54 Cosine + Noise (#5) 83 Figure 55 Integrated Breath Signal #1 88 Figure 56 Integrated Breath Signal #2 89 Figure 57 Integrated Breath Signal #3 90 Figure 58 Integrated Analog Input (#4) 91 Figure 59 Integrated Cosine + Noise (#5) 92 Figure 60 Sinusoids: In Phase (13:0) 95 Figure 61 Sinusoids: Out of Phase (15:16) 96 Figure 62 Auto-Correlation of Breath Signal #1 98 Figure 63 Auto-Correlation of Breath Signal #2 99 Figure 64 Auto-Correlation of Breath Signal #3 100 Figure 65 Auto-Correlation of Analog Input (#4) 101 Figure 66 Auto-Correlation of Cosine 4» Noise (#5) 102 Figure 67 Power Spectrum of Breath Signal #1 106 Figure 68 Power Spectrum of Breath Signal #2 106 Figure 69 Power Spectrum of Breath Signal #3 107 Figure 70 Power Spectrum of Analog Input (#4) 107 Figure 71 Power Spectrum of Cosine + Noise (#5) 108 Figure 72 Locations in the Analog Board 1 16 Figure A1 Logarithmic Amplifier 120 Figure A2 Second Order Butterworth Lowpass Filter 123 Figure A3 Second Order SC Butterworth Lowpass Filter 124 Figure A4 Switched Capacitor as a Resistor 1 25 Figure A5 Two-phase Clock 1 26 Figure A6 Figure A7 xi A Standard Op Amp Filter A Switched Capacitor Filter Chapter 1 Introduction Previous research has shown that human heart rates can be calculated using an instrument that utilizes low level microwaves detection [1], [2]. This system has an advantage over other tested methods of extracting human vital functions (i.e. a stethoscope or sphygmomanometer), since in microwave detection it is not necessary that the instrument come in direct contact with the body. In fact. since microwaves have the ability to penetrate various materials, such a device may be used in life-saving situations where the detection of a person's body rates was previously impossible. Some potential applications of the use of microwave detection of vital functions include: burn victims where direct contact with the skin could prove painful and or harmful, military or civilian casualties suited in chemical or radiation protective clothing, and victims of an avalanche, earthquake. or underground cave-in. This thesis deals with two major problems that arise when a heart rate monitor is modified to include the monitoring of respiratory rates. The first problem is the design of an analog board that separates and filters the heart and breath signals. (The analog board's design is detailed in Chapter Two.) The second problem is the extraction and processing of the breath signal to determine a respiratory rate. Four processing methods will be described in Chapter Three. including: auto-correlation, power spectrum analysis, 1 2 integration and recursive maximum likelihood (RML) estimation. A portable prototype device for monitoring heart rates (herein called a monitor) has been built. The general workings of the monitor described in the remainder of this chapter. The signals involved in the design of the analog board will also be discussed here. (Recommendations for future analog board design and breath signal processing will then be given in Chapter Four.) Section 1.1 The Monitor Overview The monitor, as seen in Figure 1, consists of three major sections connected in series: the first part, the analog board and the digital board. Each of these three sections performs a particular function in the device. [The specifies that follow (i.e. 10 GHz microwave and 64 Kbit EPROM) are aspects of the monitor that had been determined in a previous design, and will not be detailed in the discussion presented here.] The first part of the monitor provides the link between the human subject and the device, and is further illustrated in Figure 2. It consists of a patch antenna, a microwave transceiver and a capacitor. When a DC voltage is applied to the microwave transceiver, a 10.5 GHz wave is radiated through the patch antenna. The microwaves, if reflected by an object in their path. are returned to the transceiver's antenna. Meanwhile, the transceiver operates as a Doppler radar which utilizes the Doppler effect to determine the radial component of the relative radar-target velocity Human I First Part |——D| Analog Board HDigital Board I [ L.E.D. Rate Display | Figure 1. The Monitor Patch Antenna dc drop Doppler Microwave Transceiver I'—°" (10.5 GI'IZ) + V - Font *wl velocity (of chest) Figure 2. The First Part 'I'l‘L clock ___p .5 64 K m clock ___, fig ROM m Voltage Reference,2.5V 4——— 30 Voltage Power Supplies fi—— 3 64 K A/D Input 4— — E EPROM A/ D Input 4— — E \ Voltage Output — —> is Figure 3. The Digital Board [3]. The output from the transceiver consists of a voltage whose frequency is proportional to the velocity of the object in the beam of the antenna (i.e. a human chest cavity). A capacitor, at the transceiver's output. removes the large dc bias present in the transceiver's output signal. The signal at the capacitor is both the first part output (Font) and the analog board input (Am)- The analog board is the second portion of the monitor. This is the section where the signal is filtered. amplified and otherwise made ready for processing at the digital board. The digital board is the final section of the monitor and is shown in Figure 3. When the digital board is prepared to sample the analog output signal, it applies a voltage (which acts as a chip select) to the analog board's sample-and-hold device. The sample-and-hold output then represents a relatively stable voltage value from which the analog- 5 to-digital (A/D) converter can sample. The A/D converter requires a 2.5 V voltage reference, and its sampling rate is controlled by the digital board's software. After the signal is digitized, up to 64 Kbits of its input signal (Dm) can be stored in the random-access memory (RAM) located on the digital board. The current processing algorithm, burned into its 64 Kbits of erasable programmable read-only memory (EPROM). calculates the rate of the heart signal. This heart rate is then "outputted", in beats per minute (bpm), to a light emitting diode (LED) readout which is visible on the monitor's outer surface. (Note that the digital board will have all of its voltages supplied from the analog board. Also, the digital board design provides an additional A/ D input and two software controlled TTL clocks which are used in the analog board's design detailed in Chapter Two.) In summary, it can be said that by directing the monitor's antenna toward a human chest. the first part outputs a voltage (Font) that is related to the velocity of the chest. The analog board filters the signal (enabling accurate heart rate processing at the digital board) and the rate is displayed at the monitor's LED readout. Section 1.2 The Analog Board Signals The following notation will be used for the remainder of this chapter. The time-referenced signal at the analog board's input is Am. the time-referenced signal at the analog's output (just prior to the sample-and-hold) is Aout and the digital input signal (just past the A/ D 6 converter) is Din , as illustrated in Figure 4. The analog board's input signal (Am) is received from the front end of the monitor. Thus, this signal affects the design of the analog board considerably. Many of the time and frequency characteristics of Am have been investigated, and are detailed in Section 1.2-l. The digital board had been designed prior to the design of the analog board (in a previous instrument). The analog board design's filter scheme must then produce an output signal (Aunt) that will meet the requirements of the digital board (as Din is a digitized Acut)° The output signal (Aout') should possess the signal characteristics of Din, which are described in Section 1.2-2. Figure 4. Dm is Sampled Amt Section 1.2-l The Input Signal When the monitor's antenna is directed toward the chest of a reclining subject. the analog input signal, A“, is typical of the signal 7 shown in Figure 5 (sampling rate: 64 Hz). In Figure 5, the periodic impulses due to the subject's heart beating appear to be superimposed upon a sinusoid-like signal corresponding to breathing. The magnitude of the voltage at the analog's input ( IAmI) varies from person-to-person and with the positioning of the device with respect to a particular subject's chest. lAml has been experimentally determined to register in a range of 100 (N to 20 mV. (The constraints on this voltage were determined experimentally, and a summary of the method used follows. The distance and position of the antenna were varied with respect to the chests of several subjects. For each subject, the maximum and minimum analog input signal levels were recorded-~both with and without the subjects holding their breath. The absolute maximum and minimum voltage levels form the constraints on this range.) Such a large swing in possible voltages is equivalent to a large dynamic range [4] for the analog board (at Am), calculated in equation (1) to be 46 dB. (1) dynamic range at An = 20 logm(20*10'3 V) - 20 loglo(100‘10'6 V) -33.98 dB - (-80.0 dB) 46.02 dB The analog system should amplify the signals of smaller magnitude (so as to be detected by the monitor) without resulting in the saturation of signals of larger magnitude. So, if the analog design accounts for the dynamic range of the analog's input voltage signal, $4 :2: 3.. i 5 E .5 4 E -10-4 ‘5‘ 3 -... -50 0 I ' I ' 200 400 Sample Number (at 64 Hz) Figure 5. Analog's Input-A,n 1500 - 4 E . a 1000 - m is g I g‘ 500 4 0 1 4 . . 0.0 0.5 1.0 1.5 2.0 mequency (Hz) Figure 7. Power Spectrum of Am then the monitor will be capable of processing signals of the expected magnitude levels. Also, the analog design should filter Am so that the board's output signal (Aunt) appears as a clear heart or breath sigma]. Familiarity with the power spectrum of Am will help in the analog filter design. The power spectrum in Figure 7 is calculated from the analog data of Figure 5. (Using: 1024 data points, 0 offset points, 1 segment, 0 inserted zeros and a Hanning window. Note: Only the first 50 points are shown here; as points 512-1024 are the same (mirrored)as points 0-512 and points 50-512 are relatively equal to zero.) This power spectrum shows a high concentration of power at 0.31 Hz and a significant amount at 1.31 Hz. These power concentrations 10 correspond to the breath and heart rates of 18.6 respirations per minute (r.p.m.) and 78.6 beats per minute (b.p.m.), respectively. Normally, human heart and respiratory rates can be found to range from 60-80 b.p.m. and 16-18 r.p.m., respectively. [5] And, depending on the circumstances (i.e. perhaps the subject is sleeping, exercising or hyperventilating), these rates could register even higher or lower than normal. Therefore, for this report it will be assumed that heart rates are restricted to the range of 30-120 b.p.m. (0.5-2.0 Hz), and respiratory rates be restricted to the range of 6-120 r.p.m. (0.1-2.0 Hz). A generalized spectrum can be constructed by categorizing the movements of a reclining body into three types, caused by the following: the movement of the lungs (breathing), the movement of the heart, and the movement of anything else (called background noise). The power spectra of these individual types of movement are then summed [6], forming the general analog input power spectrum shaded in Figure 8. The power spectrum of the analog input sigial typically reveals three distinct portions--due to the separate influences of the heart, lung and background movement. The heart movement results in a spectrum portion that can be described as impulsive and with a power of lesser magnitude than that which is due to the breathing. The impulse can occur at frequencies from 0.5-2.0 Hz. The lung movement, however, result in a spectrum portion whose peak changes more gradually with frequency and has power of relatively large magiitude. (This can be expected, as the movement of a subject's lungs can often be observed while the movement of their heart can not OfA in Background Noise Power Spectrum F 0.1 0.5 1.0 1.5 2.0 2.5 3.0 reg-112311” L—Heart —l L—Breath ____J Figure 8. Generalized Power Spectrum be visually detected.) The mammum point of the pure power spectrum is expected at frequencies from 0.1-2.0 Hz. Finally, the background noise produces a spectrum that exists at low power levels, over random frequencies. (The particular heart rate of 1.25 Hz and the respiratory rate of 0.4 Hz are just one possibility. Also, the power spectrum resulting from a heart's movement quite often reveals harmonics which are not shown in Figure 8.) Section 1.2-2 The Output Signal The monitor's A/D converter results in a digital input limited to the voltage range of 0.0 V to 2.5 V (recall Figure 4). This fact requires 12 an analog board desig'i that can produce an output sigial having certain characteristics. The analog board is expected to limit the voltage swing of Aunt to 2.5 Volts. Without this limitation, the sigial would saturate at the A/ D converter and a clipped digital input sigial would result--as illustrated in Figure 9 [7]. Also, Aunt must register in the range from 0.0 V to 2.5 V. (A zero level voltage reference of 1.25 V is to be assumed for the remainder of the thesis.) / clipped <—2.5v g Din — z: I S <—— 125V 3) : C 0V Samples Figure 9. Anny-Magnitude Beyond Range In addition, the presence of the A/D converter makes quantization round-off error a concern for the analog board design [8]. For, if the design produces an Aout of very small magnitude, the A/D may not be able to distinguish changes in the signal's voltage. Therefore, for the purpose of this thesis, an acceptable minimum signal level will be set at 1.30 V (0.05 V relative to the 1.25 V zero volt 13 reference). The analog board must then produce an output signal whose dynamic range is 5.68 dB, as calculated in equation (2). (2) dynamic range of Am1t 20 logm ( 2.5 V) - 20 logm ( 1.30 V ) 7.96 dB - 2.28 dB 5.68 dB (Recall, that the dynamic range at the analog's input was calculated, in equation (1), to be 46.02 dB. This will be further investigated in a following section.) Some last general conditions for the output signal requires that Aout be either a heart or respiratory sigial which is as clean and noise-free as possible. There must also be some way for the digital board to discern the type of signal (heart or respiratory) that is present. Chapter 2 The Analog Board Design The design of the monitor's analog board will be explained in this chapter. Here, it is important to be aware of the restrictions that were placed upon the analog's output sign] in Section 1.2-2. It is also desired that CMOS (complimentary metal-oxide semiconductor) technology be used throughout the design due to its low power consumption [9]. In Section 2.1, a logarithmic amplifier will be introduced as a non-linear solution for accommodating the analog input's wide dynamic range. This filter's configuration will vary depending on whether a heart or a breath sig’ial is being processed. In the case of processing a heart signal, a rivet circuit will be implemented in the feedback loop of the log amp. A method of filtering heart and breath signals is explained in Section 2.2, where switched capacitor filters are added to the analog desigi. Then, Section 2.3 looks at the various stages of linear amplification needed to match and adjust the voltage levels throughout the analog board. Lastly, Section 2.4 will specify the analog board's schematic desigi, discuss the power system for the monitor and comment on the appearance of the heart and breath sigials at the analog board output. 14 Section 2.1 Dynamic Range Equation (1) (in Chapter One) calculated the dynamic range of the analog board's input to be 46.02 dB, while equation (2) calculated that the dynamic range of the analog board's output should not exceed 5.68 dB (to avoid saturation). The analog board design must then be responsible for a dynamic range reduction of at least 40.34 dB (46.02 dB -5.68 dB). A logarithmic amplifier (log amp) is a non-linear device capable of solving the dynamic range problem. The usefulness of this device will be explained in Section 2.1-l, while Section 2.1-2 will specify the log amp portion of the analog's desigi. Section 2.1-1 The Logarithmic Amplifier The analog design includes a log amp, which allows a reduction in the dynamic range at the analog board's output (A0“) compared to that at its input (Am)- A log amp is basically an operational amplifier with a log element in its feedback loop, such as the device shown in Figure 11 [10]. This log amp relates its output voltage (Vent) to its input voltage Wm) by the relationship shown in equation (3). [See Appendix A, equation (A6).] 15 Figure 1 l. A Logarithmic Amplifier V (3) Vout = K[ ln(Io) - 14%)] (If, Vout « -K and an ideal op amp is used. Here, 10 is the diode‘s reverse saturation current and K is a constant dependent on the p-n junction of the diode.) A positive voltage is required for Vm, as a result of the function ln(x) being invalid for the negative values of x [l 1]. Yet, a bipolar voltage is anticipated at the log amp's input (it is expected at the analog's input). Therefore, a bipolar logarithmic amplifier (the 2910 - Optical Electronics, Inc.) will be implemented in the analog design. The result of the bipolar log amp is similar to the combination of equation (4) and equation (5) (where an ideal op amp is assumed). 1 7 Using, LOG!“ = the input of the bipolar log amp and LOG”,1t = the output of the bipolar log amp. (4) Loo,mt - Kl: mun) - m(fl§9l)] , for Looin « -K. (5) Looout = K[ ln(Io) - ln(l—ID—Si-q-I-fl, for 1.00.m » K. The bipolar log amp (2910 - O.E.I.) requires an input voltage whose magiitude is in a range between 3 mV and 3 V. This requirement is accommodated by a stage of gain (detailed in Section 2.3-1) producing a log amp input signal ranging between 5 mV and 1 V. (When the signal is out of this range it is due to either a physical error, or noise which will later be filtered by the analog board.) Table l. Bipolar Log Amp's Effect on Dynamic Range Sigial @ Log In Signal @ Log Out 1 V 0 dB 4—~ -0.364 V - 8.78 dB 4—- 5 mV ~46.02 dB 4- ~ -0.192 V -14.33 dB <— -5 mV +0.192 V -1 V 40364 v Dynamic Range = 46.02 dB Dynamic Range = 5.55 dB Table 1 illustrates the usefulness of the log amp by applying the log amp's input voltage range to equation (3). (Where this bipolar 10g l 8 amp specifies that I0 = 1.4 " 103, K = 0.0326; R=1 K52 will also be used.) This table reveals that while the dynamic range at the log amp input is 46.02 dB (0 dB - (-46.02 dB)), the dynamic range at its output is only 5.55 dB (-8.78 dB - (-14.33 dB)). This value (5.55 dB) is less than the maximum dynamic range that will be allowed at the digital board's input (which is 5.68 dB). Thus, the log amp has become a solution in meeting the monitor's dynamic range requirement. Section 2.1-2 The Log Amp Design The design for the bipolar logarithmic amplifier is shown in Figure 12. This bipolar log amp requires a variable resistor (R6) for making its offset adjustments, which are typical when using op amps. However, a rivet circuit will be switched into the log amp's feedback loop when the accurate offset adjustments are needed for processing heart sigials (the switch makes a connection between 1A and 2A). The rivet's design is shown in Figure 13 and implements a monolithic JFET operational amplifier (LF356H, National Semiconductor) as indicated in the log amp's specification sheets. Here, a capacitor (C14) shorts any AC voltage to g'ound. The input to the op amp is then free to follow the average DC offset of the rivet's input, while R7 holds the op amp's inverting input at virtual ground. The rivet's overall effect is to have the log amp's input follow along a slow moving frequency (the DC drift). The specific component values used in the desigi of Figure 12 l9 and Figure 13 are listed in Table 2. The capacitors: C6, C7, C10, C1 1, C12 and C13, are present in the design in order to store charge and thus control DC drift at the devices (12]. The capacitors: C1 1 and C13, are electrolytic Capacitors which polarize the power supply's voltage drift at this circuit [13]. The remaining capacitors and resistors in the rivet circuit (C5, C14, R7 and R8) and the variable resistor (R6) have values as suggested in the log amp's specification sheets. The log amp's output is the result of the natural logarithm of the heart and breath signal and low voltage noise. And, as the logarithm of a low voltage noise translates into a relatively large magnitude, the result of the device is an output signal which is embedded in high frequency noise. (The filtering done in the later portions of the desig'i will remedy this.) Figure 14 illustrates the log amp's effect on a signal; since it is the natural logarithm calculated from the voltage magiitude of the data of Figure 5. (The sign of the original data of Figure 5 was kept.) Note that this figure has a relative voltage scale that is only proportional to the voltage magnitude actually occuring at the monitor. Notice also, that a pattern of heart and respiratory cycles are revealed here, just as in Figures 5. The difference is that, unlike the original input data, the logarithmic signal will now be limited to the voltage range of 3 mV to 3 V. 20 L Rivet 3A __‘ Riv CIICUIt Riv \__g h 9—— m 2“ Figure 13 ._12_ 10K to Loci.n Out 1 L0 14 1K to LOG Log Loc‘fi in Element 4 g": a! Log Amp U3 V+, 9) 1 - - 7 R6 < < +12V C10 C12 C1 1 C 13 -12V Figure 12. Log Amp Design 21 O 0 Figure 13. Rivet Circuit Table 2. Log's Components I Cam Malue g Resistor Kale: (:5 0.1 ur R6 1 kn cs 0.1 uF R7 1 Mo (:7 0.1 pF R8 1 M52 014 0.1 11F C10 0.1 11F 011 15 uF C12 0.1 IJF 013 15 11F 22 4.0 - 'i H 2.0 - I *5 a. .5 ‘3» a 0.0 - “a 5 1 -2.0 - -4-0 . u - I - I . u 0 200 400 600 800 Sample Number (@ 64 Hz) Figure 14. Resulting Logarithmic Signal Section 2.2 Filtering Previously, the design for the heart monitor included several cascaded standard op amp lowpass and highpass filters. This design was adequate for many situations, but was inflexible for the following reasons: it filtered only heart signals, its filters were difficult to tune. and once designed the monitor's cutoff frequencies became fixed. The current monitor design uses switched capacitor filters (SCFs) to overcome the inflexibilities of the old monitor. Heart and respiratory signals are both processed through the filter system. The position change of an external switch enables either heart or breath processing by routing the signal through different filters, and produces a voltage signal at the digital board informing the software which algorithm (heart or breath) it should run. The filtering method for each type of signal will vary. The heart signal is processed by cascading a lowpass and a highpass filter: this enables the final output signal to have reduced disturbances caused by the presence of low frequency respiratory disturbances and both high and low frequency noise. The respiratory signal is processed by using only the lowpass filter. The low cutoff frequencies required (less than 0.1 Hz) would be too low for accurate and stable operation of the highpass filter. Adjusting the new SCF design is simplified compared to the tuning of the RC op amp filters. When a filter's cutoff frequency is decided upon, an RC filter design requires tedious calculations to determine specific values for R and C [14]: these values are then often 23 24 only approximated. The cutoff frequency of a SCF is attained by the frequency supplied by a 'ITL clock, which is proportional to the cutoff frequency. Therefore, filter cutoff frequencies are easily altered with the use of SCFs in the monitor's design. When a change in cutoff frequency is desired, one need only alter the clock frequency in the software (the 'ITL clock is supplied by the processor at the digital board) and burn the new program into an EPROM. This is simple compared to the past alternative where new RC values needed to be calculated, and the old components were unsoldered and replaced with the new-valued components. Section 2.2-1 discusses the general operation of switched capacitor filters and their usefulness in the monitor's design. The details of the specific lowpass and highpass switched capacitor filter designs will then be shown in Section 2.2-2 and Section 2.2-3. respectively. Then, Section 2.2-4 discusses the SCF system resulting from cascading these lowpass and highpass SCFs. Section 2.2-1 Switched Capacitor Filters The parallel configuration for a switched capacitor (seen in Figure 16) can be equivalent to a resistor when it is alone in the circuit [15]. This is proven in Appendix B which also specifies [in equation (A23)] the relationship between the value of capacitance (C), the frequency of the clock that controls the two switches (fc) and the equivalent resistance (R). This relationship is repeated here as 25 equation (6). 1 (6) R=fc—C- Therefore, the resistance of an SC (and thus the cutoff frequency of an SCF) varies according to the frequency of the controlling clock. (See Appendix B for more detail.) 52 >2 + + V1 (3 V2 Figure 16. Parallel Switched Capacitor The current monitor design uses both lowpass and highpass Butterwortln switched capacitor filters (SCFs) [16]--which are detailed in the following two sections. The cutoff frequency (FCutoff) of each SCF is related to a switch controlling clock frequency (FClock) by the relationship revealed in equation (7). Fem (7) Fouto£r= 100 26 As seen from equation (7), the calculations for determining switched capacitor filter cutoff frequencies are quite simple. If a cutoff of 1 Hz is needed, the corresponding clock frequency must be 100 times this, or 100 Hz. [Any lack of precision in the clock's frequency is reduced by one-hundreth in the filter's cutoff frequency; if a 1 Hz cutoff frequency is desired, and there is a 0.1 Hz error in the clock's frequency (say, F010“ = 99.9 Hz), then there would only be a 0.001 H2 error in cutoff frequency (Fcutofl = 0.999 Hz).] 'lhe two clocking signals are to be supplied by the digital board's two Tl‘L, software controlled clocks (see Section 1.1). The TTL clocks that control the lowpass and highpass filters will be called Clock A and Clock B, respectively. [This is just one possible scheme for the clocking signals (i.e. the lowpass also accepts CMOS clocking and a Schmitt trigger oscillator: the highpass accepts CMOS clocking). The TI‘L clocks, however, are conveniently available from the digital board: so, equation (7) can be applied to each SCF and the RC calculations involved in Schmitt triggers are eliminated.) The use of SCFs in the design creates a discontinuity at the frequency of each clock signal. This is a response to the change in current flow that occurs as the various switches open and close. The faster the clock, the less noticeable the change in the SCF's discontinuity; as the capacitor's charge has little time in which to vary. The discontinuities are most noticeable when filtering a respiratory signal. But, the frequencies of the clock are so much greater than the signal frequency and the change in voltage from sample-to-sample is so minor (relative to the magiitude of the heart .27 or breath signal), that the clock's frequency will either be ignored by the digital board's software or be filtered away by the level shift's lowpass filtering (see Section 2.3-3). Section 2.2-2 The Lowpass SCF Design The configuration of the lowpass SCF uses an MF6CN-100 (National Semiconductor) integrated chip and is shown in Figure 19. The MF6 is a sixth order switched capacitor Butterworth lowpass filter, with two independent op amps. The details stated in this section are those stated in the manufacturer's specification sheets. The design voltages are i5 V (as :15 V is a common requirement for the digital board, and is a supply voltage option available to the MF6). Of the digital board's two 'ITL clocks, Clock A will control the cutoff frequency of this filter. This requires that the level shift pin (L Sh) be tied to ground and that the clock's input be the CLK R pin. The variable resistor, R14, is used to adjust the filter's DC offset voltage (see Appendix C-Tuning). And the two capacitors, C8 and C9. are present to provide filtering at the voltage supply inputs. The values for these components are shown in Table 3 and are those recommended in the specification sheets for the MF6. When there is a signal at the MF6 SC filter's input and the 'ITL clock is connected and operating at a frequency, Fem“ A , then the lowpass cutoff frequency (FLP ) is calculated from equation (8). FILTER OUT 3 ' LE, 8,). ILTER IN ,_ LP h CIK 9 1 1 CLKR MF6 VADJ _ l I U4 7 Clock A 6 Figure 19. The Lowpass SCF Table 3. Lowpass Filter Components m Kala: ‘ Emerita: Yams R14 50m cs 0.1m? C9 0.1 uF 29 F (8) FL? = $00" A— Recall (Section 1.2-1), that the lowpass filter will be primarily used to filter away low magnitude noise--when processing a heart signal, and noise and heart signals--when processing a respiratory signal. The sixth order filter operates at120 dB/ decade [17], which is acceptable for distinguishing heart and respiratory signals (as revealed in the plots of Section 2.4-3). Section 2.2-3 The Highpass SCF Design The MFIOCN (National Semiconductor) is an integrated circuit chip which contains two secondorder universal monolithic dual switched capacitor filters. The MF10 is capable of functioning as either an allpass, lowpass, bandpass, or notch filter--of up to fourth order when the dual filters are cascaded. 'Ihe bandpass filter option only permits filtering that is symmetric around a center frequency. Any use for a bandpass filter will be simulated by cascading the lowpass (MF6CN-100) and the highpass (NIFIO) switched capacitor filters. (Many of the details concerning the MF10 and used in this section come directly from the specification sheets for this chip.) Figure 20 shows the configuration for an MF10 fourth order highpass filter (mode 3 from the MF10's specification sheets). Unlike the MF6, the cutoff frequency for the highpass SCF is dependent on mom 38:3: 06. .8 «Ema 30 >m+ >m- Bo 20 a. _ amt m u ,9 ,3 2 .0 +9. +<> 62% AS -<> m mxooa ...ol@ .5 .50 2 £3 _ E. em 08 2 «mm .mD \ 2 $3122 am . o2: _ S .3: .6 , 2 2 one A 438:8 m 45.22 emu 92m m s N a [I _ mm 2m _ «a 3 .3 >7: mm 2m - Sm 31 both the controlling clock's frequency and the designed resistor ratios. To be consistent with the MF6 design, the MFIO will use a TI‘L clock signal (Clock B) and will be configured using the divide-by-IOO option. Each of the former features are options available in MFIO implementation and are obtained through the following details: the L Sh pin is tied to analog g'ound (0V) and the 50/ 100/ CL pin is tied to midsupply (0V is also the midsupply for voltage range i5V). Equation (9) and equation (10) show the relationships between the ClOCk'S frequency (FClock B) and the cutoff frequencies of the two second order highpass filters contained in the MFIO (whose frequencies are Fm,1 and Far-2' respectively). FClockB . (9) Fan = 100 R18 FClockB (1 0) Fm = _100 V—R22.5 Table 4 lists the actual component values used for the design shown in Figure 20; this table shows that all four resistors possess the same resistance (10 KO). The simplified relationship for the resulting 4th order filter (due to cascading the two 2nd order filters) is shown in equation (1 I). F (11) Fm,=%£ Where FHP is the cutoff frequency of the cascaded highpass SCFs. 32 Table 4. Highpass Filter Components Beam yam Cam 11311.15: R17 10 K9 C18 0.1 uF R18 10 K52 019 0.1 uF R19 10 K9 R195 10 K9 R20 10 KO R21 10 K0 R22 10 K0 R225 10 m The highpass gain for the resulting fourth order filter (Gap ) is the product of the gains for each of the two second order portions (Gum and anz. respectively) [18] and can be determined from equation ( 12). Where the relationships between ani and (33,2 and the design's resistor values of Table 4 are shown in equation (13) and equation (14) (via the MFIO's specification sheets). (13) Gm,ll =(- R17 33 ..,, =<--2—a)=(-:8K“)=-1 8 Applying the previous results to equation (12) yields an overall gain for this filter of one (or 0 dB). (Recall: only the heart signal will pass through this highpass filter so that its 0 dB gain will eliminate any discrepencies that could appear between the signal gain levels of the heart and respiratory signals.) Section 2.2-4 The SCF System The switched capacitor filter system (see Figure 21) consists of the SCF highpass and lowpass filters, the controlling TI‘L clocks (Clock A and Clock B) and the external switch used in routing the analog signal through the various SCFs. Two poles in a quad-pole double throw switch are represented in this figure (see Section 2.4-1 for detail). Depending on the position of the switch the signal will enter the SC lowpass filter and a heart or respiratory filtered signal will exit the SCF system by the center post of pole ZB. A heart signal is being processed when the switch is in position 1 (connections are made between poles 1B and 2B, and poles 1C and 2C) resulting in a low voltage at pole 2C. When the digital board samples and checks the input at 2C, the frequencies of the software controlled 'ITL clocks (Clock A and Clock B) are adjusted for proper heart filtering at the SCFs. The signal received at 2B is that which had 34 HP LP LE Lowpass SCF Highpass SCF 13 RH —t—’[ |_"' ——° 23 e - F > \—-> LP HP SB V3111 1 1 J .Clock A Clock B 10 Digital Board H——/ é ac (Low) +2.5 V (High) Figure 2 1 . 'Ihe SCF System proceeded through both the lowpass and the highpass filters. Similarly, a respiratory signal is received at 2B when the switch is in position 3 (connections are made between poles ZB and SB, and poles 2C and 3C). The digitals board will first detect a high voltage at pole 2C, and will output the proper frequency for the 'ITL clocks. Note that the signal is diverted from the highpass filter when the 2B to 3B connection is made. Section 2.3 Amplification Stages Linear amplification is used in the analog board's design prior to three sections: the log amp, the switched capacitor filters and the sample-hold. The amplification stages establish the input signal voltages to levels required by each of the three sections. Figure 21' reveals a block diagram of the analog board. The log amp is to be the first section of the analog design, as its purpose is to increase the dynamic range and thus reduce saturation in the remaining amplifiers. It is preceded by the first stage of amplification whose design is detailed in Secton 2.3-l. The second stage of amplification is discussed in Section 2.3-2 and is positioned before the switched capacitor filters. Finally, a level shift (amplification stage) is needed to shift the analog's signal into the 0- 2.5 V range required at the input to the sample-hold and is designed in Section 2.3-3. 35 36 From Front End L 1st Stage of Amplification i 7 Rivet Logarithmic 1 Amplifier m C rcuit 2nd Stage of Amplification Level Shifting Amplifier l { Digital Board Preparation $ To the Digital Board Figure 21'. Analog Board's Block Diagram Section 2.3- 1 First Stage Section 1.2-l has stated that the magnitude of the analog board's input ( lAml ) exists in the range of 100 (N to 20mV. However, the specification sheets for the log amp state that the magnitude of its input voltage ( ILOGmI ) must exist in the range of 3 mV to 3V. So, in order to boost the voltage levels from the analog's input up to the voltage levels that are required by the log amp, a first stage of voltage gain will be positioned prior to the log amp. A linear inverting amplifier [19] is shown in Figure 22. Applying Kirchoff‘s Current Law [20] to the inverting input of this circuit and assuming an ideal operational amplifier [21], Vlln ' 0 Vlout ' 0 (15) —R'1—'+—R-2——+0A=0A 'lhis gain then relates the amplifier's voltage input (V 1111) and voltage output (V lout) as in equation (16). R2 (16) Vlout = 'fi.vlin For this first stage of gain, Vnn = Am and V1out = LOCI!n . Thus, equation (17) follows if (-R2/R1) = Cl. (17) LOGm=GI‘Am 37 38 R 1 0—’VV\/—~— + —I—-> V lin "o Figure 22. Linear Amp #1 Based on this equation and the limited voltage range required at the log amp's input, GI must satisfy the inequalities shown in equation (18) and equation (19). (Recalling, 100 uV s lAml s 20 mV.) (18) ILOGmISIGll*lAmlslGll‘ZOmVs3V (19) lLOGmflzflGll ‘IAmIZIGll*100uV23mV Using the previous two inequalities to solve for lGl | yields equation (20) and equation (21). 3V (20) |G115m= 150 3mV (21) |G1|2W=30 39 Combining the above inequalities and using lGll = I-R2/R1 I, (22) 30$lGll=l-R2/R1l.<_150 The analog devices' input resistors are 10 K9 throughout its design so as to obtain uniform current levels in the devices, Therefore, R1 is to have a resistance of 10 K9 and from equation (22), (23) 300mg l-R2 l $1.5M!) For the design, R2 = 500 K!) so that I01 I can now be calculated using the stated resistor values. 500K!) (24) lGll = l- R2/R1 l =W= 50 (34.0 dB) Using the design results of equation (24) along with equation (18) and equation (19) ensures that ILOGml will exist in the range as calculated in equation (25) and equation (26). (25) ILOGmI SIGII *20mV=50*20mV=1V (28) ILOGmI 2 lGll * 100 uv=50* 100 uV= 5mV (Notice that this is within the log amp's operating range 3 mV 5 lbOGml s 3 V.) The input to the first stage operates at very low signal levels and 40 will be greatly amplified--along with any noise that is created in the device. Therefore, a low-noise op amp (the OP227 - Precision Monolithics, Inc.) is used to reduce the output signal's noise. The component values for the first stage are listed in Table 5 and the final design for the first stage is shown in Figure 23. Here, a variable resistor (R3) is added for trimming the op amp's offset voltage to zero (see Appendix C-Trimming). A typical output from this first stage of amplification is similar to that shown in Figure 14; but, the output voltage level is within a range that is witlnin the log amp's acceptable range. .41 Table 5. First Stage Components 999.8939: V_a1_eu ca 0. 1 (LP C4 0. 1 uF Resistor Kaine R 1 R2 R3 R4 10 KO 500 K!) 50 KO pot. 190 Q Figure 23. The First Stage Section 2.3-2 Second Stage The magnitude of the input voltage to the MF6-100 is limited to a range between 0.3 V and 1.25 V. [This range allows for the analog board to have a maximum voltage swing of 2.5 V (see Section 1.2-2), and for the MF6-100 to have an input voltage whose magnitude exists within the range of 0.3 V and 5 V (as required by its specification sheets).] However, Section 2.1-1 indicated that the voltage magnitude for the signal at the log amp's output ( ILOGoutl ) exists in the range of 0.192 V to 0.364 V, when the magnitude of its input voltage exists between 5mV and l V (as designed in Section 2.3-1). A second stage of voltage gain will then be positioned prior to the SCF system in order to match the voltage levels from the log amp to those levels required at the input to the SCF system. . A linear inverting amplifier, equivalent to that of Figure 22, is shown in Figure 24. By assuming: an ideal operational amplifier, V2111 = LOGO“, V20ut = LP“, and GZ = - R1 l/R9, then equation (27) is true for this circuit. [See equation (16).] (27) LP!n = G2 " LOGout Based on this equation and the limited voltage range resulting at the log amp's output, GZ must satisfy the inequalities shown in equation (28) and equation (29). (Recalling that 0.192 V s lLOGoutl g 0.364 V.) 42 43 R9 o—vav—o— - + —T—> v 21:: ’0 Figure 24. Linear Amp #2 (28) )meI 5 I02) * ILOGoutl 5 I02) *0.364Vs 1.25v (29) ILPmI 2 I02) * lLOGoutl 2 )02) *0.192vz0.3v Using the previous two inequalities to solve for IGZI yields equation (30) and equation (31). 1.25V (30) |G2l SW = 3.43 0.3V (31) IG2IZW=L55 Combining the two inequalities and using IGZI = |- RI l/R9 | , (32) 1.553 |G2| = l- R11/R9 | $3.43 '44 Where R9 is chosen to have the standard input resistance of 10 KO" equation (32) yields, (33) 15.5KQS l-Rlll $34.3KS2 Choosing R1 1 = 33 K5) allows the digital board to use much of its voltage range thus lessening round off error (see Section 1.2-2). IG2| can be calculated from the resistor values as, 33 K52 (34-) |G2| = l- R11/R9 l = 10 K9 = 3.3 (10.4 dB) The above equation, equation (28) and equation (29) combine to reveal that ILPmI will exist in the range as calculated in equation (35) and equation (36). (35) ILPmI s )02) . 0.364V= 1.20v (36) ILPml 2 I02) * 0.192V=0.64V (Notice that this is within the log amp's operating range 0.3 V s ILPmI s 1.25 V.) The final design for the first stage is shown in Figure 25. It utilizes the second op amp of the dual op amp that was used in the design of the first stage (OP227). The component values of Figure 25 are listed in Table 6. A typical output from this second stage of 45 R10 R11 +5V Figure 25. The Second Stage Table 6. Second Stage Components Resistor R9 R10 R1 1 Kaine 10 K!) 7.5 K52 33 KS} 46 amplification is similar to that shown in Figure 14--where the output voltage level is within the SCF system's acceptable range. Section 2.3-3 Level Shift In the last section it was shown that the SCF system's output signal was limited to the magnitude of 1.25 V--thus limiting the SCF system output signal to a 2.5 V voltage swing. Yet, between the analog board and the digital board tlnere is an A/ D converter that will convert signals that exist within the range from 0 V and 2.5 V (the current signal varies between 11.25 V). A level shift is then added to the design and is the topic of this section. A level shift filtering scheme is shown in Figure 26. Here, equation (37) is the result of applying Kirchoff‘s Voltage Law to an ideal op amp circuit [20], [21]. Similarly, equation (38) results from an ideal op amp's inverting input current being 0 A. Using equation (37) to solve for I, 47 R16 Figure 26. Voltage Shifting Amp V -V Sin REP (39) 1"“ R15 Inserting this equation into equation (38) and solving for V30ut’ Vain ' VREF (40) V30“ = VREF - (R16 "‘ —_]Rl_5—_-) R16 = VREF "' 'R'15'(VREF'V31n) R18 R18 =VREF (1 +R15)'V3ln (R15) So, if VREF is a positive DC voltage and R15=R16, 48 (41) V30ut = (2 I VREF) “Vain Figure 26' illustrates the level shifting concept and is based on the results of equation (41). The top portion of this figure represents the level shift's input signal Nam), while the bottom portion shows a possible output signal (Vsout). (Note that as VREF increases, the output signal can be shifted so as to have all voltages be positive throughout its entire voltage swing.) The actual level shift amplifier design is shown in Figure 27. Here, VREF is accessed from the center point of a potentiometer (R13) whose voltage exists within the range of its end points (0V to 2.5V). . \ /_\V“““/.,. v v 2"‘V V (for Vm > 0 V) Figure 26'. Level Shift Results 49 R16 R15 +2.5V R13 Figure 27. The Level Shift Table 7. Level Shift Components Resistor Value R13 5 K52 pot. R15 10 KS) L R16 10 K9 50 The resistor is to be adjusted to a theoretical voltage of 1.25V (see Appendix C - Trimming). All resistor values are shown in Table 7, where R15=Rl6. Several signals from this level shift amplifier's output are detailed in Section 2.4-3. Section 2.4 Design Results This section contains the heart and breatln monitor's analog board design. First, Section 2.4-1 includes various schematics from previous sections into a schematic that encompasses the entire analog board's design. The monitor's power requirements and the power design are then revealed in Section 2.4-2. The typical heart and breath signals found at the analog system output are illustrated in Section 2.4-3. (Trimming information for the analog board's hardware is found in Appendix C.) Section 2.4-1 The Analog Board Various analog components have been detailed in the previous sections and are consolidated in the overall analog design of Figure 28. The detailed design schematics appear in Figure 29 through Figure 37. These figures make reference to various resistor values (Rx), capacitor values (Cx) and components (Ux) which are listed in Table 8. Table 9 and Table 10, respectively. 51 5000 8880 moan... 05. .mm 85mm .3 seem :53 am: a 5 L Rumba mm m: :50 58> s: e: A u A 0 on ocsmEAIIol, 58> o mam _ m I em 840E SH ES 524 Rama 8:3 0 V 899% 4.7m e As OF I how $0953 8 lmfi+ m4 : 9| _ 5 «~58 . 3N . > S > I) i- 0 mm. OHDWM 4L: 7 508 892 5 «.5 Go: 4 : I 4 MD 3 .353 a: is p 8 930m)» In > S > .0 v.5 on mama) - 4 I mm 95mm :2 3 gen 52 545E 52 +8.0V Patch Antenna T Gad Gérm Cl A IF gut l U13 out Figure 29. First Part R2 R1 R4 “F e Figure 30. First Stage 53 0 10K to Logn ,_]_2_10Kto 11X?n Out 1 14 thoLOG L08 I + C in Element 4 + Log Amp U3 V+ Lo OFF V- V- 9 10 3 7 a" L04. R6 H < < +12V C10 C12 - -12", C11 C13 - C Figure 31. Log Amp 54 Figure 32. Rivet Circuit '55 R10 R11 +5V Figure 33. Second Stage 56 FILTER our 3 0 LE“; 8 ILTER IN ,_ LKC} CIK 9 fcmR 3:6 VADJ _, 7 Clock A Figures 34. Lowpass SCF 57 mom 890905 .mm 9:58 >m+ >m- Bo Bo ammo m R -2 T; T: _m +0> +<> ozo< AS -<> w hm. a: .330 .: [Ail mdnm OH mugs—O B hm v30 I) «mm m: 2 . em .2 2 am \ \ 202 IE. .3: .5 . a. S cum m 438:8 m 45.22 emu mém m . m em 8 Ba _ 0 3 .3 >7: mm Sm 2m 58 R16 R15 Figure 36. Level Shift 59 IFC 5V 3 (X U8 _E_ 02410: 4 RN 0V Digital Input 0 Sample 1 3 Rx"Ix-‘2). 20 1 1 U15 Figure 37 . Digital Preparation 60 Table 8. Analog Board Resistors R13 = 5K pot. R14 = 50 K pOt. R i r = V 9 Dee in the eiregit, R1 = 10 K input to inverting input on lst stage R2 = 500 K forward loop in 1st stage (Gl=R2/R1) R3 = 50 K pot. offset adjustment at 1st stage R4 = 190 stabilizes non-inverting input at lst stage R6 = 1 K pot. adjusts offset of log amp R7 = 1M holds amp input at virtual ground R8 = 1M specified by rivet's design R9 = 10 K at inverting input at 2nd stage R10 = 7.5 K stabilizes non-inverting input R11 = 33 K forward loop in 2nd stage (02=R11/R9) offset adjustment for level shift ofi'set adjustment for lowpass SCF R15 = 10 K input to inverting input on level shift R16 = 10 K forward 100p in level shift (G=R16/R15) Rl7-R22.5 = 10 K for highpass configuration, Gain=l R23 = 8 K for chip select R24 = 10 K pot. R25 = 240 adjustment on regulator to produce +8.0V allows current flow across Vout - ADJ 61 Table 9. Analog Board Capacitors Canadictulalue W C1 = 4.7 (IF "' reduces dc bias at front end C3, C4 = 0.1 uF minimizes dc drift at lst stage C5 = 0.1 ILF specified by rivet's design C6, C7 = 0.1 uF minimizes dc drift at rivet C8, C9 = 0.1 ILF minimizes dc drift at lowpass SCF C10. C12 = 0.1 uF minimizes dc drift at log amp C11, C13 = 15 ILF “ polarizes dc voltage at log amp C14 = 0.1 uF , specified in rivet's design C18, C19 = 0.1 uF minimizes dc drift at highpass SCF C20 = 1000 pF for chip select C21, C22 = 0.1 uF minimizes dc drift at sample-hold C23 = 1000 pF sample-hold C24 = 1 uF adjustment for piezo C25. C26 =10 ILF " as specified for voltage converter C27, C31, C32 = 33 uF " polarizes dc voltage at power sources C28’C309 C33-C36 = 0.1 uF minimizes dc drift at power sources * tanly'tic capacitors 62 Table 10. Component Devices and Voltage Requirements 26213; Ul- Low noise op amp,OP227 U2- Rivet op amp, LF356 U3- Bipolar log amp, 0E12910 U4- Lowpass SCF, MF6CN-100 U5- Highpass SCF, MFIOCN U6- Sample and hold, LF398N U7- Chip select, SN74122N U8- Signal adjust, 74L8624 U9- DC/DC converter, ESIZTOS U10- Voltage converter, Si7661cj U l l - Voltage regulator, LM317T Ul2- Voltage regulator, AD580 U13- Microwave transceiver, MA86502 U 14- Power Source U 1 5- Piezo Digital Board W 0 V, i5 V 0 V, :12 V 0 V, :12 V 0 V, 15 V, +2.5 V 0V, iSV CV, :15 V +5 V 0 V, +5 V +9-18 V 0 V, +12 V 0 V, +12 V 0V, +8.0V 0 V, +8.0 V +5 V 0 V, +2.5 V, +5 V 63 BREATH (connects AB 8: C at pin 2 and pin 3) A HEART (connects A.B & C at pin 1 and pin 2) Figure 38. External Switch The diagrams for three (3) poles to an external double throw switch (see Figure 38) are individually shown in Figure 28. The two possible switch positions are determined by the operator of the monitor and result in the monitor's display representing either a heart rate or a respiratory rate. The monitor functions so as to determine a heart rate when the switch position creates a short circuit across pins 1 and 2. Short circuits are simultaneously created across 1A and 2A, 1B and 2B, and 1C and 2C; thus, connecting the rivet circuit into the log amp's feedback loop, allowing both the lowpass and highpass filtering of the signal and connecting a 0 V signal to a digital board input. Having registered the 0 V signal at the digital board, the algorithm goes into the "heart processing mode" and implements the 64 following: the TI‘L clocks are adjusted to the frequencies required in heart signal processing, the signal is sampled at the rate programmed for collecting heart data, and the subject's heart rate is calculated from the sampled data using the current heart rate algoritlnm. The monitor functions to determine a respiratory rate when the switch position creates a short circuit across pins 2 and 3. Short circuits are simultaneously created across 2A and 3A, 2B and 3B, and 2C and 3C; thus, disconnecting the rivet circuit from the log amp's feedback loop, bypassing the highpass filter and allowing only lowpass filtering of the signal and connecting a +2.5 V DC signal to a digital board input. Having registered the +2.5V signal at the digital board, the algorithm goes into the "breath processing mode" and implements the following: the TI‘L clocks are adjusted to the frequencies required in breath signal processing, the signal is sampled at the rate programmed for collecting breath data, and the subject's heart rate is calculated from the sampled data using the current breath rate algorithm. A schematic for A/ D conversion and the audible indication of the monitor's analog output signal is contained in Figure 37. When the digital board is ready to accept another data sample, it sends a signal to the chip select pin at a monostable vibrator (SN74122 - Texas Instruments). 'Ihis chip select (at U7) then triggers a sample-and- hold device (LF398 - National Senniconductor) to sample its incoming analog signal and hold its value (for a time dependent on C23), while the A/D performs its sampling. A speaker (piezo-U15) then uses the 65 analog signal (from U8) to convert a DC voltage into an audible sound convenient to the operator. Finally, the interface between the analog board and digital board is provided through a ribbon cable whose pin connections are shown in Figure 39. (These connections are from the perspective of the analog board.) Heart/ Breath Sample Voltage Trigger S l (1 (pin 1) 51:35: I N/C Clock B _ l - , .l-L (Highpass) 2 4 6 8 10 1 3 5 7 9 (Lowpass) 1)— l l l _l'l_ 6 L—-> Clock A Figure 39. Ribbon Cable Interface Section 2.4-2 The Power System The monitor's power system design was developed while the power requirements for the monitor's various devices grew and changed. The final result is that it supports all monitor components which require the following voltages: 0 V, +2.5 V, :5 V, +8.0 V and :12 V (see Table 10). (Note, that the log amp can theoretically operate with supply voltages in the range of 15 V to 3:15 V. However, when the voltage source of :l:5 V was tested, the device did not 66 perform adequately. The voltage chosen (i12 V) was readily available from the power supply as it was designed, and was also acceptable for proper log amp operation.) The digital board draws most of the current in the monitor. Although its current drain is expected to drop with additional use of CMOS devices [9], the digital board currently drains a maximum of 1.0 A at 5 V. The transceiver is the second largest user of power supply current (requiring a maximum of 200 mA). The exclusive use of CMOS technology in the remaining analog board design results in a minimal drain on the power supply current (< 100 mA for all other analog board components and the components in the power system itself). The power design is shown in Figure 40, Figure 41, Figure 42 and Figure 43. These figures will reference various resistor values (Rx), capacitor values (Cx) and components (Ux) which are listed in Table 8, Table 9 and Table 10, respectively. Central to the power system is the DC/ DC converter shown in Figure 40: this supplies the monitor with :15 V, +12 V and ground (0V) from a source supply DC voltage between 9 V and 18 V. The converter is capable of delivering 15 Watts of power, and typically supplies 1 .5 Amps of current. A relatively compact rechargeable battery is used as the portable voltage source for this converter. The remaining required voltages are supplied through another voltage converter and several voltage regulators. The voltage converter of Figure 41 accepts a positive DC voltage (+12V) and inverts it to provide the corresponding negative voltage (of -12 V). Figure 42 shows a voltage regulator which uses a potentiometer adjustment to provide the +8.0 V required at the monitor's transceiver. (See 67 +12V ‘ rm“ . o . 'U > +5V 00 ’1‘ j G) E-vm 0ND U9 -5V . Figure 40. DC/DC Converter (0V,:5V,+12V) Appendix C-Trimming). The voltage regulator scheme of Figure 43 produces +2.5 V from the mean of its two DC voltage inputs (0V and 5V). This power design has produced all of the voltages required of the monitor's various components (see Table 10), while also supplying enough current to the monitor [22]. 68 C25 +12V 8 +V -12V 2 +0 v 5 > :1:— mo \l-x C26 - -C GND 4 3 Figure 41. Voltage Converter (-12V) +12V 3 En Vout . R25 \L+ Figure 42. Voltage Regulator (+8.0V) 69 O +5V 1 E)- +2.5V 2 U12 OUT ' E- A C30 3 Figure 43. Voltage Regulator (+2.5V) Section 2.4-3 Analog Output Signals A circuit board had been designed to contain the the analog board and the power supply components of the monitor. [A housing for the entire monitor (transceiver, analog board, digital board, L.E.D.s and switches) was then fabricated using an aluminum box (3"x9"x5"). The flat patch antenna was epoxied to the bottomside of the box and surrounded with a microwave absorbent foam so as to minimize the monitor movement on the subject's chest and the effect of movement in the subject's immediate area. Also, a shell program was burned into the digital board's EPROM to test whetlner the external switch would properly signal the digital board to alter its 'ITL clock frequencies] The monitor was then placed in the center of several 70 subjects' chests, while a PC controlled sampling device collected data from the analog board. This section will show the plots of some of the typical heart and breath data that was collected. The heart type signals represented here, have been sampled at 64 Hz (see Appendix D for a discussion of the constraints on sampling frequency), and have the mean extracted from the data. The signals have also all been filtered by the switched capacitor filters with the cutoffs set at 5 Hz (lnighpass) and 20 Hz (lowpass). [This filtering scheme was suggested by those who processed the digital heart signal as the heart signal has an impulsive nature. Tlnus, the fundamental frequency can be filtered off (along with noise due to breathing) and the heart rate can still be determined from the harmonics in the signal's spectrum.) Data was simultaneously collected at the output to the first stage (V but) and the analog board's output (V 30,“), while a pulser (a crude mechanical model replicating a heart's impulsive movements, set to move at 80-85 Hz) was placed in front of the monitor's microwave antenna. As these signals represent the input and the output of the analog board, a comparison of the signals can reveal the effect of the analog board on an impulsive (heartlike) signal. The resulting data plots are shown in Figure 44 and Figure 45. These plots are in many ways very similar: both appear impulsive and the frequency of the pulses are alike (there are 46 points of data between the first two impulses of each plot). However, the minor oscillations at the input (less than 20% of the magnitude of the input pulse) become a substantial part of the output signal at the output 71 I WWI- WW4) [WWW [MM '5 ‘5‘ 3 g . 8 E, -15- H 5. .5 ti -35 - u . r o 100 200 Sample Number (@ 64 Hz) Figure 44. Pulser: V1,mt (Output of the First Stage) 72 200- 100 - 3 .2 J" 2 3 ° - 3 § ~100 '1 : -200 - -300 0 I ' l 100 200 Sample Number (@ 64 Hz) V Figure 45. Pulser: V30,“ (Output of the Analog Board) 73 (where the oscillations have a magnitude that is roughly 70% of the magnitude of the output pulse). The next two figures show plots of an actual heart signal at the analog board's output (Figure 46) and the absolute value of that signal with the mean subtracted from each data point (Figure 47). These two signal plots show heart signals occurring at a frequency rate of 1.576 H2. [’lhere are 203 sample points, or (+ 64 samples per second =) 3.172 seconds of data for 5 heart beat cycles. With 5 heart beat cycles for 3.172 seconds, the heart rate is 1.576 cycles per second (Hz).] And, although this rate can be seen, it is not always revealed in the processing of the data--especially when the heart rate is lower than the subject's respiratory rate. The heart signal is therefore bandpassed at 5-20 Hz, where the fundamental frequency is obvious in the power spectrum of its absolute value. [See Figure 48 and Figure 49 for a comparison of the power spectra (using 256 points, no zeros, 1 segment and a rectangular window) of the original signal and its absolute value, respectively. Notice that Figure 48 has its first major peak at point 20, which corresponds to 4.75 Hz. Figure 49, however, has its first power concentration at point 7, which corresponds to 1.5 Hz. (For each of the past two figures, the power spectra has a frequency resolution of 0.25 Hz, and the first point represents point zero. See Section 3.3 for more information about power spectrum analysis, as it relates to breath signals.)] 74 100- h A l ‘ 8 ~ I :3 o- I o I 5 I 8 9‘- . E '5' -100- "I III I -200 I . u - u . fl 0 100 200 300 Sample Number (@ 64 Hz) Figure 46. Heart Signal: V3,,ut (Output of the Analog Board) 75 150 - 33 i a '5'. E. 3 3 50 - '3 i a -50 I ' I 100 200 Sample Number (@ 64 Hz) 300 Figure 47. Absolute Value of the Heart Signal 76 1500 1 III E I I: '5 1000 - I I I 6' 500 - 8 ' L 0 1 ' I 0 4 hequency (Hz) Figure 48. Power Spectrum of the Heart Signal 400 - I: a I 2 o g 200- g m In 3 8 0T 4' Fn'equency (Hz) Figure 49. Power Spectrum of I Heart I 77 The remainder of this section will show plots of breath data that had been collected at the analog board's output (Vaout) for various subjects, sampled at 32 Hz (see Appendix D for a discussion of the constraints on sampling frequency), and had the mean extracted from the signal. The data collection occurred while the monitor's external switch was in the breathing position and the lowpass switched capacitor filter was configured for a cutoff frequency of 3 Hz. The breath plots appear in Figure 50, Figure 51 and Figure 52, and will be described in more detail and then processed by various algorithms, in Chapter Three. 78 300- 100'"I ~100‘ Analog Output (Relative Volts) O -200- . M IW r #1 -300 ' fi 1 i ' I 200 400 600 Sample Number (@ 32 Hz) Figure 50. Breath Signal #1 79 200q 100- Analog Output (Relative Volts) O -100' I Iwaw II -200 v r ' l l 0 200 400 600 Sample Number (@ 32 Hz) Figure 51. Breath Signal #2 IuIIhIIIIuI-in W II U # n NV r1“ M. kn) Fl I“ U. IhI M IMI IJIv LII IIUW M . Mil h ....... “Ilia m m .3 ob 533—5 253 200 400 Sample Number (@ 32 Hz) Chapter 3 Processing the Breath Signal Past monitor designs have only been concerned with the filtering, processing and rate calculation of a heart signal. The breath signal was not filtered, nor was the signal processed by algorithms which would determine the respiratory rate of the subject. The filter design, however, has become flexible enough to filter eitlner a subject's heart or respiratory signal. The current monitor thus requires an algorithm for determining respiratory rates from a breath signal. Four different schemes for determining the breath rate from the filtered and digitized breath signal will be discussed in Chapter Three. The four algoritlnms methods include: integration, auto-correlation, power spectrum analysis and recursive maximum likelihood (RML) estimation. Each algorithm will be summarized and used to calculate the respiratory rate of five different signals, including: three actual breath signals which were collected at the analog board's output, a non-filtered breath signal from the analog board's input (Vlout) and a signal which is the sum of a cosine and noise. The three breath signals have been plotted in Figure 50, Figure 5 1 and Figure 52: the analog's input signal (the non-filtered breath signal referred to earlier) is plotted in Figure 53; and, the sum of a cosine (of magnitude=1 and frequency = 1 Hz) and Gaussian Noise (mean = 0 and variance = 4) is shown in Figure 54. (See Section 4.2 81 82 1001 h I i 13) E. ‘2'.“ .5 i 400 ' I ' l ' l 0 200 400 600 Sample Number (@ 32 Hz) Figure 53. Analog Input (#4) Cosme + Gausian Noise (Relative Volts) O ’8 V i r I v 1 u 0 50 100 150 200 Sample Number (@ 32 Hz) Figure 54. Cosine + Noise (#5) 84 for a comparative analysis of the algorithms.) Each of the last five signals visibly reveal some form of high frequency components which are not a direct result of breathing or its simulation (as in signal #5). (The components are seen throughout the plots of signals #4 and #5, and near sample numbers 300, 400 and 500 in signals #1, #2 and #3, respectively). These high frequency components represent the portion of the signal due to the heart and backgound movement existing near the subject. These non-breath components can be visually removed from the signals-~thus allowing a human to visualize the portion of the signals which are due to the breathing. This visualizing has resulted in Table 1 1, which is labeled "ideal signal characteristics." This table holds the optimum values for both frequency and breaths per nninute for each of the signals. Thus, algorithmic calculations are to be compared to the values found in Table l 1. EXAMPLE CALCULATIONS FOR TABLE I 1 (using the data of Figure 50): (42) mud—S _ #samples , M , 2--half cycles . Cycle " # half cycles 32 samples cycle (615 ... 7) t (1 + 32) "' (2) = 5.49107 S_____ecc;tncrln;is cles Seconds 1 (43) Frequency (or 89%;? or Hz) = 1 + W = 5719 Hz = 0.1821 Hz 85 Table l 1. Ideal Signal Characteristics t Total # of # of # of full samples/ seconds Frequency Figure # 1/2 cycles 1 /2 cycles per cycle (Hz) B.P.M 50 7 615 5.49 0.18 10.8 51 14 610 2.72 0.37 22.2 52 19 597 1.96 0.51 30.6 53 l 1 581 3.30 0.30 18.0 54 12 192 1.00 1.00 60.0 " All signals were sampled at 32 Hz. Table 12. Actual Signal Characteristics # of Samples # Of it Zero Crossings between seconds Frequency Figure # '1 crossings per cycle (Hz) B.P.M 50 9 615 4.27 0.23 13.8 51 16 610 2.38 0.42 25.2 52 21 597 1.78 0.56 33.6 53 13 I 581 2.79 0.38 21.8 54 85 198 0.15 6.67 400 " All signals were sampled at 32 Hz, and 2 crossings per breath cycle are assumed. 86 # of Cycles or Breaths (44) B.P.M. (or Minute ) _ # of Cycles ‘ 60 seconds Second minute = [(0.18) r 60 = 10.8] B.P.M. Table 12 reveals the actual frequencies and breatlns per minute that might have resulted for the signals if zero crossing detection were implemented without visually removing the high frequency components. [Equations (42)-(44) also apply here.] Section 3.1 Integration This section will look at the effect that integration has on suppressing the unwanted higher frequency components [23] found in the five signals of Figures 50-54. The integation of a digitized signal over a particular time period M) is determined by calculations similar to equation (45) [24]. k'i‘ (45) iju) = 'r *1 x(l) + 'r * x(2) + + 'r * x(k) k = T " 2 x(n) n=1 87 [Specifically for the breath signals: k is the number of samples (640), T is amount of time per sample (1/32 seconds for the five breath signals) and x(n) is the magnitude of the nth sample of data.) The value of T is a constant, positive scalar, and can not affect the sign of this integration summation. 'Iherefore, since this exercise is meant to determine sign changes of the integrated signal (a zero crossing), T will be normalized to l and the integation of the breath signals will be approximated by their proportional running sums. The next five figures (Figure 55, Figure 56, Figure 57, Figure 58 and Figure 59) are the result of computing the running sum and tlnen subtracting the mean of the running sum from the data plotted in Figure 50, Figure 51, Figure 52, Figure 53 and Figure 54, respectively. (As the signals do not occur as positive and negative magnitudes for equal time periods, the mean has been subtracted from the running sums. Also, a commercial software package [25] has been used in performing the calculations needed for plotting the data.) 88 I r #1 15000 - 2’ o > i 5000 - i! E. S 8 E -5000 - H .5 -15000 . . . . . , j 0 200 400 600 “ Sample Number (0 32 Hz) Figure 55. Integated Breath Signal #1 89 4000 - h r #2 ..... I I I Integration - Mean (Relative Volts) I ) ) ) ) “4000 1 ' 1 r I ' l 0 200- 400 600 Sample Number (@ 32 Hz) Figire 56. Integated Breath Signal #2 9O 6000 - Breath #3 4000 q 2% > o .5 2000 - % E. E? E o 4 8 E o H - .. 5 2000 -4000 T I ' I ' f 0 200 400 600 Sample Number (@ 32 Hz) Figure 57. Integrated Breath Signal #3 91 2000 - An In 11 1500 - 3 1000-J o > n o > I I! 500 '5 T E. i o- S 8 E -m- H a -1000- -1500 v 1 ' l ‘ I 0 200 400 600 Sample Number (@ 32 Hz) Figure 58. Integrated Analog Input (#4) 92 20 "' E '3 10 . Qg§ln§ + NQ1§§ > 3 w 3 S 0 O "' E. S I '10 "' a a q 3 -20 "‘ .5 -30 u '40 ' l - l O 100 200 Sample Number (@ 32 Hz) Figure 59. Integrated Cosine + Noise (#5) 93 The rate of the previous integrated signals can be determined in an on-line program, through the use of zero-crossing detection of the signal. The integrated signals' characteristics are summarized in Table 13, wherein the number of breaths (or cycles) per minute were calculated as in equations (42)-(44). Table 13. Integrated Signal Characteristics and 2 crossings per breath cycle are assumed. # of I Samples # Of 1. Zero Crossings between seconds Frequency Figure # '1 crossings per cycle (Hz) B.P.M 55 6 494 5.15 0.19 11.4 56 13 567 2.73 0.37 22.2 57 16 485 1.89 0.53 31.8 58 12 612 3.19 0.31 18.6 59 l l 134 0.76 1.32 79.2 "‘ All signals were sampled at 32 Hz, (The results of the method of integration on the five signals have been shown in this section. However, Section 4.2 will provide further discussion and comparisons related to this and the other three processing methods.) Section 3.2 Auto2correlation The auto-correlation, Rxx (B), of a function x(t), is the expected value of the product of x(t) and x(t+fi)--where ,8 is a lag in time [26]. Below, equation (46) shows the autocorrelation function for a sampled signal, x(n) [27]. N-l (46) Rxx (.8) = 2 x(n)x(n-15) n=0 [Where, N is the number of samples in a record, n is the nth sample of the record and 13 is the autocorrelation time lag (,6 is assumed to be a multiple of the sampling time (T). or 15 * T).] The value of Rxx (B) is a measure of how much x(t) and x(t+15) are similar to each other. It depends on the delay 15, and is always a maximum for 15:0 [28]. This is because Rxx (0) is the expected‘value 0f x(n)‘x(n+0) = 2(n), which is positive for all n. Thus, while the functions in Figure 60 and Figure 61 are all sinusoids sampled at 32 Hz, the two functions in Figure 60 represent sinusoids that are in- phase with each other, and the two functions in Figure 61 represent sinusoids that are out-of-phase with each other. Therefore, if equation (46) were applied to the signals shown , then the largest possible value for Rxx (B) would result for the signals of Figure 60, and the most negative value for Rxx (15) would result for the signals of Figure 61. 94 95 Sine(x1c/32) Sine(x1c/32) Sample Number (@ 32 Hz) Figure 60. Sinusoids: In Phase (6:0) 96 Sine(x1I/32) Sine(1tx/ 32 + 1:) O O .<'> 01 1 -1.0 1 ' I I I 0 10 20 30 Sample Number (@ 32 Hz) Figure 61. Sinusoids: Out of Phase (15:16) 97 Auto-correlation has been performed on the data signals of Figures 50-54, using a commercial software package [25]. The software package calculated a normalized auto-correlation function (so that Rxx (0)=1) for all five data signals, using the following: 640 sample points. a maximum lag of 320 sample points and 0 offset points. The resulting auto-correlations for the data of Figure 50, Figure 51, Figure 52, Figure 53 and Figure 54 are plotted in Figure 62, Figure 63, Figure 64, Figure 65 and Figure 66, respectively. 98 1.0 - sample number = 186 0.5 - 8 0.0 - 3 4 -0.5 - -l.0 u ' I f 0 100 200 300 LAG-Sample Number (@ 32 Hz) Figure 62. Auto-correlation of Breath #1 99 sample number = 88 0d Rn(LAG) f r W I I r I 0 100 200 300 LAG-Sample Number (@ 32 Hz) Figure 63. Auto-correlation of Breath #2 100 1 0 1‘ sample number = 62 A A A g 0.0 . E -O.5 . -l.0 ' I I I f I fl 0 100 200 300 LAG-Sample Number (0 32 Hz) Figure 64. Auto-correlation of Breath #3 101 sample number = 105 1.00 0.50 - 8 3 0.00 . -o.5oJ '1-00 ' I ' I I I 0 100 200 300 LAG-Sample Number (@ 32 Hz) Figure 65. Auto-correlation of Analog Input (#4) 102 1.00 - 0.75 1 0'50 - sample number = 32 E? E 0.25 - . I 0.00 - I. ‘ 1 i 1 -o.25 - . . . . . 0 100 200 300 LAG-Sample Number (@ 32 Hz) Figure 66. Auto-correlation of Cosine + Noise (#5) 103 Table 14. Auto-correlation Characteristics # of " RXX(LAG) LAG. or seconds at lst peak, Sample 1 Frequency e Figure # for LAG > 0 Number per cyc (HZ) B.P.M 62 0.78 186 5.81 0.17 10.2 63 0.85 88 2.75 0.36 21.6 64 0.79 62 1.94 0.52 31.2 65 0.90 105 3.28 0.30 18.0 66 0.20 32 1.00 1.00 60.0 * All signals were sampled at 32 Hz. The rate of the original signals can now be determined from their auto-correlation functions. using equations (43)-(44) and calculating the number of seconds per cycle using equation (47). And. the results of the auto-correlation are shown in Table 14. Seconds _ #samples or LAG . 1 second Cycle " lst peak in RX): (15) 32 samples (47) (= 186 + 32 = 5.8125, for Figure 62) [This equation is based on the the signals, x(n) and x(n+fi), being most similar (Rxx (,6) is largest) after they have been shifted for as many samples as make up a cycle for x(n). Also, the results of applying the auto-correlation method to the five signals have been shown in this l 0 4 section. However. Section 4.2 will provide further discussion and comparisons related to this and the other three processing methods.) Section 3.3 Power Spectrum Analysis The power spectrum of a signal, x(n), is Su(m)--which is also the Fourier transform of the signal's auto-correlation, Rum) [29]. Therefore, once the auto-correlation of a signal, x(n), has been determined. its power spectrum can be calculated and the frequency of primary power concentration in the signal can be determined. One method of calculating a power spectrum is by a discrete Fourier transform (DFT), which applies the relationships of equation (48) and equation (49) to an auto-correlation funtion [30]. N-l (48) Karla) = 20 x(nT) ill e'janT n: (49) = “13%? (Where, N is the number of samples in the signal. sampled every T seconds, (2 is the frequency resolution of the spectrum, n represents the nth sample of a total number of N, and m is the mth discrete spectral component [31].) The power spectra of the five signals [in Figures 50-54) have been determined using a commercial software package [25]. This package calculated the power spectra using either a DFT or fast Fourier 105 transform (FFT), having the following variables: 512 points/segment, 0 offset points, 1 segment, 0 inserted zeros and a rectangular window. (512 points is used as powers of two yield more efficient FFT calculations [32].) Also, as all signals had been sampled at 32 Hz, then T = 1/32 (and N = 512), so that Q = 32/512 =0.0625 Hz. The next five figures (Figure 67, Figure 68, Figure 69, Figure 70 and Figure 71) are the power spectra that resulted from the signals previously shown in Figure 50, Figure 51, Figure 52, Figure 53 and Figure 54. respectively. The results of the spectral analyses are summarized in Table 15, where the major spikes of power in each spectrum are interpreted as occuring at the original signal's frequency. However, for further discussion and comparisons related to spectral analysis and the other three methods, see Section 4.2. 106 5e+5- 464-5" \ Om: 3e+54 a E 2e+5- m le+5- 0e+0 T M” 7 2“'I-'—-n 0 2 4 6 8 10 12 14 16 18 20 m (frequency resolution. (2 = 0.0625 Hz) Figure 67. Power Spectrum of Breath Signal #1 264-6" \ m: E E le+6- (I) 0e+0 :4. .-;:;<;:;:?*‘:. 0 2 4 6 8 10 12 14 16 18 20 m (frequency resolution, 9 = 0.0625 Hz) Figure 68. Power Spectrum of Breath Signal #2 107 2&k+5- 1xk+5- Sxx(m) oxk+oqp—q¢=;=q-§===::F=J 0 2 4 6 8 . 10 12 14 16 18 20 m (frequency resolution, 52 = 0.0625 Hz) Figure 69. Power Spectrum of Breath Signal #3 2&k+4' ]\ =5 H 0.0640 «4— “ A O 4 8 12 16 2O 24 28 32 m (frequency resolution. 9 = 0.0625 Hz) Figure 70. Power Spectrum of Analog Input (#4) 1'08 10‘ Sn(m) O 4 .MM 8 12 16 20 24 28 32 m (frequency resolution, (2 = 0.0625 Hz) Figure 71. Power Spectrum of Cosine + Noise (#5) 109 Table 15. Power Spectrum Characteristics Frequency ma Fi # S (2 Hz H gure xx(m) m ( ) ( z) B.P.M 67 4.6e+5 3 0.0625 0.1875 11.3 68 2.1645 6 0.0625 0.375 22.5 69 2.0e+5 8 0.0625 0.500 30.0 70 1.9e+4 5 0.0625 0.3125 18.8 7 1 12.9 1 6 0.0625 1.00 60.0 All original signals were sampled at 32 Hz, and 512 points/segment, 0 offset, 1 segment, 0 inserted zeros and a rectangular window were used in determining the spectra. Section 3.4 Recursive Maximum Likelihood Estimation Maximum likelihood estimation (RML) is used in situations where the signal values (Y1, Y2, . . sample are known, and have density functions [leb’fi 6)] dependent on . , YN) resulting from a random some unknown value of Q. A value for Q is estimated through the maximization of the likelihood function, LM). which is also the joint density function of the Yis [33], [34]. An RML algorithm has been developed which uses autoregressive moving-average (ARMA) spectral estimation and is summarized throughout equations (50)-(61) [35], [36]. A process, yt, can be descibed by the following ARMA model. 110 NA NC (50) Yt= ' 2 ai.yt-i"' Z Ci‘ut-HUt i=1 i=1 [Where, Yt is the process to be modeled (the analog board's output signal in this application), “t is a zero mean uncorrelated random sequence with variance, var(u), a1 and c1 are the model's coefficient parameters, and NA and NC represent the number of respective poles and zeros that are required to accurately represent the order of the process.) If 2'1 represents a unit delay (Yt- 1 = Yt "‘ z’l), then (51) Yt=:((::1; " t Where, (52) A(Z'1)= l+a1 "'z'1-I-...+aNA"‘z'NA (53) C(Z'1)= 1+c1 “'z'1+...+cNC"'z'NC The model's vector of filter coefficients is denoted as in equation (54). (54) g = [ a1. a2, 0 . .. aNA, C1, C2, . o ., CNC 1T 111 The model's filter coefficients are updated at each data sample, based upon the actual data and the filtered data [see equation (56) and equation (57), respectively], and are notated as in equation (55). (55) ¢t = [81, 82, . . ., aNA, c1, c2, . . ., °Nc ]T The data vector, (55) Yt =I'Yt-12 - - .. 'yt-NA' fit-12 - - 22 et-NA1T and the filtered data vector, (57) Yt =l'yt-12 - - ~° 'Yt-NA2 °t-1° - - .. et-NA 1T (Here, Ct and et represent the actual and filtered (predicted) error.) The values °t and 7t are calculated using equation (58) and equation (59). (58) yt=(1/Ct(k2'1))*yt (59) et=(1/Ct(kz'l))‘et Where the filter Ct (kz’l) uses the current coefficients of ¢t and is as in equation (60). (60) Ct (kz'l) = 1 +.k"‘ c1(t) z'1 + . . . + kNC“ cNC(t) z'NC l 12 At any given sample, a spectral estimate for the breath signal, yt, can then be determined from the estimated filter coefficients, as in equation (61). Further analysis of the spectrum (as in Section 3.3) reveals the signal's frequency, and thus the breathing rate. C(z'l) “ C(z) | A(z-1) '2 A(z) Z=6‘“’ (6 l) Sy(W) = var2(u) ‘ A program was written based on the previously described algorithm, and can be found in Appendix E. (The initial conditions that are used in the algorithm are that all values in the vectors a, Yt and Yt are zero, NC=3, NA=3 and k=1.) The data of the five example signals (plotted in Figure 50, Figure 51, Figure 52, Figure 53 and Figure 54) have been processed by this program, with results as summarized in Table 16 (for respective signals: #1, #2, #3, #4 and #5). For further discussion and comparisons, see Section 4.2. Table 16. RML Results 113 RML Breath Rate Estimate (B.P.M.) Elapsed Signal Signal Signal Signal Signal Time (sec) #1 #2 #3 #4 #5 1 384.9 353.2 332.6 1 12.1 409.4 2 385.3 380.7 255.2 1 13.9 3 383.9 396.5 206.9 128.7 1 4 4.1 402.4 182.7 1 14.6 Overflow 5 27.7 357.2 180.5 95.1 6 34.8 352.0 54.8 1 18.1 7 20.9 335.6 1 18.6 1 18.8 8 24.7 329.2 120.6 123.3 9 27.5 334.3 167.5 143.1 10 12.3 334. 1 178.2 144.9 1 1 8.6 325. 1 184.7 144.9 12 12.9 328.6 187.7 154.4 13 8.3 471. 1 198.8 163.9 14 3.3 61.8 199.0 158.5 15 7.8 39.0 182.5 152.8 16 10.7 49.0 183.8 148.6 17 7.8 111.4 171.7 145.7 18 13.3 1 10.6 163.9 141.8 19 11.2 131.9 166.3 144.7 L 20 12.0 145.7 182.3 145.2 Chapter Four Conclusions This last chapter provides conclusions on the analog board design (Section 4.1) and the rate calculation of the respiratory signal (section 4.2). Section 4.1 Conclusions: Analog Design The monitor's analog board filters the heart and breath signals, 80 that a digital board might further process and estimate a heart or breath rate. The primary considerations in the design has been the need to reduce the dynamic range (from the analog board's input to the input of the digital board), and the special flexibility required in filtering two different type of signals (heart and breath), occuring at different magnitudes, and at different frequency ranges. The design has allowed the analog board to be flexible in its filtering, through the use of the lowpass and highpass switched capacitor filters. These filters have algorithm controlled cutoff frequencies, which are set through the programming of the digital board. Previously. the cutoff frequencies have remained constant for heart or breath rate processing. However, the flexibility of the monitor could be increased through the use of more sophisticated algorithms, with the ability to make changes in the digital board 114 115 generated clocks (perhaps, dependent on the outcome of the rate of each processed signal). ' The monitor's dynamic range has been altered through the use of a non-linear logarithmic device. This device has the effect of having applied a variable amount of gain, depending on the magnitude of the signal. The results of using the logarithmic amplifier in the analog board design are demonstrated in Table 17. This table lists the expected voltage ranges at different locations on the analog board (as illustrated along with Figure 72). As for possible changes that could be made to any future analog board designs: more CMOS devices and a lower powered transceiver should be incorporated into the design, the source of the oscillations seen in the breath signal could be determined and reduced, and the dynamic range at the anaolg board's input could be increased by recalculation of the component values in the design of the hardware. [It is suggested that 50 11V replace the 100 [IV minimum voltage level for the lst stage's input (shown as "location A" of Table 17 and Figure 72).] 116 Table 17. Expected Input Ranges Throughout the Analog Board n\ D I L08 AmH 2nd Stage Analog Voltage Range (magnitude) => dB range Gain from Location previous device A 10011V - 20 mV 46.02 - B 5 mV - 1 V 46.02 34.0 dB C 192 mV - 364 mV 5.55 variable D 634 mV - 1.20 V 5.55 10.4 dB E 634 mV - 1.20 V 5.55 0 dB F 1.89 V - 2.45 V 5.55 0 dB 1 Front End E/'{ Level Shift A F f \ Switched l I Is t Stage Capacitor 7 Filters Figure72. Locations in the Analog Board Section 4.2 Conclusions: Respiratory Processing Chapter Three investigated four different algorithmic methods for processing respiratory signals: integration, auto-correlation, power spectrum analysis and recursive maximum likelihood estimation. Each of these algorithmic methods was appied to five individual sets of data (plotted in Figures 50-54), and the resulting breathing rate was then recorded in the methods' respective sections. Here, the rates that resulted from each algorithm are summarized in Table 18 (in units of B.P.M., or breaths per minute). [From Chapter Three, the "ideal" rate of the signal is considered that rate as determined by visually recognizing the frequency of the breath signal's cycle. The "actual" rate of the signal is then considered the rate calculated from the number of samples and the number of zero crossings that occur over these samples. Overall, it is desirable for the rate estimates to match those rates shown in the "ideal" column. The application of the method of integration to these data resulted in some improvement. These rates are quite close to the ideal rates for all of the signals, except where the signal was a cosine + noise (Figure 54). Overall, the integrated signals often wandered to either the positive or negative, and the resulting plots don't show integrated signals that could be relied upon enough to recommend this method (without reservations). The methods of auto-correlation and spectral analysis, resulted in rates that are an improvement over those obtained from the actual 117 Table 18. Algorithm Breath Rate Summary t Difi'erent Algorithms Breath Rate Estimate (B.P.M.) a) (after approximately 20 seconds) _ "" Ze A t S tr RML m Ideal Crossr0 s Integration! u 0 nl pec all ' (Actu Correlatio Analysis Estimation 50 10.8 13.8 11.4 10.2 11.3 12.0 51 22.2 25.2 22.2 21.6 22.5 145.7 52 30.6 33.6 31.8 31.2 30.0 182.3 53 18.0 21.6 18.0 18.0 18.8 145.2 54 60.0 400 60.0 60.0 60.0 - signal. The rates are also quite close to the ideal rates. And, although either of these methods could be recommended, the spectral analysis is less desirable, as it must calculate a spectrum from an already obtained auto-correlation function. Therefore, the auto-correlation method is the processing method that is recommended for obtaining breath rates for this heart and breath monitor. As for the recursive maximum likelihood estimation, the results were reasonably close to the ideal breath rate in only one of the five cases. These results are not acceptable when compared to the other three methods. This method is not currently being recommended. However, RML estimation should not be abandoned as there are several possibile explanations for the algorithm's inaccuracy: the breath signal may require a model of greater order (currently, NA=3 and NC=3), the prefilter, C(z'l), may have become unstable (as it can for the case where k=1) and the likelihood function may have detected "false" maxima [35], [36]. Also, the data collection time period used 118 (20 seconds) may not give the algorithm as much time as it requires to calculate breath rates (yet, there is no indication that extending the processing time past 20 seconds would yield more favorable results). 119 APPENDICES APPENDIX A Logarithmic Amplifier A logarithmic amplifier (log amp) results from the placement of a diode in the feedback loop of astandard op amp circuit [Al]. Such a log amp is illustrated in Figure A1 and will be analyzed in this appendix. '1’ V F ‘ T, . R + —> 1111 — + 4. Vin vout C D V Figure A1. Logarithmic Amplifier The volt-ampere characteristic for the diode can be that of equation (Al) [A2]. 120 121 (A1) IF=IO[e(VF/K) -1] Where 10 is the diode's reverse saturation current and K is a constant dependent on the p-n junction of the diode. And if (VF/K) » 1, this equation can be simplified to the following approximation. (A2) 1,. 510 JVF’K) The results of applying the natural logarithm (In) to this approximation and then solving for V1.- can be seen in equation (A3) and equation (A4), respectively. V (A3) ln(IF) == ln(lo) + (fr) (A4) VF a K [ ln(IF) - ln(Io] ] The condition, if (VF/K) » 1, applies to each of the two previous equations. The log amp circuit can now be solved by assuming ideal op amp conditions--where currents into both input terminals are zero amps and the voltage between the input terminals is zero volts [A3]. Therefore, due to the virtual ground at the amplifier's inverting input, (A5) Iin = E- and 122 (A6) Vout = " VF While, due to zero input current at the inverting input, summing currents here yields equation (A7). The amplifier's output voltage can be expressed in terms of its input current: if equation (A6) is compared to equation (A4), substituting In for IF , (A8) vout = - vF = - K [ mum) - ln(Io) ] Using equation (A8), and the relationship of equation (A5) gives, (A9) vout = K[ ln(Io) - 14%)] If (VF/K) = (Vout/K) » 1, and for ideal op amp conditions. It can then be said that the logarithmic device (of Figure A1) converts its input voltage Wm) to a voltage (Vout) that is related to the natural logarithm of the device's input voltage. APPENDIX B Switched Capacitor Filters Switched capacitor filters (SCFs) operate much like RC-filters, with the switched capacitors (SCs) imitating the resistor characteristics of an RC-filter. This concept is illustrated through Figure A2 and Figure A3, which both show second order Butterworth filters; Figure A2 is a standard RC-filter whose resistors are replaced by the switched capacitors in Figure A3 [A4]. The remainder of the appendix will summarize a proof of the equivalence of an SC to a resistor [A5]. Figure A2. Second Order Butterworth Lowpass Filter 123 124 Figure A3. Second Order SC Butterworth Lowpass Filter A continuous resistor and its parallel SC realization are shown in Figure A4. The lines denoted by "1" and "2" can be viewed as a node-- wherein any current (or charge) entering or leaving these lines can be summed to zero using Kirchoff's Law. Also, the switches are to be operated by a two-phase clock waveform like the one shown in Figure A5: when the pulse of $1 goes high, the switch labeled 51 will close and when the clock waveform goes low this switch will then open. (The same relationships exists between the other clock and switch, labeled s2.) It is assumed that the SC network portion of Figure A4 is inactive-where both switches are open and C is discharged. And, if V1 and V2 are independent DC voltage sources, that at time to = nT the two-phase clock is applied (thus operating the switches). 125 i Isl 82 I 1 1+L ‘— I l + I | V1 l I - I c; I l l L F 1 'l I 1 2 il—> R 4—12 0 JVVVV O + + V V 1 0 JD Figure A4. Switched Capacitor as a Resistor 126 high 0 H r11 low , + t - t o l I l l I I I I I ‘2‘ I I I I I I I I I I h‘gh'r I I I I I I] II I 10W 17 I i I I>t_to O T/ 2 T 3T/ 2 2T 5T/ 2 Figure A5. Two-phase Clock When the first clock pulse goes high, the first switch (s1) closes allowing the capacitor to charge to V1 . (The switches have a small resistance, R. so the capacitor does not charge instantaneously, thus the RC constant must be less than the pulse width of $1 for complete charge transference.) When the first switch opens (and prior to the closing of the second switch) the charge that flowed into C (across line 1 and in the direction of i1) is equal to equation (A10). (A10) Q(t0 + T/2) = 0 v1 The second phase period of the clock then occurs: the second pulse (82) goes high, which closes switch 82 , causing the capacitor to charge to V2 . The second switch then opens, and the charge that l 2 7 flowed into C (across line 2 and in the direction of i2) becomes equal to equation (All). This is the difference between the charge placed on C by V2 and the charge placed on C by V1 . (Notice, that the charge flowing past lines 1 and 2 is not equal to the charge on C.) Similarly, a third phase period occurs--closing 81 and charging C to V1 . After s1 opens, the charge that flows as a result (across line 1 and in the direction of 11) is equal to equation (A12). (A12) Q(to+3T/2)=CV1'CV2=C(V1‘V2) If this pattern were to go on indefinitely, the last two equations would be repeated indefinitely. (Therefore, the system's steady state has been reached.) The resistance of the lower portion of Figure A4, is defined as in equation (A13). V - V V - V 1 2 Recalling that the voltage sources are DC (constant) voltage sources, the current flow past a point in a circuit can be described by equation (A14). 22122 (A14) 1 = 128 The charge flowing past line 1, during a clock phase and in steady state conditions, is then expressed as Q1 in equation (A15). t0+3T/2 (A15) I 91: I Ildt to-I-T And, since no charge flows across line 1 when the first switch is closed (i1=0), equation (A15) is legitimate throughout an entire clock cycle. Thus, t0+3T/2 t0+ /2 Equation (A17) is the result of relating equation (A12) to equation (A16), and dividing by T results in equation (A17). (A17) 960 + 3T/2) = 1, dt to-I-‘1‘l2 And, given the definition of average current in equation (A18), to +3T/2 (A18) I1 (average) = 7}:- i1 dt to+£72 Then, combining equation (A17) and equation (A18), yields equation (A19). 129 (A19) Q(to + 3T/2) = T x I1 (average) And, then substituting in the result of equation (A12) gives equation (A20). (A20) C (Vl - V2) = T x11 (average) This equation can be rearranged as shown in equation (A21). V1 'V2 _ 1 I1 (average) ' C (A21) And, if both V1 and V2 are constant during the clock period T (then 11(average) = 11 ) and using equation (A13) with equation (A21) gives, (A22) R = Olr-l Now let the clock period read T , so that its clock frequency is fc (in Hertz). Then, (A23) R-E-l -c 47c This reveals that the resistance equaivalent of the SC parallel network can be the inverse of its capacitance, multiplied by its clocking frequency (assuming proper conditions). An SC, however, is not always a resistor's equivalent when it 130 exists within a circuit which is more complex than that of Figure A4. This can be illustrated by Figure A7 -- where an op amp filter (see Figure A6) has its resistor replaced by the parallel SC [A6]. Notice, that the capacitor charges as the first switch (61) closes and opens. When the second switch (82) closes, the capacitor's voltage then exists across the op amp's terminals (the voltage here should ideally be 0 V). Fortunately, SCs have many realizations (i.e. series, series-parallel and parallel-series) [A7]. The resistance(s) in a particular RC-filter design can usually be approximated by combinations of various SC realizations within a circuit. 131 R1 C1 O—W + O 4. vii Vat C O Figure A6. A Standard Op Amp Filter Figure A7. A Switched Capacitor Filter APPENDIX C Trimming There are many devices on the analog board that require adjustment and trimming for the heart/breath monitor to function properly. The trimming of the analog board can be obtained by following the steps listed below. (It is suggested that this section be used with the design schematics from Section 2.4 .) 9’ >129!» Do not connect the microwave transceiver until after step 4. Turn on the board's power supply (or attach battery). Adjust the potentiometer, R24, until V,mt (see Figure 41) reads +8.0 V. ’Durn the board's power off (or disconnect the battery). Attach the microwave transceiver to the board (see Figure 29). Turn on the board's power supply (or attach battery). Attach an oscilliscope to the lst stage's voltage input, Vnn (see Figure 30). Producing movement at the input to the microwave cavity will result in an AC voltage registering at the oscilliscope. (If not, the oscilliscope settings and the transceiver connections should be adjusted until this is the case.) Isolate the transceiver input from movements. (V 1111 should not reveal any AC voltage. If it does, consider further protection of the transceiver input.) 132 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. l 3 3 Attach an oscilliscope to the lst stage's voltage output, Vlout (see Figure 30). Adjust the offset resistor, R3, until the DC voltage for Vlout = 0V (within a few microvolts). Verify proper function of the lst stage (G 1:50) by comparing the range of voltage at its input to that at its output. (The transceiver must obviously not be isolated for this verification.) Again, isolate the transceiver input from movements. (This must be done for the remainder of the trimming unless stated otherwise.) Attach an oscilliscope to the log amp's voltage output, LOGout (see Figure 31). Vary the offset adjustment resistor, R6, from one extreme to the other and note the change. (The DC voltage changes should be as follows: at one extreme, a stable positive /negative voltage (of 250.2 V) becomes unstable (the signal flickers on the scope) and again becomes stable, but this time at 0 V : the 0V reading too becomes unstable, and the voltage procedes to register as an unstable negative/positive voltage (of 2220.2 V), which stablizes at the other extreme.) Adjust the offset adjustment resistor so that the log amp's output voltage registers a stable 0V. The offset adjustment for the second stage has already been done in steps 7-1 1 (the dual op amp has just one adjustment). The TTL clock frequencies should be supplied to both the lowpass and highpass SCFs (see Figures 34 and 35). Attach an oscilliscope to the Lowpass SCF's voltage output, LPout 20. 21. 22. 23. 134 (see Figure 34). Adjust the filter's offset voltage (using R14) until LP,mt = 0 V DC. Attach an oscilliscope to the Level Shift's voltage output, V30ut (see Figure 36). Adjust the filter's offset voltage (using R13) until V30,“ = 1.25 V DC. Analog board trimming is completed. APPENDIX D Sampling Constraints Section 1.2-1 had restricted the monitor's design to the processing of respiratory signals and heart signals which exist within the frequency ranges of 0.1 Hz to 2.0 Hz and 0.5 Hz to 2.0 Hz, respectively. Support was given to establish these ranges as exceeding the normal expectant heart and respiratory rates for human subjects. These constraints did, however, assist in. the analog board's design; from a hardware perspective, all components could be chosen to be capable of processing signals within these frequency ranges. The algorithm (thus the prograrmner of the algorithm) needs to be aware of the signals' frequency limitations in order to reduce both the processing time, and the space in memory that is occupied by the the data being processed. This appendix will summarize the relationships between the following: the frequency range of a signal (f 1 5 f5 f2), the minimum sampling rate required to reproduce the analog signals in this range (fs), the minimum number of samples required (N), and their relationship to the minimum processing time and the memory space needed in calculations using the data. Shannon's sampling theorem requires that the monitor must (at least) sample at the Nyquist sampling rate, f8 2 2"‘fn , (where fn is the highest frequency in the signal), in order to reproduce the analog's time signal [A8]. So, as the largest signal rate allowed for both the heart and respiratory signals is 2.0 Hz, the signal processing algorithms must use a minimum sample rate of 4.0 Hz (or 2 " f2 ). (A 135 136 larger sampling frequency is desired, as the heart and breath signals carry higher frequency information that may be related to the signal rate.) The minimum number of sample points needed can be determined once the sampling rate is known: as N 2 f5 / F (where UP is the largest period of a signal and F is the frequency resolution of a signal's spectrum) [A9]. It is expected that the collection of data samples, at a sampling rate of f8 (samples per second), for a time period of l/F (seconds) requires that at least f8 (1/F) samples are collected. The minimum number of samples required in processing a breath or heart signal is then 40 samples and 8 samples, respectively. (Calculated using fs = 4.0 Hz and F = 0.1 Hz for breath processing, and F = 0.5 Hz for heart processing.) The number of samples needed for processing will have a direct effect on the memory space needed and the time required to process the samples. This is because each sample will usually require storage prior to processing--with more samples requiring more space. Assuming equal sampling rates, it will take more time to collect 40 samples than it will to collect 8 samples. For test purposes, it is desired that the higher frequency details are. required for processing. Therefore, the sampling rates for use in the plots will be increased to 32 Hz for breath signals and 64 Hz for heart signals. A minimum of 320 breath data samples and 128 heart data samples are then required for sampling an entire (heart or breath) cycle: however, twice as many samples will be collected to ensure that the data represents more than one entire heart or breath cycle. (See Table A1 for a summary of the sampling constraints 137 specified in this appendix.) Table A1. Sampling Constraints Expected frequency range Minimum sample rate Minimum # samples Minimum time required Actual sample rate # samples needed data collection time HEART 0.5-2.0 Hz 4.0 Hz 8 samples 2 seconds 64 Hz 256 samples 4 seconds BREATH 0.1-2.0 Hz 4.0 Hz 40 samples 10 seconds 32 Hz 640 samples 20 seconds APPENDIX E A Recursive Maximum Likelihood Program The following is the recurSive maximum likelihood estimation program that was used as described in Section 3.4. This is a BASIC program and has been adjusted here, so as to remain with in the margins of the document. Therefore, where a "+" is in the first column, it is intended for all information to remain on the previous line of the BASIC program. 1o'fitttfitttttflt.ittttttfifititfifitfilltt¢tt*3.0tttfitttttttttttttit 20 "" SUBROUTINE ISMDL: PERFORMS PARAMETER ESTIMATION +FOR IMPULSE RESPONSE" 30 "" AND AR/ARMA RANDOM PROCESSES, IE PARAMETRIC +SPECTRAL ESTIMATION " 40 "' (c)COPYRIGI-1T 1985, 1986 GREG D. HOSHAL 50 "" 60 '* 1. ALL POLE IMPULSE RESPONSE 7O "' 2. POLE/ ZERO IMPULSE RESPONSE 80 "' 3. AR PARAMETER ESTIMATION (NON-RECURSIVE) 90 "' 4. ARMA PARAMETER ESTIMATION(RECURSIVE) l 00 tttfittfitttttttttttttfittfitfittfitttfititttttttttttttttttttttIII l 10 OPTION BASE 1 :DEFINT I-P 1 4O MAX=O : IROW=7+NPARAM"2:TP=8‘ATN( 1 l) 150 DIM (8192),A(10),B(10),COR$(4,2),ZP(10, 10),ZP1(10, 10),V(16), +ZPHI(1 6),ZPSI(16),ZPV(16),ZP2(10, 10),FAC(8),DAT%(8 192) 170 REM"*RECURSIVE ML ARMA PARAMETER ESTIMATION""" 171 KEY(1) ON 173 ON KEY(1) GOSUB 175 174 GOT O 180 175 N=O:RETURN 261 180 SCREEN 1:KEY OFFzCLS 190 LOCATE 1, lzPRINI‘" MICROWAVE VITAL SIGNS MONITOR ": 200 LOCATE 3, l :PRINT'BREATHING RATE ESTIMATION TEST +PROGRAM"; 202 LOCATE 4, 1 :PRINT" ": 220 LOCATE 8, l :PRINT" 1 . Take sampled data for estimation." *‘Ifilpilg. 1'38 139 230 LOCATE 10,1:PRINT" 2. Retrieve data file for estimation." 240 LOCATE 12,1: PRINT" 3. Begin recursive rate estimation." 250 LOCATE 14,1:PRINT" 4. Exit to system. 260 LOCATE 15, 20: INPUT N . 261 FOR I=15 TO 22:LOCATE I,1:PRINT SPACE$(39)::NEXT I 280 IF N=4 THEN STOP 290 IF N=3 THEN GOSUB 370:GOTO 320' BEGINE ESTIMATION 300 IF N=2 THEN GOSUB 560:GOTO 320' RETRIEVE DATA FILE 310 IF N=1 THEN GOSUB 2000:GOTO 320"“TAKE SAMPLED DATA 320 LOCATE 15,20:PRINT SPACE$(20):GOTO 200 330 GOTO 260'NEX'I‘ INPUT 340 PRINT"HIT ANY KEY TO BEGIN ESTIMATION" 350 X$=INKEY$:IF X$="" THEN 350 360 CLS 370 NA=3:NC=3'NA=#POLES,NC=#ZEROES 380 SCALE=.99' PREFILTER SCALE FACTOR 390 ZLAMO=.95' LAMBDA ZERO 400 ZLAM=.99' IAMBDA ZERO 410 ALPHA=1' PREFILTER SCALE FACTOR 420 NREPS=1' NUMBER OF TRIALS IN SAME FILE 422 GOT O 660 430 REMfittttiitfitfitfitttttfififittttttttfitttfifitfitfifitttlttttttttttilt 440 REM“*RECURSIVE MAXIMUM LIKELIHOOD ARMA MODEL +SPECTRAL ESTIMATION‘” 450 REM‘”ALGORITHM. TAKEN FROM IEEE TRINF.THRY.VOL.IT- +28,NO.4, ”“ 460 REM“‘JU LY l 982. “" 470 REM""USER SPECIFIED VARIABLES: “* 480 REM“" AR MODEL ORDER “"“ 490 RE1\!1""""I MA MODEL ORDER “* 500 REM"‘ FILESPEC TO FILTER “* 5 10 REM"" FORGETTING FACTOR LAMBDA *" 520 REM"‘ PREFILTER SCALE OR TRANSIENT CONTROL, K“* 530 REM""' (NOTE K=0 ELS; K= 1 MAY BE UNSTABLE *" 540 REM"" UPDATE INTERVAL FOR OUTPUT(NO.SAMPLES) u. 550 REMstssn-taests64688ssoessetaesteatssssstsetstsstasatssst 560 '...*SUDrOUtine to get data file ttfittttitttttlttttttttttttttti 570 LOCATE 18,15:1NPUT'Filespec";F$:LOCATE 18,15:PRIN1‘ +getting file" 580 OPEN F$+".DAT" FOR INPUT AS #1 590 INPUT #1.NS.SR.SOFF,TP$.TP$ 600 FOR I=1 TO NS 610 INPUT #1,D(I) 620 NEXT I:LOCATE 18,15:PRINT SPACE$(14);:CLOSE #1 630 LOCATE 18,15:PRIN'1"FILE:";F$+" ":LOCATE 19,15:PRINT"# +samples= ":NS 640 LOCATE 20,15:PRINT'Sampling rate=":SR; 650 RETURN 140 660 LOCATE 18,15:PRINT SPACE$(14)::LOCATE 19,15:PRINT +SPACE$(14); 670 LOCATE 20, 15: PRINT SPACE$(14); 680 LOCATE 17,1: PRINT ELAPSED TIME(SCC)": 690 LOCATE l9, 1: PRINT" ------------------- : 695 LOCATE 17,22:PRINT' ESTIMATE "; 700 LOCATE 18,22: PRINT'AVG BRTHS/MINUTE"; 701 LOCATE 19, 22: PRINT ---------------- "' 710 FOR I=1 TO NA+NC: FOR J=l TO NA+NC: ZP(I J,)= 0: NEXT J: NEXT I 720 REM‘" INITIALIZE ALL VALUES 730 FOR I=l TO NA+NC 740 ZPHI(I)=0 750 ZPSI(I)=O 760 ZPV(I)=0 770 ZP(I,I)=ALPHA 780 NEXT I 790 ZLANIT=ZLAMO:FOR I=l TO 8:FAC(I)=SCALE"I:NEXT I 800 IDCNT= 1:1PV=NA+NC:ISECCNT= l 810 REM""COMPUTE PREDICTION ERROR 820 'GOSUB 1980' GO DISPLAY UPDATED PARAMTER VALUES AND +VECTORS 830 SUM=0 840 FOR I=l TO IPV 850 SUM=SUM+ZPHI(I)’ZPV(I) 860 NEXT I 870 EPST=D(IDCNT)-SUM':E(IDCNT)=EPST 880 REM“"UPDATE COVARIANCE MATRIX ESTIMATE 8902 FOR I=1 TO IPV:V(I)=0:NEXT I:SUM=0 900 FOR I=1 TO IPV 910 FOR J=1 TO IPV 920 V(I)=V(I)+ZPSI(J)*ZP(J,I) 930 NEXT J 940 NEXT I 950 FOR I=1 TO IPV 960 SUM=SUM+V(I)"‘ZPSI(I) 970 NEXT I 980 DEN:1/(ZLAMT+SUM)"'”“""MAY BE WRONG ON +1NTERPRETATION”“"““ 990 FOR I=1 TO IPV:V(I)=0:NEXT I:SUM=0 1000 FOR IR=1 TO IPV 1010 FOR IC=1 TO IPV 1020 V(IR)=V(IR)+ZP(IR,IC)‘ZPSI(IC) 1030 NEXT IC 1040 NEXT IR 1050 FOR IR=1 TO IPV 1060 FOR IC=1 TO IPV 1070 ZPl(IR,IC)=V(IR)‘ZPSI(IC) 1080 NEXT IC 1090 NEXT IR 141 1100 FOR IR=1 TO IPV 1110 FOR IC=1 TO IPV 1 120 SUM=0 1 130 FOR K=l TO IPV 1 1 40 SUM=SUM+ZP1(IR,K)*ZP(K,IC) 1 150 NEXT K 1 l 60 ZP2(IR,IC) =SUM‘DEN 1 170 NEXT IC 1180 NEXT IR 1190 FOR 1:] TO IPV 1200 FOR J=1 TO IPV 1210 ZP(I,J)=(ZP(I,J)-ZP2(I,J))IZLAMT 1220 NEXT J 1230 NEXT I 1240 REM 1250 REM“*UPDATE PARAMTER VECTOR”"‘"*""****"'*"'*"'*** 1260 REM 1270 FOR IR=1 TO IPV 1280 SUM=0 1290 FOR IC=1 TO IPV 1300 SUM=SUM+ZP(IR,IC)*ZPSI(IC) 1310 NEXT IC 1320 V(IR)=SUM*EPST 1330 NEXT IR 1340 FOR I=l TO IPV 1350 ZPV(I)=ZPV(I)+V(I) 1360 NEXT I 1370 "““COMPUTE CURRENT BREATHING FREQUENCY AND +DISPLAY‘" 1382 IF ISECCNT