admin管理员组

文章数量:1660165

I am trying to estimate the PSD of the heart rate variability of an ECG signal. To test my code,I have extracted the R-R interval from from the fantasia ECG database. I have extracted the signal can be accessed here. To calculate the PSD, I am using the welch method as shown below:

import matplotlib.pyplot as plt

import numpy as np

from scipy.signal import welch

ibi_signal = np.loadtxt('fantasia-f1y01-RR.txt')

t = np.array(ibi_signal[:, 0]) # time index in seconds

ibi = np.array(ibi_signal[:, 1]) # the IBI in seconds

# Convert the IBI in milliseconds

ibi = ibi * 1000

# Calculate the welch estimate

Fxx, Pxx = welch(ibi, fs=4.0, window='hanning', nperseg=256, noverlap=128)

Next,the area under the curve is calculated to estimate the power spectrum of the differ

本文标签: 频谱Python