I am working on ECG signal processing using neural network which involves pattern recognition. As I need to collect all the data from Matlab to use it as test signal, I am finding it difficult to load it on to the Matlab. I am using MIT Arrhythmia database here.
The signal needs to be indexed and stored as data structure in Matlab compatible format.
Presently, the signal is in .atr
and .dat
format.
How can you load MIT-BIH Arrhythmia database onto Matlab?
You can use physionet ATM to get .mat files which are easier to work with.
In the input part select the desired leads, length, database and sample.
In the toolbox select export as .mat
:
Then download the '.mat' file,
In order to open the file in MATLAB, here is a sample code:
load ('100m.mat') % the signal will be loaded to "val" matrix
val = (val - 1024)/200; % you have to remove "base" and "gain"
ECGsignal = val(1,1:1000); % select the lead (Lead I)
Fs = 360; % sampling frequecy
t = (0:length(ECGsignal)-1)/Fs; % time
plot(t,ECGsignal)
and you will get,
However, If you were to read annotation files for arrhythmia or QRS complexes that would be another problem.
Edit
The base and gain come from the info file (second picture). This file gives you various information regarding the ECG signal.
In the last sentence it says: To convert from raw units to the physical units shown above, subtract 'base' and divide by 'gain'.