资源简介
使用CNN模型实现实现MIT-BIH的数据库分析,读取数据库数据,进行相关模型训练和测试
代码片段和文件信息
function [data_x target_y] = initInput()
% This script extracts training data from the MIT-BIH Arrythmia Database
%
% Output values returned are:
% data_x: 4-D double containing the input data in the following form
% [128 1 1 numberOfReadings]
% target_y: 1-D Categorial containing the signal labels
% [numberOfReadings 1]
%
% Author: 06/15/17 - by Arshan Hashemi
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
num = 1;
fs = 360; % sample rate for MIT-BIH Arrhytmia Database
samples = 646400; % samples for 30 minutes
% Training files to split data by recording (Test 3)
training_files = {‘mitdb/100‘ ‘mitdb/232‘‘mitdb/109‘ ‘mitdb/106‘...
‘mitdb/102‘ ‘mitdb/118‘ ‘mitdb/207‘‘mitdb/231‘ ‘mitdb/103‘...
‘mitdb/208‘ ‘mitdb/118‘ ‘mitdb/214‘ ‘mitdb/104‘ ‘mitdb/201‘...
‘mitdb/203‘ ‘mitdb/116‘ ‘mitdb/215‘};
% Training files to split data by time or random(Test 1 and 2)
%training_files = {‘mitdb/100‘ ‘mitdb/232‘‘mitdb/109‘ ‘mitdb/106‘...
% ‘mitdb/102‘ ‘mitdb/118‘ ‘mitdb/207‘‘mitdb/231‘ ‘mitdb/103‘...
% ‘mitdb/208‘ ‘mitdb/112‘ ‘mitdb/214‘ ‘mitdb/104‘ ‘mitdb/201‘...
% ‘mitdb/203‘ ‘mitdb/116‘ ‘mitdb/215‘‘mitdb/101‘ ‘mitdb/107‘...
%‘mitdb/111‘ ‘mitdb/119‘ ‘mitdb/200‘ ‘mitdb/209‘ ‘mitdb/222‘...
% ‘mitdb/212‘ ‘mitdb/217‘‘mitdb/124‘ ‘mitdb/115‘ ‘mitdb/213‘...
% ‘mitdb/222‘ ‘mitdb/209‘ ‘mitdb/234‘ ‘mitdb/221‘ ‘mitdb/223‘...
% ‘mitdb/209‘ ‘mitdb/114‘ ‘mitdb/108‘ ‘mitdb/121‘ ‘mitdb/123‘...
% ‘mitdb/231‘ ‘mitdb/233‘};
j = 1;
% Preallocate
data = zeros(500 128);
target(500) = char(0);
for f = 1 : length(training_files)
filename = char(training_files(f))
[tm signal]=rdsamp(filename 1 samples);
signal = signal(:1);
[anntype~~]=rdann(filename‘atr‘[]samples);
for k = 1 : size(ann1)
if ann(k) <= samples
stop = k;
end
end
ann = ann(1 : stop);
type = type(1 : stop);
start = 1;
if (ann(1) < 64)
start = 4;
end
%stop = stop - 5;
stop = ceil(stop/6);
% 6 Types of beats: Normal Paced Left BBB PVC APC RIGHT BBB
% N / L V A R
k = start;
%for k = start : stop
while k < stop
if type(k) == ‘N‘ || type(k) == ‘/‘ || type(k) == ‘L‘ ||...
type(k) == ‘V‘ || type(k) == ‘A‘ || type(k) == ‘R‘
for i = 1 : 128
data(ji) = signal(ann(k) - 63 + i);
end
data_x(:11j) = data(j :);
target(j) = type(k);
j = j + 1;
end
%increment k an extra time
k = k + 1;
end
end
target_y = categorical(cellstr(target‘));
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-10-10 00:25 CNN-arrhythmia-dection-master\
文件 247 2017-10-10 00:25 CNN-arrhythmia-dection-master\README.md
文件 2578 2017-10-10 00:25 CNN-arrhythmia-dection-master\initInput.m
文件 1692 2017-10-10 00:25 CNN-arrhythmia-dection-master\initPatientSpecTest.m
文件 3324 2017-10-10 00:25 CNN-arrhythmia-dection-master\initPatientSpecific.m
文件 2419 2017-10-10 00:25 CNN-arrhythmia-dection-master\initTest.m
文件 1085 2017-10-10 00:25 CNN-arrhythmia-dection-master\launchNetwork.m
文件 652 2017-10-10 00:25 CNN-arrhythmia-dection-master\testNetwork.m
- 上一篇:TracePro典型-杂散光分析
- 下一篇:51单片机音调发生器程序
相关资源
- 同步发电机励磁系统的建模与控制-同
- 多级脉冲序列控制Boost变换器-多级脉
- 现代信号谱分析源代码
- 慢特征分析算法
- 自适应波束形成的经典算法大全
- 语音信号处理 预加重分帧加窗 端点检
- 时间序列的分析——模型的识别与预
- 电力系统课程设计
- 物体的运动轨迹预测扩展卡尔曼滤波
- 粒子群与遗传混合算法优化
- 各种聚类程序,包括生成聚类树、k
- ORL人脸库的PCA人脸识别,GUI界面
- RBF神经网络对iris分类
- UKF与EKF算法应用比较
- 动态矩阵控制算法dmc
- 演化博弈仿真
- BP神经网络的非线性系统建模
- 时域特征的求取,例如峭度、裕度等
- PCA降维,有详细的注释,你值得拥有
- 数值分析实验报告-数值分析实验报告
- ROSL低秩分解算法,用于图像分析.ra
- 影像组学工具包
- 数学建模作业论文——有两种外形相
- 随机信号分析实验
- 混沌粒子群算法
- 图像数字图像课程设计--数字水印设计
- 这里实现了四种SVM工具箱的分类与回
- 最小二乘法模型辨识算法
- 经典功率谱估计与现代功率谱估计的
- 输入电压前馈Buck变换器的研究-输入电
评论
共有 条评论