MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   来自rr数据的真实ECG信号模拟器,适用于Matlab或python (https://www.labfans.com/bbs/showthread.php?t=24201)

poster 2019-12-10 20:48

来自rr数据的真实ECG信号模拟器,适用于Matlab或python
 
我有一系列rr数据(PQRST心电图信号中rr峰值之间的距离),我想在matlab或python中生成逼真的ECG信号。我已经找到了一些关于matlab的材料(matlab中的ecg内置函数),但是我不知道如何从rr数据生成它,而对于python却一无所获。有什么建议吗?



[B]回答:[/B]

这符合您的需求吗?如果没有,请告诉我。祝好运。

import scipy import scipy.signal as sig rr = [1.0, 1.0, 0.5, 1.5, 1.0, 1.0] # rr time in seconds fs = 8000.0 # sampling rate pqrst = sig.wavelets.daub(10) # just to simulate a signal, whatever ecg = scipy.concatenate([sig.resample(pqrst, int(r*fs)) for r in rr]) t = scipy.arange(len(ecg))/fs pylab.plot(t, ecg) pylab.show() [IMG]https://i.stack.imgur.com/9vwcE.png[/IMG]



[url=https://stackoverflow.com/questions/4387878]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 01:17

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.