spkit.data.ecg_sample

spkit.data.ecg_sample(sample=1)

Load sample(s) of ECG sampled at high rate

  • ECG : Contact Electrocardiogram, recorded at high rate

Parameters:
sampleint, {1,2,3,4,-1}
  • sample number

  • if -1, return all 4 samples

Returns:
Xarray, (n,) or (n,4)
fsint

See also

eda_sample

Electrodermal activity (EDA)

gsr_sample

Galvanic Skin Response (GSR)

eeg_sample_14ch

Electroencephalography (EEG) - 14-channel

eeg_sample_1ch

Electroencephalography (EEG) - 1-channel

eeg_sample_artifact

Electroencephalography (EEG) processed

ecg_sample_12leads

Electrocardiogram (ECG) - 12-leads

optical_sample

Optical Mapped Signal

ppg_sample

Photoplethysmogram (PPG)

egm_sample

Electrogram (EGM)

Examples

#sp.data.ecg_sample
#Example 1
import numpy as np
import matplotlib.pyplot as plt
import spkit as sp
x,fs = sp.data.ecg_sample(sample=1)
x = x[:int(fs*3)]
t = np.arange(len(x))/fs
plt.figure(figsize=(12,3))
plt.plot(t,x)
plt.xlim([t[0],t[-1]])
plt.xlabel('time (s)')
plt.ylabel('ECG Signal')
plt.grid()
plt.show()
../../_images/spkit-data-ecg_sample-1_00_00.png
############################
#sp.data.ecg_sample
#Example 2
import numpy as np
import matplotlib.pyplot as plt
import spkit as sp
x,fs = sp.data.ecg_sample(sample=2)
x = x[:int(fs*10)]
t = np.arange(len(x))/fs
plt.figure(figsize=(12,3))
plt.plot(t,x)
plt.xlim([t[0],t[-1]])
plt.xlabel('time (s)')
plt.ylabel('ECG Signal')
plt.grid()
plt.show()
../../_images/spkit-data-ecg_sample-1_01_00.png