real-time electrocardiogram may 2 1...
TRANSCRIPT
Real-time Electrocardiogram Monitoring
By: Nicholas Clark, Edward Sandor, and Calvin WaldenAdvised By: Drs. Yufeng Lu and In Soo Ahn
May 2nd, 2017
1
Presentation Outline
1. Motivation2. Previous Work3. Objectives and Constraints4. System Design and Implementation5. Results and Discussion6. Project Management7. Conclusion and Future Work8. References
2
1 in 4deaths in the US stem from a form of heart
disease[1].
3
Motivation 4
25% of the USWill experience an arrhythmia over the age of 50[2]
Figure 1 - Visual representation of Americans affected by arrhythmia.
Motivation 5
Figure 2 - Percentage of annual diagnosis of the major arrhythmias[3].
● Arrhythmias are common heart conditions where the heart does not properly pump blood[4].
● An electrocardiogram (ECG) is used to identify arrhythmias by detecting the electrical signals of the heart[5].
● Holter monitor is the current standard of care, which is a portable ECG monitor that records patient heart data for later review by a physician.
6
Figure 3 - Example of a Holter monitor[6]
Motivation
● Holter monitors only record patient data, requiring a physician to review it for arrhythmias after it has been collected.
● There is currently no standard of care that notifies a doctor of arrhythmia in real-time.
● These monitors also cannot be controlled or configured remotely.
7Motivation
Figure 4 - Sample ECG with PVC[7]
PVC
Presentation Outline
1. Motivation2. Previous Work3. Objectives and Constraints4. System Design and Implementation5. Results and Discussion6. Project Management7. Conclusion and Future Work8. References
8
Previous Work
● Overview● Implementation● Results● Recommendations
9
Overview
Real-time Heart Monitoring and ECG Signal Processing[8]
● Completed by Bamarouf, Crandell, and Tsuyuki in Spring 2016.
● Looked into the identification of arrhythmias, specifically premature ventricular contraction (PVC).
● Aimed to improve upon the Holter monitor, a current standard of care.
● Implemented the Pan-Tompkins and Template Matching algorithms.
10
Implementation
● Designed software optimized for the TI CC3200 MCU.
● Transmitted Short Message Service (SMS) packets over WiFi.
11
Figure 5 - TI CC3200 IoT enabled MCU used in this project[9]
Results
● This project could process benchmark ECG data from the MIT-BIH database and identify instances of PVC in real-time.
● The system successfully transmitted plots of detected PVC via SMS.
12
Results (cont’d) 13
Table 1 - Performance of algorithms with sample data
Figure 6 - Plot of PVC transmitted via SMS.
Recommendations
● Interface the system with ECG electrodes to acquire real patient data.
● Improve the signal processing algorithms used in the system.
14
Presentation Outline
1. Motivation2. Previous Work3. Objectives and Constraints4. System Design and Implementation5. Results and Discussion6. Project Management7. Conclusion and Future Work8. References
15
Objectives and Constraints
● Develop a portable, mobile device with ECG sensors.
● Implement an embedded system with ECG algorithms to monitor ECG signals in real-time.
● Wirelessly notify a wearer’s doctor of PVC.
16
Constraints: portable, ergonomic design; limited device memory; WiFi connectivity;
battery life.
Presentation Outline
1. Motivation2. Previous Work3. Objectives and Constraints4. System Design and Implementation5. Results and Discussion6. Project Management7. Conclusion and Future Work8. References
17
System Design and Implementation
● System Design● Digital Signal Processor● Arrhythmia Detection Algorithms● ECG Electrodes and Pre-filter Board● Embedded Computer● User Interface● Printed Circuit Board
18
System Design 19
Figure 7 - System Block Diagram
System Design 20
Figure 7 - System Block Diagram
System Design 21
Figure 7 - System Block Diagram
System Design 22
Figure 7 - System Block Diagram
System Design 23
Figure 7 - System Block Diagram
System Design
● Digital Signal Processor○ Acquire ECG signal○ Perform arrhythmia detection algorithm
● System Controller○ Manage user interface○ Log data○ Distribute power
● Electrodes and ECG Prefilter● User Interface● Printed Circuit Board
○ Interface subsystems
24
Figure 8 - Real-Time ECG System
System Design 25
Figure 9 - Real-Time ECG System
LCD and Push Buttons ECG Pre-filter Board ECG Electrodes
DSP
System ControllerInterfacing
PCB
Power Supply
Digital Signal Processor
● TI TMS320C5515 eZdsp○ TI low-power DSP family○ 120 MHz fixed-point DSP○ 64 KB of DARAM○ 256 KB of SARAM○ 128 KB of ROM
● Perform Arrhythmia Detection Algorithm● Acquire ECG Signal
○ 10-bit Analog Digital Converter (ADC)○ Sampling rate: 360 sample/s
● Communicate with System Controller○ Via Universal Asynchronous
Receiver/Transmitter (UART) with baud rate of 57600
26
Figure 10 - TMS320C5515 eZdsp
Digital Signal Processor 27
Figure 11 - Flowchart of DSP main loop
Digital Signal Processor 28
Figure 12 - Flowchart of acquisition timer interrupt
Digital Signal Processor 29
Figure 13 - Flowchart of ADC conversion complete interrupt
Digital Signal Processor 30
Figure 14 - Flowchart of UART data received interrupt
Arrhythmia Detection Algorithm
● Two-Stage Algorithm○ Pan-Tompkins algorithm
■ Identify individual heart beats○ Template-matching algorithm
■ Correlate sample heartbeat with healthy heartbeat template to identify arrhythmia
● Integration of Algorithm Code○ Originally written by previous group○ Extracted algorithm to be standalone○ Modified to be platform independent
■ Code can be compiled for DSP or for MATLAB file for validation○ Reduce extraneous buffers to improve memory usage
31
Pan-Tompkins Algorithm 32
Figure 15 - Flowchart of Pan-Tompkins algorithm
Band Pass Filter: 5-11 Hz
Template Matching Algorithm 33
Figure 16 - Flowchart of template matching algorithm
Electrodes and ECG Pre-filter Board
● 3-Lead ECG● AD8232-based breakout
board● High-pass and low-pass
filters with adjustable cutoffs
● Instrument amplifier
34
Figure 17 - Pre-filter board and ECG electrodes
Electrodes and ECG Pre-filter Board
Electrode Placement
35
Figure 18 - Reference diagram for electrode placement[10]
Figure 19 - ECG setup used for system development, with 3 leads
System Controller
Raspberry Pi 3 Model B
● Linux-based Raspbian 8● CPU: 1.2GHz Quad-Core ARM Cortex● RAM: 1GB LPDDR2● SD Card Slot● 27 digital GPIO pins, including UART and I2C● 10/100 BaseT Ethernet● 802.11 b/g/n WLAN
36
System Controller
Acquisition Daemon
● Receives processed or raw ECG data over serial port● Logs data into files on SD card● Signals Communication Daemon if arrhythmia was detected by DSP
37
System Controller
Acquisition Daemon
38
Figure 20 - Flowchart of acquisition daemon
System Controller
Acquisition Daemon
39
Figure 20 - Flowchart of acquisition daemon
System Controller
Acquisition Daemon
40
Figure 20 - Flowchart of acquisition daemon
System Controller
Acquisition Daemon
41
Figure 20 - Flowchart of acquisition daemon
System Controller
Acquisition Daemon
42
Figure 20 - Flowchart of acquisition daemon
System Controller
Communication Daemon
● Uses GMail account to send messages● Startup notification message with system information● Optional ECG report messages sent periodically● Urgent ECG report message sent when signalled by Acquisition
Daemon
43
System Controller
Communication Daemon
44
Figure 21 - Flowchart of communication daemon
System Controller
Communication Daemon
45
Figure 21 - Flowchart of communication daemon
System Controller
Communication Daemon
46
Figure 21 - Flowchart of communication daemon
System Controller
Communication Daemon
47
Figure 21 - Flowchart of communication daemon
System Controller
Software Design
● Software written in C● Developed packet-based serial communication protocol● libconfig - common configuration file parsing● wiringPi - direct control of GPIO pins● gnuplot - generate plots of ECG data for email
48
User Interface
● Adafruit 16x2 LCD with Keypad○ 16x2 character LCD○ HD44780 LCD Controller○ 5 pushbutton inputs○ MCP23017 I2C I/O Expander
● Lighttpd Web Server○ Light-weight web server on system controller○ Serves PHP5 web pages for user control,
configuration, and information
49
Figure 22 - 16x2 LCD with keypad.
User Interface 50
Figure 23 - Flowchart for LCD process
User Interface
Software Design
● LCD software written in C● Lighttpd web interface written in HTML, PHP5, and CSS● Server and LCD process use named pipes to communicate LCD
configuration options.● LCD process communicates with the LCD controller via I2C through
the GPIO pins.
51
Printed Circuit Board
● Interface between prefilter board, DSP, and Raspberry Pi 3● Raspberry Pi "Hat" formfactor● Additional debug and test points for future work
52
Figure 24 - Screenshot of PCB design Figure 25 - Schematic of interface circuit
Printed Circuit Board 53
Figure 26 - Left: Top of PCB. Right: Bottom of PCB.
Presentation Outline
1. Motivation2. Previous Work3. Objectives and Constraints4. System Design and Implementation5. Results and Discussion6. Project Management7. Conclusion and Future Work8. References
54
Results and Discussion
Digital Signal Processor
55
Figure 27 - DSP activity viewed on oscilloscope
Serial Communication120ms
Algorithm Execution21ms
ECG Signal from Pre-filter Board
Results and Discussion
Digital Signal Processor Acquisition
56
Figure 28 - ECG signal acquired by DSP
Results and Discussion
Arrhythmia Detection Algorithm
57
Figure 29 - Band-pass (5-11 Hz) filtering of ECG signal performed by DSP
LPF: y(n) = 2y(n−1)−y(n−2)+x(n)−2x(n−6)+x(n−12)HPF: y(n) = y(n-1)−x(n)/32+x(n−16)−x(n−17)+x(n−32)/32
Results and Discussion
Arrhythmia Detection Algorithm
58
Figure 30 - QRS peak detection by Pan-Tompkins algorithm
Results and Discussion
Arrhythmia Detection Algorithm
59
Figure 31 - Template of QRS peak used by template matching algorithm
Results and Discussion
Arrhythmia Detection Algorithm
60
Figure 32 - RR interval template used by template matching algorithm
Results and Discussion
Arrhythmia Detection Algorithm Performance
61
Table 2 - Performance of algorithms with sample data
Results and Discussion
System Controller
62
Figure 33 - ECG report message sample
Results and Discussion
System Controller
● Load average: 0.30 to 0.50○ Quad-core system: Means running at 7.5% to 12.5% capacity○ Acquisition Daemon CPU usage: 5% to 9%○ Other software components negligible
● Memory usage: ~200MB used of 923 MB, 20% used
63
Results and Discussion
User Interface
● Displays menu items including:○ Project Title○ Patient Name○ Web Configuration Address○ LCD Color○ Power Options
● Buttons allow user to cycle through menu
64
Figure 34 - LCD display showing menu item
Results and Discussion 65
Figure 35 - Color menu option Figure 36 - Power menu option
Results and Discussion 66
Figure 37 - Web configuration page served using Lighttpd.
Results and Discussion
Power Consumption Testing
● Based on Discharge Time of Battery with 5V Regulated Output● Measured Battery Capacity Approximately 14.6 Wh
○ Timed discharge through 50 ohm power resistor for reference
● Battery Runs System for 8.7 hours ● Approximate Power Consumption is 1.7 W● Raspberry Pi 3 reported to use approximately 1.3W[11]
67
Presentation Outline
1. Motivation2. Previous Work3. Objectives and Constraints4. System Design and Implementation5. Results and Discussion6. Project Management7. Conclusion and Future Work8. References
68
Division of Labor
● DSP and algorithm evaluation (Ed)
● System Controller acquisition and communication software (Calvin)
● Printed circuit board design (Calvin)
● PCB review (Calvin, Ed, Nick)
● System Controller user interface software (Nick)
● Poster, presentation, and reports (Calvin, Ed, Nick)
● Documentation (Calvin, Ed)
● ECG electrode testing (Calvin, Ed)
69
*Bolded name denotes primary contributor.
Schedule 70
Week of Tasks
1/16/17 ● Implement initial Pan-Tompkins algorithm on choice platform● Begin interfacing board for embedded computer● Interface embedded computer with DSP
1/23/17 ● Refine Pan-Tompkins algorithm, add Template Matching algorithm● Trial wireless communication and SMS
1/30/17 ● Trial ECG data from MIT-BIH database● Refine wireless communication and SMS
2/6/17 ● Refine Pan-Tompkins and Template Matching algorithms● Trial ECG data from MIT-BIH database● Begin embedded computer serial communication
2/13/17 ● Begin real-time ECG testing● Add LCD and pushbutton interface to interfacing board● Begin UI development
2/20/17 ● Refine Pan-Tompkins and Template Matching algorithms● Continue real-time ECG testing● Continue UI development
2/27/17 ● Complete real-time ECG testing● Complete UI development
3/6/17 ● Progress Evaluation● Continue system testing and tuning
Spring Break ● Continue system testing and tuning
Week of Tasks
3/20/17 ● Complete all lab work● Continue written deliverables● Continue system testing and tuning
3/27/17 ● Continue written deliverables● Update Student Scholarship Expo poster● Continue system testing and tuning
4/3/17 ● Finalize final report draft● Continue system testing and tuning
4/10/17 ● Final Report Draft (4/10)● Finalize draft of presentation slides● Finalize Student Scholarship Expo poster (4/10)● Event: Student Scholarship Expo (4/11)● Oral Presentation Preparation (4/13)● Continue system testing and tuning
4/17/17 ● Complete all written deliverables● Oral Presentation Preparation (4/18)● Continue system testing and tuning
4/24/17 ● Event: Project demonstration● Event: Poster Presentation (4/28)● Complete all lab work
5/1/17 ● Event: Presentation of project (5/2)● Project Website Verification (5/2)● Complete all written deliverables
Presentation Outline
1. Motivation2. Previous Work3. Objectives and Constraints4. System Design and Implementation5. Results and Discussion6. Project Management7. Conclusion and Future Work8. References
71
Conclusions
● Project's goals were achieved:○ Develop a portable, mobile device with ECG sensors.○ Implement an embedded system with ECG algorithms to monitor ECG signals in
real-time.
○ Wirelessly notify a wearer’s doctor of PVC.
● Runs arrhythmia detection algorithm on data acquired from sensors in real-time
● Logs data and sends it to configured email addresses
72
Future Work
● Integrate more components onto PCB
● Reduce power consumption
● Implement the design utilizing only the Raspberry Pi 3 or comparable custom board
● Add new algorithm to detect additional types of arrhythmias
● Make transmission and storage of patient data secure
73
Presentation Outline
1. Motivation2. Previous Work3. Objectives and Constraints4. System Design and Implementation5. Results and Discussion6. Project Management7. Conclusion and Future Work8. References
74
References
[1] “Heart Disease Facts & Statistics | cdc.gov.” [Online]. Available: https://www.cdc.gov/heartdisease/facts.htm.[2] “Who Is at Risk for an Arrhythmia? - NHLBI, NIH.” [Online]. Available: https://www.nhlbi.nih.gov/health/health-topics/topics/arr/atrisk.[3] “About Arrhythmia.” [Online]. Available: http://www.heart.org/HEARTORG/Conditions/Arrhythmia/AboutArrhythmia/About-Arrhythmia_UCM_002010_Article.jsp.[4] M. AlGhatrif and J. Lindsay, “A brief review: history to understand fundamentals of electrocardiography,” J Community Hosp Intern Med Perspect, vol. 2, no. 1, Apr. 2012.[5] J. A. Z. Justo, R. A. G. Calleja, and A. M. Diosdado, “Acquisition software development for monitor Holter prototype signals and its use for pre-diagnosis of cardiac damage based on nonlinear dynamic techniques,” in AIP Conference Proceedings, 2016, vol. 1747, p. 90001.[6] “acardio20140402v0005.jpg.” [Online]. Available: https://api.kramesstaywell.com/Content/ebd5aa86-5c85-4a95-a92a-a524015ce556/medical-illustrations/Images/acardio20140402v0005.jpg.[7]“pvc_21349464440513.jpg (1425×537).” [Online]. Available: https://classconnection.s3.amazonaws.com/833/flashcards/1119833/jpg/pvc_21349464440513.jpg.[8] F. Bamarouf, C. Crandell, and S. Tsuyuki, “Real-time heart monitoring and ECG signal processing,” Bradley University, May 2016.[9] “ee0e66c4-ff50-42e2-85b5-cdf9f64d6208.jpg.” [Online]. Available: http://www.multivu.com/players/English/70647514-add-wi-fi-to-anything-with-ti-s-internet-on-a-chip-new-simplelink/gallery/image/ee0e66c4-ff50-42e2-85b5-cdf9f64d6208.jpg.[10] “tmp14285_thumb1.jpg (372×480).” [Online]. Available: http://what-when-how.com/wp-content/uploads/2012/04/tmp14285_thumb1.jpg.[11] "Power Consumption," Raspberry Pi Dramble, [Online]. Available: https://www.pidramble.com/wiki/benchmarks/power-consumption.
75
Real-time Electrocardiogram Monitoring
Questions?
76
Discussion Points 77
Section Subsection Pages
Motivation
Statistics 3, 4, 5
Background 6, 7
Previous Work
Overview 10
Implementation 11
Results 12, 13
Recommendations 14
Objectives and Constraints - 16
System Design and Implementation
System Design 19, 24, 25
Digital Signal Processor 26
Arrhythmia Algorithm 31
Electrodes and Prefilter 34
Section Subsection Pages
System Design and Implementation
System Controller 36
User Interface 42
Printed Circuit Board 45
Results and Discussion
Arrhythmia Detection 48
System Controller 55
User Interface 57
Project Management
Division of Labor 61
Schedule 62
Conclusions and Future Work Conclusions 64
Future Work 65