资源简介
MIT-BIH Arrhythmia Database 原始数据读取 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\新学期项目及论文\心电图项目\数据集\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
- 上一篇:自适应信号处理(.rtf
- 下一篇:MIMO-OFDM不同信道估计的对比
相关资源
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
评论
共有 条评论