最新动态
【心电信号】基于matlab Simulink胎儿心电信号提取【含Matlab源码 1550期】
2024-12-21 16:31

⛳️座右铭:行百里者,半于九十。
更多Matlab信号处理仿真内容点击👇
①Matlab信号处理 (进阶版
②付费专栏Matlab信号处理(初级版

⛳️关注CSDN海神之光,更多资源等你来

0 引言
心电信号是人类最早研究的生物信号之一, 相比其他生物信号更易于检测, 且具有直观的规律。心电图的准确分析对心脏病的及早治疗有重大的意义。人体是一个复杂精密的系统, 有许多不可抗的外界因素, 得到纯净的心电信号非常困难。可以采用神经网络算法去除心电信号的噪声, 但这种方法存在训练难度大、耗时长的缺点。小波变换在处理非线性、非平稳且奇异点较多的信号时具有一定的优越性, 近年来许多学者使用其对心电信号进行研究。

%% Init
% clear all; close all;
Fs = 4e3;
Time = 40;
NumSamp = Time * Fs;
load Hd;

%% Mom’s Heartbeat
% In this example, we shall simulate the shapes of the electrocardiogram
% for both the mother and fetus. The following commands create an
% electrocardiogram signal that a mother’s heart might produce assuming
% a 4000 Hz sampling rate. The heart rate for this signal is approximately
% 89 beats per minute, and the peak voltage of the signal is 3.5 millivolts.
x1 = 3.5ecg(2700).'; % gen synth ECG signal
y1 = sgolayfilt(kron(ones(1,ceil(NumSamp/2700)+1),x1),0,21); % repeat for NumSamp length and smooth
n = 1:Time
Fs’;
del = round(2700*rand(1)); % pick a random offset
mhb = y1(n + del)'; %construct the ecg signal from some offset

axis([0 2 -4 4]);
grid;
xlabel(‘Time [sec]’);
ylabel(‘Voltage [mV]’);
title(‘Maternal Heartbeat Signal’);

%% Fetus Heartbeat
% The heart of a fetus beats noticeably faster than that of its mother,
% with rates ranging from 120 to 160 beats per minute. The amplitude of the
% fetal electrocardiogram is also much weaker than that of the maternal
% electrocardiogram. The following series of commands creates an electrocardiogram
% signal corresponding to a heart rate of 139 beats per minute and a peak voltage
% of 0.25 millivolts.
x2 = 0.25ecg(1725);
y2 = sgolayfilt(kron(ones(1,ceil(NumSamp/1725)+1),x2),0,17);
del = round(1725
rand(1));
fhb = y2(n + del)';
subplot(3,3,2); plot(t,fhb,‘m’);
axis([0 2 -0.5 0.5]);
grid;
xlabel(‘Time [sec]’);
ylabel(‘Voltage [mV]’);
title(‘Fetal Heartbeat Signal’);

%% The measured signal
% The measured fetal electrocardiogram signal from the abdomen of the mother is
% usually dominated by the maternal heartbeat signal that propagates from the
% chest cavity to the abdomen. We shall describe this propagation path as a linear
% FIR filter with 10 randomized coefficients. In addition, we shall add a small
% amount of uncorrelated Gaussian noise to simulate any broadband noise sources
% within the measurement. Can you determine the fetal heartbeat rate by looking
% at this measured signal?

%axis tight;
grid;
xlabel(‘Time [sec]’);

%% Measured Mom’s heartbeat
% The maternal electrocardiogram signal is obtained from the chest of the mother.
% The goal of the adaptive noise canceller in this task is to adaptively remove the
% maternal heartbeat signal from the fetal electrocardiogram signal. The canceller
% needs a reference signal generated from a maternal electrocardiogram to perform this
% task. Just like the fetal electrocardiogram signal, the maternal electrocardiogram
% signal will contain some additive broadband noise.
x = mhb + 0.02*randn(size(mhb));
subplot(3,3,4); plot(t,x);
axis([0 2 -4 4]);
grid;
xlabel(‘Time [sec]’);
ylabel(‘Voltage [mV]’);
title(‘Reference Signal’);

%% Applying the adaptive filter
% The adaptive noise canceller can use almost any adaptive procedure to perform its task.
% For simplicity, we shall use the least-mean-square (LMS) adaptive filter with 15
% coefficients and a step size of 0.00007. With these settings, the adaptive noise canceller
% converges reasonably well after a few seconds of adaptation–certainly a reasonable
% period to wait given this particular diagnostic application.

h = adaptfilt.lms(15, 0.001);
[y,e] = filter(h,x,d);

% [y,e] = FECG_detector(x,d);

%axis([0 7.0 -4 4]);
grid;
xlabel(‘Time [sec]’);
ylabel(‘Voltage [mV]’);
title(‘Convergence of Adaptive Noise Canceller’);
legend(‘Measured Signal’,‘Error Signal’);

%% Recovering the fetus’ hearbeat
% The output signal y(n) of the adaptive filter contains the estimated maternal
% heartbeat signal, which is not the ultimate signal of interest. What remains in the
% error signal e(n) after the system has converged is an estimate of the fetal heartbeat
% signal along with residual measurement noise.
subplot(3,3,6); plot(t,e,‘r’); hold on; plot(t,fhb,‘b’);
axis([Time-4 Time -0.5 0.5]);
grid on;
xlabel(‘Time [sec]’);
ylabel(‘Voltage [mV]’);
title(‘Steady-State Error Signal’);
legend(‘Calc Fetus’,‘Ref Fetus ECG’);

%% Counting the peaks to detect the heart rate
% The idea is to clean up the signal, and then set some dynamic threshold, so that any signal
% crossing the threshold is considered a peak. The peaks can be counted per time window.
%[num,den] = fir1(100,100/2000);
filt_e = filter(Hd,e);
subplot(3,3,7); plot(t,fhb,‘r’); hold on; plot(t,filt_e,‘b’);

xlabel(‘Time [sec]’);
ylabel(‘Voltage [mV]’);
title(‘Filtered signal’);
legend(‘Ref Fetus’,‘Filtered Fetus’);
thresh = 4*mean(abs(filt_e))*ones(size(filt_e));
peak_e = (filt_e >= thresh);
edge_e = (diff([0; peak_e]) >0);
subplot(3,3,8); plot(t,filt_e,‘c’); hold on; plot(t,thresh,‘r’); plot(t,peak_e,‘b’);
xlabel(‘Time [sec]’);
ylabel(‘Voltage [mV]’);
title(‘Peak detection’);
legend(‘Filtered fetus’,‘Dyna thresh’,‘Peak marker’, ‘Location’,‘SouthEast’);
axis([Time-4 Time -0.5 0.5]);
subplot(3,3,9); plot(t,filt_e,‘r’); hold on; plot(t,edge_e,‘b’); plot(0,0,‘w’);
fetus_calc = round((60/length(edge_e(16001:end))Fs) sum(edge_e(16001:end)));
fetus_bpm = [‘Fetus Heart Rate =’ mat2str(fetus_calc)];
xlabel(‘Time [sec]’);
ylabel(‘Voltage [mV]’);
title(‘Reconstructed fetus signal’);
legend(‘Fetus Sig’,‘Edge marker’,fetus_bpm, ‘Location’,‘SouthEast’);
axis([Time-4 Time -0.5 0.5]);

1 matlab版本
2014a

2 参考文献
[1]焦运良,邢计元,靳尧凯.基于小波变换的心电信号阈值去噪算法研究[J].信息技术与网络安全. 2019,38(05)

3 备注
简介此部分摘自互联网,仅供参考,若侵权,联系删除

🍅 仿真咨询
1 各类智能优化算法改进及应用

生产调度、经济调度、装配线调度、充电优化、车间调度、发车优化、水库调度、三维装箱、物流选址、货位优化、公交排班优化、充电桩布局优化、车间布局优化、集装箱船配载优化、水泵组合优化、解医疗资源分配优化、设施布局优化、可视域基站和无人机选址优化

2 机器学习和深度学习方面
卷积神经网络(CNN)、LSTM、支持向量机(SVM)、最小二乘支持向量机(LSSVM)、极限学习机(ELM)、核极限学习机(KELM)、BP、RBF、宽度学习、DBN、RF、RBF、DELM、XGBOOST、TCN实现风电预测、光伏预测、电池寿命预测、辐射源识别、交通流预测、负荷预测、股价预测、PM2.5浓度预测、电池健康状态预测、水体光学参数反演、NLOS信号识别、地铁停车精准预测、变压器故障诊断

3 图像处理方面
图像识别、图像分割、图像检测、图像隐藏、图像配准、图像拼接、图像融合、图像增强、图像压缩感知

4 路径规划方面
旅行商问题(TSP)、车辆路径问题(VRP、MVRP、CVRP、VRPTW等)、无人机三维路径规划、无人机协同、无人机编队、机器人路径规划、栅格地图路径规划、多式联运运输问题、车辆协同无人机路径规划、天线线性阵列分布优化、车间布局优化

5 无人机应用方面
无人机路径规划、无人机控制、无人机编队、无人机协同、无人机任务分配

6 无线传感器定位及布局方面
传感器部署优化、通信协议优化、路由优化、目标定位优化、Dv-Hop定位优化、Leach协议优化、WSN覆盖优化、组播优化、RSSI定位优化

7 信号处理方面
信号识别、信号加密、信号去噪、信号增强、雷达信号处理、信号水印嵌入提取、肌电信号、脑电信号、信号配时优化

8 电力系统方面
微电网优化、无功优化、配电网重构、储能配置

9 元胞自动机方面
交通流 人群疏散 病毒扩散 晶体生长

    以上就是本篇文章【【心电信号】基于matlab Simulink胎儿心电信号提取【含Matlab源码 1550期】】的全部内容了,欢迎阅览 ! 文章地址:https://sicmodule.kub2b.com/quote/10047.html 
     栏目首页      相关文章      动态      同类文章      热门文章      网站地图      返回首页 企库往资讯移动站https://sicmodule.kub2b.com/mobile/,查看更多   
发表评论
0评