資源簡介
MIT-BIH Arrhythmia Database 原始數(shù)據(jù)讀取 matlab程序
代碼片段和文件信息
%?This?programm?reads?ECG?data?which?are?saved?in?format?212.
%?(e.g.?100.dat?from?MIT-BIH-DB?cu01.dat?from?CU-DB...)
%?The?data?are?displayed?in?a?figure?together?with?the?annotations.
%?The?annotations?are?saved?in?the?vector?ANNOT?the?corresponding
%?times?(in?seconds)?are?saved?in?the?vector?ATRTIME.
%?The?annotations?are?saved?as?numbers?the?meaning?of?the?numbers?can
%?be?found?in?the?codetable?“ecgcodes.h“?available?at?www.physionet.org.
%
%?ANNOT?only?contains?the?most?important?information?which?is?displayed
%?with?the?program?rdann?(available?on?www.physionet.org)?in?the?3rd?row.
%?The?4th?to?6th?row?are?not?saved?in?ANNOT.
%
%
%??????created?on?Feb.?27?2003?by
%??????Robert?Tratnig?(Vorarlberg?University?of?Applied?Sciences)
%??????(email:?rtratnig@gmx.at)
%
%??????algorithm?is?based?on?a?program?written?by
%??????Klaus?Rheinberger?(University?of?Innsbruck)
%??????(email:?klaus.rheinberger@uibk.ac.at)
%
%?-------------------------------------------------------------------------
function?[signalh]=load_data(FILE_NO)
%------?SPECIFY?DATA?------------------------------------------------------
PATH=?‘D:\aa_work\新學(xué)期項目及論文\心電圖項目\數(shù)據(jù)集\MIT-BIH?Arrhythmia?Database\test‘;?%?path?where?data?are?saved
HEADERFILE=strcat(?FILE_NO‘.hea‘);??????%?header-file?in?text?format
ATRFILE=strcat(?FILE_NO?‘.atr‘);?????????%?attributes-file?in?binary?format
DATAFILE=strcat(?FILE_NO‘.dat‘);?????????%?data-file
SAMPLES2READ=648000;?????????%?number?of?samples?to?be?read
????????????????????????????%?in?case?of?more?than?one?signal:
????????????????????????????%?2*SAMPLES2READ?samples?are?read
%------?LOAD?HEADER?DATA?--------------------------------------------------
fprintf(1‘\\n$>?WORKING?ON?%s?...\n‘?HEADERFILE);
signalh=?fullfile(PATH?HEADERFILE);
fid1=fopen(signalh‘r‘);
z=?fgetl(fid1);
A=?sscanf(z?‘%*s?%d?%d?%d‘[13]);
nosig=?A(1);??%?number?of?signals
sfreq=A(2);???%?sample?rate?of?data
clear?A;
for?k=1:nosig
????z=?fgetl(fid1);
????A=?sscanf(z?‘%*s?%d?%d?%d?%d?%d‘[15]);
????dformat(k)=?A(1);???????????%?format;?here?only?212?is?allowed
????gain(k)=?A(2);??????????????%?number?of?integers?per?mV
????bitres(k)=?A(3);????????????%?bitresolution
????zerovalue(k)=?A(4);?????????%?integer?value?of?ECG?zero?point
????firstvalue(k)=?A(5);????????%?first?integer?value?of?signal?(to?test?for?errors)
end;
fclose(fid1);
clear?A;
%------?LOAD?BINARY?DATA?--------------------------------------------------
if?dformat~=?[212212]?error(‘this?script?does?not?apply?binary?formats?different?to?212.‘);?end;
signald=?fullfile(PATH?DATAFILE);????????????%?data?in?format?212
fid2=fopen(signald‘r‘);
A=?fread(fid2?[3?SAMPLES2READ]?‘uint8‘)‘;??%?matrix?with?3?rows?each?8?bits?long?=?2*12bit
fclose(fid2);
M2H=?bitshift(A(:2)?-4);
M1H=?bitand
- 上一篇:自適應(yīng)信號處理(.rtf
- 下一篇:MIMO-OFDM不同信道估計的對比
評論
共有 條評論