资源简介
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不同信道估计的对比
相关资源
- 自适应信号处理(.rtf
- KALMAN自适应滤波进行参数估计
- LMMSE估计在信道均衡中的应用,matla
- 基于DWT和SVD结合的水印嵌入MATLAB代码
- MATLAB环境下QPSK信号AWGN信道误码率仿真
- 带有MPPT功能的光伏阵列Matlab通用仿真
- matlab 处理 grid 数据matlab用于气象
- 神经网络 反向传播 matlab源代码 设计
- libsvm-mat-2.83-1
- matlab2weka matlab中使用weka包
- gabor滤波的matlab实现
- 单尺度Retinex算法实现
- Labview调用Matlab简单例程(用MATLAB sc
- Matlab三点求圆
- 二进制对称信道互信息
- 仿真mimo的matlab代码
- NBI消除窄带干扰消除
- matlab中画箭头的函数
- 矩阵实验室Matlab最新版r2009b破解激活
- 用matlab实现lz编码的源程序
- 用matlab实现huffman编码的m文件
-
matlab pid fuzzy simuli
nk - 基于空间矢量控制的matlab模型
- 刘金琨机器人控制系统的设计与Matl
- 材料力学中的挠曲线绘图MATLAB程序
- 基于小波的神经网络matlab代码
- 利用MATLAB对图像进行DCT变换的代码
- 迭代学习,matlab仿真源码,实用
- arma matlab 代码
- 170421NMS算法matlab程序
评论
共有 条评论