Skip to main content

A Simple Example ECG Signal in Matlab

Before attempting any signal processing of the electrocardiogram it is important to first understand the physiological basis of the ECG, to review measurement conventions of the standard ECG, and to review how a clinician uses the ECG for patient care.

The Physical Basis of Electrocardiography
As a result of the electrical activity of the cells, current flows within the body and potential differences are established on the surface of the skin, which can be measured using suitable equipment. The graphical recording of these body surface potentials as a function of time produces the electrocardiogram. The simplest mathematical model for relating the cardiac generator to the body surface potentials is the single dipole model.
ECG Signal

A Simple Example

clear all, clc
sig = load('ecg.txt'); % load the ECG signal
plot(sig); % plot 
xlabel('Samples'); 
ylabel('Electrical Activity');
title('ECG Singnal Sampled at 100Hz');

Output

ECG Signal

Zoom in the figure to see ECG signal
Zoom in ECG Signal



hold on
plot(sig,'ro');
Signed ECG Signal

Zoom in Signed ECG Signal

Comments

Popular posts from this blog

Use offline WFDB Toolbox for MATLAB

The WFDB Toolbox for MATLAB and Octave is a collection of functions for reading, writing, and processing physiologic signals and time series in the formats used by PhysioBank databases (among others). The Toolbox is compatible with 64-bit MATLAB and GNU Octave on GNU/Linux, Mac OS X, and MS-Windows. To quick start to use offline WFDB Toolbox for Matlab http://physionet.org/physiotools/matlab/wfdb-app-matlab/wfdb-app-toolbox-0-9-6-1.zip  download this file.  Unzip file where you want. When unzip the file, mcode folder will create.  Open MATLAB.  Go where you unzip the file.  Write command line addpath(pwd) Finally write command line again savepath  You can use WFDB Toolbox offline anymore.  [tm,sig]=rdsamp('mitdb/100',1); plot(tm,sig);

ImageDatastore

ImageDatastore is a useful function and can get a collection of image files, where each individual image fits in memory, but the entire collection of images does not necessarily fit.