spkit.data
.ppg_sample¶
- spkit.data.ppg_sample(sample=1)¶
Load sample(s) of PPG signals
Photoplethysmogram Signal
An optically obtained signal, recorded by Pulse Sensor at lower sampling rate (128)
Sample is part of PhyAAt Dataset [2]
- Parameters:
- sampleint, {1,2,-1}
sample number
if -1, return all two samples
- Returns:
- Xarray, (n,) or list of two
- 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
ecg_sample
Electrocardiogram (ECG) - 1-lead
optical_sample
Optical Mapped Signal
egm_sample
Electrogram (EGM)
References
[1] wikipedia - https://en.wikipedia.org/wiki/Photoplethysmogram
[2] PhyAAt Dataset - https://phyaat.github.io/
Examples
#sp.data.ppg_sample #Example 1 import numpy as np import matplotlib.pyplot as plt import spkit as sp x,fs = sp.data.ppg_sample(sample=1) x = x[:int(fs*20)] 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('PPG Signal') plt.grid() plt.show()
################################ #Example 2 #sp.data.ppg_sample import numpy as np import matplotlib.pyplot as plt import spkit as sp x,fs = sp.data.ppg_sample(sample=2) x = x[:int(fs*20)] 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('PPG Signal') plt.grid() plt.show()