In [1]:
import wfdb
import numpy as np
import matplotlib.pyplot as plt
Max and Min Values
In [2]:
t0 = 10000
tf = 20000
Read the waveform info
In [3]:
folder = "p05/p050140"
waveform = "p050140-2188-07-26-05-51"
channel = [0]
record = wfdb.rdsamp(waveform,pbdir='mimic3wdb/matched/'+folder, sampfrom=t0, sampto=tf, channels=channel)
Check Record
In [4]:
plt.plot(np.array(record.p_signals[:,channel]))
plt.show()
Find the Peak indexes
In [5]:
d_signal = record.adc()[:,0]
peak_indices = wfdb.processing.gqrs_detect(x=d_signal, fs=record.fs, adcgain=record.adcgain[0], adczero=record.adczero[0], threshold=1.0)
In [6]:
print(record.adcgain)
Fill empty params
In [7]:
record.adcgain = 1
record.adczero = 0
record.baseline = -1
d_signal = record.adc()[:,0]
peak_indices = wfdb.processing.gqrs_detect(x=d_signal, fs=record.fs, adcgain=record.adcgain[0], adczero=record.adczero[0], threshold=1.0)