Firstly, I have tried NeuroKit2
, and a result was nice. Thanks.
Does this tool work based on QRS fitting?
signals, ecg_info = nk.ecg_process(
ecg_signal=ecg_signal,
sampling_rate=raw.info[‘sfreq’]
)
rpeaks=ecg_info[‘ECG_R_Peaks’]
A=np.zeros((size(rpeaks),2),dtype=np.int) # not smart codes
B=np.insert(A, 0, rpeaks, axis=1)
epochs = mne.Epochs(raw, B, 0, -0.1, 0.1)
data = epochs.get_data()
plt.plot(1e3 * epochs.times, np.squeeze(data).T)