MATLAB GUI Application for ECG Data Acquisition via Serial Port

Resource Overview

MATLAB-based GUI application for real-time ECG signal acquisition and analysis through serial port communication

Detailed Documentation

This documentation presents a MATLAB GUI application designed for electrocardiogram (ECG) data acquisition through serial port communication. The application enables real-time ECG signal capture and analysis using MATLAB's Instrument Control Toolbox. Users begin by connecting their ECG monitoring device to the computer's serial port interface. The GUI implements serial port configuration through MATLAB's serial object creation (using functions like serialport or legacy serial) with parameters such as baud rate, data bits, and parity settings programmable via dropdown menus. Upon launching the application, users select the appropriate COM port from a configured list, after which the application establishes communication using fopen() and initiates continuous data streaming. The ECG signals are displayed in real-time on a dynamically updating axes component, with the plot refresh rate controlled by a timer object executing at the specified sampling frequency. The interface includes interactive controls for adjusting acquisition parameters: sampling rate (typically 250-1000 Hz for ECG applications) and time window length (configurable via slider input affecting the x-axis limits). Signal processing capabilities are integrated using MATLAB's DSP functions, including: - Digital filtering (low-pass, high-pass, and notch filters) implemented with filter() or designfilt functions to remove noise and baseline wander - Feature extraction algorithms utilizing findpeaks() for R-wave detection and custom functions for calculating heart rate variability The application architecture employs callback functions for handling user interactions with buttons and sliders, while maintaining data integrity through circular buffering for continuous data acquisition. This GUI provides researchers and medical professionals with an intuitive tool for ECG data collection and preliminary analysis, combining hardware interfacing with MATLAB's computational capabilities for biomedical signal processing.