MATLAB: How to read file ‘04015.dat’,’04015.atr’ and ‘04015.qrs’ of MIT BIH AF Database(PHYSIONET)

ecgmit-bihphysionetreaddata

By using the rddta.m file i can read the ecg signal from mit bih arrhythmia database.But in mit bih AF data base there are two ecg signals in a single dat file.but i badly need to read data from those files.So can any one please give me a code or suggest me how can i modify the rddta.m to read data from mit bih AF database.

Best Answer

It took me a bit to figure this out, because I don’t use Physionet that frequently. I successfully downloaded that file and related files a few minutes ago.
This is what you need to do:
  1. Go to: http://www.physionet.org/cgi-bin/atm/ATM;
  2. Select the database and record as shown in the screencap (the Annotations and the rest are my choice, change them to meet your requirements) but be sure to select ‘Export signals as .mat’, (the rest proceeds automatically);
  3. Scroll down and right-click on each of the three files it creates in turn ( 04015m.mat, 04015m.info, and 04015m.hea ) and save them to the appropriate directory in your MATLAB path (assumes Windows, if you have another OS do what it requires to save them).
  4. I was then able to load both signals with this code (change the variable names to your liking) and then plotted them to be sure they imported correctly:
EKG04015 = load('04015m.mat');
EKG_1 = EKG04015.val(1,:);
EKG_2 = EKG04015.val(2,:);
The Physionet screencap:
Do that, and you should be good to go!
The .mat-file is 3.1 MB or I’d upload it and the others here to save you the bother.