[IEEE 2007 IEEE Region 5 Technical Conference - Fayetteville, AR, USA (2007.04.20-2007.04.22)] 2007...

4
167 A Compact, Self-Contained Cough Monitoring System Matthew Barlow 1, Vasundara V. Varadan* 1, and Jia Di2, Khoa Phan 1, 1 Department of Electrical Engineering 2 Department of Computer Science and Computer Engineering University of Arkansas, Fayetteville *[email protected] Abstract - A self-contained cough monitoring system is a device patient's suprasternal notch. Privacy was maintained for the that allows remote and quantitative cough measurements in patient since the accelerometer did not record ambient noise, patients. The device is being developed to achieve two goals: and the filtering unit removed most components of speech. convenience and security. This paper focuses on the features of The device was ultra-portable, and was powered by a 9-Volt the cough monitor hardware and development of the battery. The recording time varied based on the memory card microcontroller firmware, and directions for future research. used. The minimum size supported - 32 megabytes - allowed I. INTRODUCTION about 66 minutes of recording time, while the largest card supported allowed just over 17 hours. Software was provided Coughing is a common reflex mechanism to clear to enable frequency and time domain analysis, as well as blockages of the wind pipe. As such, it is also a general viewing the cough signal envelope. The Matlab software indication of unhealthiness. The presence of a cough is a could also automatically remove periods of silence from the reason for consulting a doctor, purchasing over-the-counter recording, and do limited categorization of the remaining cough suppressing medicine, and visiting a hospital. 19 billion signals. The validity of this method of recording was dollars were spent in 1995 [1] on over-the-counter cough and confirmed by Paul et al [6] in a study comparing the accuracy cold remedies. However, studies have shown that the of the cough monitor and a video recording. The result effectiveness of cough medicine is comparable to placebo. showed good agreement between the cough counts recorded These studies often lack uniform and quantitative methods for on video and by the cough monitor. recording and analyzing coughs in subjects. While the recording device was indeed revolutionary, the Previous efforts towards recording coughing include recorder was not optimized for small size. Only some brands those by Hsu et al [2], which used a unidirectional of CF memory cards could be used with the existing firmware, microphone and electromyograms to determine when the and the product was not "finished". This group aims to patient was coughing. This method obtained good results in improve the quality of the device by using more compact detecting coughs, but with the 50Hz sampling rate, a detailed circuit design, lower voltage requirements, and a smaller reconstruction of the coughs is not possible. Jaeger et al [3] memory card based on the Secure Digital (SD) standard. The developed a system that correlated data from a microphone, an same Matlab software was used as in [5]. We succeeded in accelerometer measuring movements and vibrations from the creating an improved device, although it remains to be throat, and an electromyogram to sense muscle movements. perfected. The final system, as shown in Fig. 1, is a much This system was effective in rejecting interference, but smaller device that can be commercialized. required the patient to be stationary. Subburaj et al [4] produced a device using an accelerometer attached to a radio II. HARDWARE/FIRMWARE transmitter. The RF signal was then received by a large base stto fr reodig Th deic allowedfr fremomnt The cough monitoring system, Fig. 2, uses a PIC 1 8F6722 for th patient but *requre a large riecordin unit to functi microcontroller to record data from an internal A/D converter. the panalysi sotwreqproed n lautom ring the . functio This circuit is fed by a fourth-order low-pass Butterworth The analysis sof e pnetwork and a gain stage. The input signal is sampled at 8 kHz user to play back the entire recording to analyze the recorded and stored on a SD memory card. The SD card is connected data. through the Serial Peripheral Interface (SPI) built into the To alleviate this need, Jewell [5] developed a prototype mth cough recorder with Matlab-based analysis software. r. T g device consisted of a MEMS accelerometer for the sensing of Since the onboard A/D has a 10-bit resolution, additional gain cough, and a PIC microcontroller digitizing samples and and level-shifting can be performed digitally inside the PIC storing the samples to a Compact Flash (CF memory card. wihuadtonlcriry This approach was unique in using a calibrated accelerometer Pormigi oei sn h utmCmue to acurtel meaurecouh efortandmagitud ina slf- Services Windows IDE. In order to write to the SD card, the contaned mbultoryunit.The ccelromeer ws tpdth Progressive Resources Flash File library was implemented. 1-4244-1280-3/07/$25.00 ©2007 IEEE 2007 IEEE Region 5 Technical Conference, April 20-21, Fayetteville, AR

Transcript of [IEEE 2007 IEEE Region 5 Technical Conference - Fayetteville, AR, USA (2007.04.20-2007.04.22)] 2007...

Page 1: [IEEE 2007 IEEE Region 5 Technical Conference - Fayetteville, AR, USA (2007.04.20-2007.04.22)] 2007 IEEE Region 5 Technical Conference - A Compact, Self-Contained Cough Monitoring

167

A Compact, Self-Contained Cough MonitoringSystem

Matthew Barlow 1, Vasundara V. Varadan* 1, and Jia Di2, Khoa Phan 1,1 Department of Electrical Engineering

2 Department of Computer Science and Computer EngineeringUniversity of Arkansas, Fayetteville

*[email protected]

Abstract - A self-contained cough monitoring system is a device patient's suprasternal notch. Privacy was maintained for thethat allows remote and quantitative cough measurements in patient since the accelerometer did not record ambient noise,patients. The device is being developed to achieve two goals: and the filtering unit removed most components of speech.convenience and security. This paper focuses on the features of The device was ultra-portable, and was powered by a 9-Voltthe cough monitor hardware and development of the battery. The recording time varied based on the memory cardmicrocontroller firmware, and directions for future research. used. The minimum size supported - 32 megabytes - allowed

I. INTRODUCTION about 66 minutes of recording time, while the largest cardsupported allowed just over 17 hours. Software was provided

Coughing is a common reflex mechanism to clear to enable frequency and time domain analysis, as well asblockages of the wind pipe. As such, it is also a general viewing the cough signal envelope. The Matlab softwareindication of unhealthiness. The presence of a cough is a could also automatically remove periods of silence from thereason for consulting a doctor, purchasing over-the-counter recording, and do limited categorization of the remainingcough suppressing medicine, and visiting a hospital. 19 billion signals. The validity of this method of recording wasdollars were spent in 1995 [1] on over-the-counter cough and confirmed by Paul et al [6] in a study comparing the accuracycold remedies. However, studies have shown that the of the cough monitor and a video recording. The resulteffectiveness of cough medicine is comparable to placebo. showed good agreement between the cough counts recordedThese studies often lack uniform and quantitative methods for on video and by the cough monitor.recording and analyzing coughs in subjects. While the recording device was indeed revolutionary, the

Previous efforts towards recording coughing include recorder was not optimized for small size. Only some brandsthose by Hsu et al [2], which used a unidirectional of CF memory cards could be used with the existing firmware,microphone and electromyograms to determine when the and the product was not "finished". This group aims topatient was coughing. This method obtained good results in improve the quality of the device by using more compactdetecting coughs, but with the 50Hz sampling rate, a detailed circuit design, lower voltage requirements, and a smallerreconstruction of the coughs is not possible. Jaeger et al [3] memory card based on the Secure Digital (SD) standard. Thedeveloped a system that correlated data from a microphone, an same Matlab software was used as in [5]. We succeeded inaccelerometer measuring movements and vibrations from the creating an improved device, although it remains to bethroat, and an electromyogram to sense muscle movements. perfected. The final system, as shown in Fig. 1, is a muchThis system was effective in rejecting interference, but smaller device that can be commercialized.required the patient to be stationary. Subburaj et al [4]produced a device using an accelerometer attached to a radio II. HARDWARE/FIRMWAREtransmitter. The RF signal was then received by a large base

stto fr reodig Th deic allowedfr fremomnt The cough monitoring system, Fig. 2, uses a PIC 1 8F6722forth patient but*requre a largeriecordin unit to functi microcontroller to record data from an internal A/D converter.the panalysi sotwreqproed nlautom ring the.functio

This circuit is fed by a fourth-order low-pass ButterworthThe analysis sof e pnetwork and a gain stage. The input signal is sampled at 8 kHzuser to play back the entire recording to analyze the recorded and stored on a SD memory card. The SD card is connecteddata. through the Serial Peripheral Interface (SPI) built into theTo alleviate this need, Jewell [5] developed a prototype mthcough recorder with Matlab-based analysis software. r. T gdevice consisted of a MEMS accelerometer for the sensing of Since the onboard A/D has a 10-bit resolution, additional gaincough, and a PIC microcontroller digitizing samples and and level-shifting can be performed digitally inside the PICstoring the samples to a Compact Flash (CF memory card. wihuadtonlcriryThis approach was unique in using a calibrated accelerometer Pormigi oei sn h utmCmue

to acurtelmeaurecouh efortandmagitud ina slf- Services Windows IDE. In order to write to the SD card, thecontanedmbultoryunit.The ccelromeer ws tpdth Progressive Resources Flash File library was implemented.

1-4244-1280-3/07/$25.00 ©2007 IEEE 2007 IEEE Region 5 Technical Conference, April 20-21, Fayetteville, AR

Page 2: [IEEE 2007 IEEE Region 5 Technical Conference - Fayetteville, AR, USA (2007.04.20-2007.04.22)] 2007 IEEE Region 5 Technical Conference - A Compact, Self-Contained Cough Monitoring

168

This library was further modified to obtain enhanced writing ensures that all file names are unique, and convey two piecesspeed. By simplifying the expected running conditions, it was of information. An example of the file naming convention is:possible to remove several time consuming file system checks "X_005038.dat", where 'X' is the unique device identifier,and safeguards. These checks are necessary for ensuring that and '005038' is a unique recording serial number that isthe file system is always updated, and that other files on the incremented every time a new recording file is created. TheSD card are preserved. With these safeguards in place, the file serial number is stored in EEPROM to maintain the datahighest consistent writing speed was 4 kB/s. After removing after power is disconnected. We envision each device wouldthe safeguards, write speeds between 17 and 22 kB/s are be labeled with a letter corresponding to the device identifiertypical. The library was also modified to use four write buffers in the file name. This would allow easy tracking based on theto allow for potential temporary slowdowns encountered while recording device for statistical purposes. After the file name iswriting data to the SD card. generated, interrupts are allowed, and the main program loop

is activated. This loop writes buffers to the SD card as soon asthe buffers are full, and maintains correct write order of thebuffers.

Samples from the accelerometer are taken every 125 jis, orat a rate of 8000 samples per second. The sampling routine isrun from an interrupt that is generated from a hardware timeroverflow. Using an interrupt to initiate recording from the

2analog to digital converter allows the lengthy write routine toprocess in the background without missing any samples. Theminimum amount that can be written to a SD card at a time is512 bytes. Data is buffered in 512-byte sectors for directwriting to the SD card. Four buffers are allocated in memory,allowing for a temporary interruption lasting up to 0.25seconds. This level of buffering was found to be necessary tomaintain certain levels of file system integrity. The current SD

Fig. 1 - Cough recording device cards are 512 megabyte units, which are able to hold over 17hours of recorded data.

The power for the device is controlled by a switch builtinto the SD card socket. When no SD card is present, power is Power On Timer 0removed from the circuit. This prevents inadvertent power Interruptdissipation while the device is not in use, and also ensures that Initialize SD Card Everyl25ga SD card is always connected during operation. Power issupplied by two 3.6V Lithium batteries, size 12 AA. These Read A/D Vluebatteries are currently estimated to give a battery life between Format SD Card17 and 24 hours, depending on the model of the battery and Shift and Truncatethe model of the SD card. Three light emitting diodes are C Recordingvisible outside the case, which are used to provide status File Strotdufeindication to the user. Stbte to Bufer

MEMS Low PassAccelromtrete Filter

Buffer Full? No Button PressInterru t

SecureDigital Pc YesSIcUeDigital 18F6722Memory Card 40 MHz Update file systemWrite Next Sector Table of Contents

Fig. 2 - Hardware Block DiagramHalt Operation

The PIC microcontroller uses an on-chip programmemory, which starts the execution of the firmware, as shown Fig. 3 - Firmware operationin Fig. 3, upon the insertion of a SD card. When a SD card isinserted into the socket, the microcontroller powers on and itAfter th recordin s onais om the user is

' 1~~~~~~~~~~nstructedto press the button located on the circuit board. Thereformats the SD card. This ensures that the file system is not butniaceslefo thexrorftecsevaaoefragmeted adthatthe mximumamountof spce is above the button in the plastic shell. This prevents accidental

available. After formatting the SD card, the device generates prsigo. h butn whc wo ld rmtrl n hthe file name for the current recording session. The device reorin. Afe th buto ispesd h abeo otnso

1-4244-1280-3/07/$25.00 ©2007 IEEE 2007 IEEE Region 5 Technical Conference, April 20-21, Fayetteville, AR

Page 3: [IEEE 2007 IEEE Region 5 Technical Conference - Fayetteville, AR, USA (2007.04.20-2007.04.22)] 2007 IEEE Region 5 Technical Conference - A Compact, Self-Contained Cough Monitoring

169

the file system is updated to reflect the current file size. The from the silence. Key features include a sustained envelope ofsystem is then suspended, and the SD card is safe to remove. the signal, with a gradual tapering of the envelope.If the SD card is removed before the button is pressed, thedata file will have a length of zero, and recovery of the datawill be difficult.

One requirement of this device is that the data recordedshould be easily accessible by a personal computer after therecording session is finished. Thus, an implementation of theFAT16 file system was chosen for simplicity. After a file iscreated on a FAT16 file system, data is written in 512 byte

. , @ Chl ~~~~~ ~~~~~~~~~~~~~~200mv M 100ms A Ch f 000 Nj2sectors, and 16 consecutive sectors make up a cluster. The 26)vnumber of sectors in a cluster is determined by the size of theSD card. In a 512 megabyte card, 16 sectors are in one cluster, Fig. 5. Clearing ofthroatwhile on a 1 gigabyte card 32 sectors are in one cluster. Eachcluster on the SD card must be accounted for in the cluster Fig. 6 shows a typical cough waveform. As the coughtable of the FAT16 file system. The cluster table maintains a begins, the envelope rapidly increases, followed by a decreaselinked list of clusters for every file, and also keeps track of in energy. A second peak follows. Coughs consist of two orunused clusters. The exact file size is stored in the Table of more surges, and have rapid rise times on the initial surge.Contents of the file system. This is the value that Microsoft These two indicators assist the automated software in

Windows uses to determine the file size to display. If the detecting coughs.cluster table and Table of Contents are not in agreement, the Te Roll

file will be corrupted. To date, we have been unsuccessful inperforming updates to both the Table of Contents and thecluster table in real-time recording conditions. Thecompromise employed maintains the cluster table in real time,and updates the Table of Contents of the file system after therecording is finished. Only one brand of SD card has beensuccessfully tested so far. M lounisAClIl f 0.00

III. ANALYSIS OF OUTPUT WAVEFORMSFig. 6. Cough

Previous work by Jewell [5] indicated that coughing isdistinct from other signals recorded in this manner. To IV. CONCLUSIONdemonstrate that the input signals are distinct, three The developed self-contained cough monitoring devicewaveforms are given for three separate actions. The actions provides doctors and health care experts with a completeperformed include speaking, clearing the throat, and coughing. X . .' ' ~~~~~~~coughrecording solution that has both convenience andThe following pictures show the analog waveform from the security. The research presented successfully completed theaccelerometer using an oscilloscope, transition between different microcontroller families and

When the accelerometer is attached to the suprasternal digital storage mediums. However, limitations are still presentnotch, vibrations from speech are minimized. The low-pass with the current cough monitor device.filter network also removes many components of voice, The device correctly filters and samples the accelerometerresulting in a signal resembling noise such as Fig. 4. This is values. However, recording data has proven to be difficultneeded to protect the privacy rights of the subject and no with the SD technology. Writing non-sequential sectors, suchspeech iS recognizable from the recorded data. as the file system cluster table and the Table of Contents have

TekR caused tremendous slowdowns. This results in gaps in therecorded signal, which is generally unacceptable. Buffering isused to attempt to compensate for unexpected delays whileupdating the cluster table. This requires the user to press a

*IIWli,,.lil. button before removing the SD card, and unexpected removalof the SD card leads to data loss.

Other problems come from limited storage space.| . . 0 M 10mns A Chl w J0sv.0 VAlthough currently not a problem, the size of the memory card

limits the maximum recording time. One possible solution is aFig. 4. Speech compression technique called run length encoding (RLE). This

compression technique takes advantage of fairly constant dataFig. 5 shows a typical envelope for clearing the throat. when the accelerometer is not moving. This will increase the

This action is easily distinguishable on the oscilloscope trace time between sector writes, which results in lower power

1-4244-1280-3/07/$25.00 ©2007 IEEE 2007 IEEE Region 5 Technical Conference, April 20-21, Fayetteville, AR

Page 4: [IEEE 2007 IEEE Region 5 Technical Conference - Fayetteville, AR, USA (2007.04.20-2007.04.22)] 2007 IEEE Region 5 Technical Conference - A Compact, Self-Contained Cough Monitoring

170

consumption and the possibility of automated file systemupdating. Since the device is battery operated, powerconsumption is a major concern. The operating frequency ofthe microcontroller can be reduced, offering lower supplyvoltages, and less power consumption. Reducing the numberof reading and writing operations will also save considerableamounts of power. Furthermore, the device does not workwith different varieties of SD cards. Further research anddevelopment will overcome these limitations.

Although not perfect, the research presented successfullyimproves the cough monitoring system developed by Jewell[5] by producing a small device suitable forcommercialization.

ACKNOWLEDGMENT

We would like to thank Dr. Ian Paul, MD (HersheyMedical Center, PA) for his support throughout the project.Helpful discussions with Steven Jewell are alsoacknowledged.

REFERENCES

[1] Parvez L, Vaidya M, Sakhardande A, Subburaj S, Rajagopalan T G,"Evaluation of Antitussive Agents in Man," Pulmonary Pharmacology,vol. 9, pp. 299-308, 1996.

[2] Hsu J.Y., R.A. Stone, R.B. Logan-Sinclair, M. Worsdell, C.M. Busst,K.F. Chung, "Coughing frequency in patients with persistent cough:assessment using a 24 hour ambulatory recorder," European RespiratoryJournal, vol. 7, pp. 1246-1253, 1994.

[3] Jaeger R J, Szidon J P, Doucette P J, "Instrumentation for MeasuringFrequency of Cough," Engineering in Medicine and Biology Society,IEEE 17th Annual Conference, vol. 2, pp. 1645-1646, 1995.

[4] Subburaj S, Parvez L, Rajagopalan T G, "Methods of Recording andAnalysing Cough Sounds," Pulmonary Pharmacology, vol. 9, pp. 269-279, 1996.

[5] S. Jewell, "Development of a Self-Contained Ambulatory CoughMonitoring System," M.S. thesis, The Pennsylvania State University,University Park, PA, United States, 2004.

[6] Paul I.M, Wai K, Jewell S.J, Shaffer M.L, Varadan V.V, "Evaluation ofa new self-contained, ambulatory, objective cough monitor," Cough,vol. 2, pp. 2-7, September 2006.

1-4244-1280-3/07/$25.00 ©2007 IEEE 2007 IEEE Region 5 Technical Conference, April 20-21, Fayetteville, AR