ecgdata module¶
-
class
ecgdata.
EcgData
(filename, data, mean_hr_bpm=None, voltage_extremes=None, duration=None, num_beats=None, beats=None)¶ -
autocorrelate
()¶ Returns number of samples in dataset and indices of peaks in voltages and the autocorrelation of voltages
Parameters: self – pandas DataFrame containing ecg data with two columns: time and voltage Returns: number of samples in dataset Returns: indices of peaks in voltages Returns: indices of peaks in the autocorrelation of voltages
-
butter_bandpass
()¶ Returns bandpass-filtered voltages
Parameters: self – pandas DataFrame containing ecg data with two columns: time and voltage Returns: bandpass-filtered voltages Returns: number of samples
-
calc_mean_hr
(time_period)¶ Returns mean heart rate
Parameters: self – pandas DataFrame containing ecg data with two columns: time and voltage Returns: mean heart rate in beats per minute
-
get_beat_times
()¶ Returns times when a beat occurred
Parameters: self – pandas DataFrame containing ecg data with two columns: time and voltage Returns: numpy array of times (in seconds) when a beat occurred
-
set_duration
(time_unit)¶ Returns duration of ECG recording
Parameters: - self – pandas DataFrame containing ecg data with two columns: time and voltage
- time_unit – user input for unit of time
Returns: duration of ECG recording in seconds and adjusts time in self.data to be seconds
-
set_v_extremes
()¶ Detects minimum and maximum lead voltages
Parameters: self – pandas DataFrame containing ecg data with two columns: time and voltage Returns: tuple containing minimum and maximum lead voltages
-