1 of 27

PATHS-UP & Expeditions in Computing RET 2018

Thursday June 14th 2018

2 of 27

Open or Proprietary?

Current question: how can I use open hardware and open software to access the PPG of a person and also analyze and display that data in a useful way?

Someone reverse engineered the firmware for the off-the-shelf pulse oximeter. This means the intellectual property of this company was violated.

What if there was open hardware and code that did (mostly) the same thing?

PulseSensor Amped vs CSM50D+

Hardware and software can be open or closed

3 of 27

Off the shelf - CMS50D+

4 of 27

Open - PulseSensor Amped

5 of 27

On the Analysis of Fingertip

Photoplethysmogram Signals

6 of 27

Photoplethysmography- Introduction

  • Photoplethysmography (PPG) is used to estimate the skin blood flow using infrared light.

  • A low cost non-invasive optical technique used to detect blood volume changes in the microvascular bed of tissue

  • It measures the oxygen saturation, blood pressure, cardiac output, and for assessing autonomic functions( a control system acts largely unconsciously and regulates bodily functions such as the heart rate, digestion, respiratory rate.)

  • It is used for the detection of various cardiovascular diseases,one of them being Arrhythmia (An arrhythmia is a problem with the rate or rhythm of your heartbeat. It means that your heart beats too quickly, too slowly, or with an irregular pattern.)

7 of 27

Principle of PPG

  • Most changes in blood flow occur mainly in the arteries and not in the veins

  • PPG sensors optically detect changes in blood flow volume via reflection from or transmission through the tissue.

  • The changes in light intensity are associated with small variations in blood perfusion.

  • Modes of PPG:

  • Transmissive mode(LED and photodetector on opposite side) – Can get a good signal, but the measurement site may be limited.

  • Reflective mode (LED and photodetector on the same side) : Variety of measurement sites.

  • But, motion artifacts and pressure disturbances limit the measurement accuracy of physiological parameters.

8 of 27

How is PPG obtained?

  • The waveform is represented by two components of current:

  • Direct current: detected signals from tissues

  • Alternating current: detected signals from blood volume changes.

  • Most changes in blood flow occur mainly in the arteries and arterioles (but not in the veins).

  • For example, arteries contain more blood volume during the systolic phase(veins contract and pump blood out of the heart) of the cardiac cycle than during the diastolic phase (veins are relaxed and heart fills blood). PPG sensors optically detect changes in the blood flow volume (i.e., changes in the detected light intensity) in the microvascular bed of tissue via reflection from or transmission through the tissue.

9 of 27

PPG waveform

  • PPG pulse is divided into two phases:

Anacrotic phase: Rising edge(systole)

Catacrotic phase: Falling edge (diastole)

Dicrotic notch: Usually seen in the catacrotic phase for subjects with healthy arteries.

10 of 27

Parameters measured using PPG signal

1. Systolic Amplitude:

 It is an indicator of the pulsatile changes(periodic variations) in blood volume caused by arterial blood flow around the measurement site.

11 of 27

2.) Pulse width: If we consider the pulse width at the half height of the systolic peak, it correlates with the systemic vascular resistance (used in calculations of blood pressure, blood flow, and cardiac function) better than the Systolic amplitude.

3.) Pulse Area: The pulse area is measured as the total area under the PPG curve.

Dividing pulse area into two areas at the dicrotic notch, we get Inflection Point Area Ratio (IPA)the ratio is an indicator of total peripheral resistance. (the resistance of the arteries to blood flow. As the arteries constrict, the resistance increases and as they dilate, resistance decreases.

12 of 27

Peak to Peak Interval is the distance between two consecutive systolic peaks. It represents a completed heart cycle. The Pulse Interval is, on the other hand, the distance between the beginning and the end of the PPG waveform. The Pulse Interval is used when the diastolic peaks are easier to detect than the systolic peaks

13 of 27

The Augmentation Index (AI) and the Reflection Index (RI) are both measures of the contribution made by the wave reflection to the systolic pressure. They are indicators of stiffness of the arterial wall.

Different authors have defined them as some form of ratio between the amplitude of the diastolic pressure and the amplitude of the diastolic pressure.

The shape of the waveform changes with age, due in part to an increase in artery wall stiffness.

14 of 27

Pulse Transit Time (PTT) can also be calculated from the PPG waveforms. Its calculation requires two signals taken simultaneously at different places in the body of the same individual (ear lobe and toe, for example.). To compare the signals, we must find the time for the peaks of the 1st waveform (t11, t12, t13…) and time for the the peaks of the 2nd waveform (t21, t22, t23…) The time delay between the peaks in the two signals is the PPT. The PPT has a correlation to Arterial Stiffness.

15 of 27

Peak-to-peak time differential is the difference between the time stamp for peaks. To calculate it, one must find the peak time stamp and find the difference in time between consecutive peaks. T = [t2-t1, t3-t2, t4-t3].

16 of 27

17 of 27

PPG Waveform Signal Analysis

18 of 27

The PPG Waveform

The pulse waveform is to be filtered and processed for critical points

19 of 27

Critical points

In this example, a simple three point smoothing is applied. Critical points are marked green. The data has been normalized to 0-1, but has not been filtered for artifacts.

Standard Python libraries are used

20 of 27

Determine Critical Point

Peaks and troughs are identified by changes in sign of the slope. It is assumed that the data is well filtered.

Potential interbeat feature, i.e. shoulders, that are not visible as change in slope are identified as runs of nearly zero slope in the data.

21 of 27

Select a waveform

The next step is to select a waveform and identify the relevant critical points.

The points can then be used to calculate values such as IBI and amplitude

22 of 27

Current Python framework

Currently I have two class, PPGWave and PulseWave to load data, filter the wave form, and present a set of methods to the user.

The PGWave class is intended to analyze the entire signal.

The PulseWave class will identify a single wave form and identify common values. These values will be exposed to those who create an instance of the class.

class PulseWave(object):

def getPWBegin(self):

return self.PWF[self.PWData][self.getPWBegin]

def getPWSystolicP(self):

return self.PWF[self.PWData][self.PWPWSystolicP]

def getPWDicroticNotch(self):

return self.PWF[self.PWData][self.PWDicroticNotch]

...

def getRiseTime(self):

return self.PWF[self.PWTime][self.PWSystolicP]-self.PWF[self.PWTime][self.PWBegin]

def getPWDuration(self):

return self.PWF[self.PWTime][self.PWEnd]-self.PWF[self.PWTime][self.PWBegin]

def getPWPropTime(self):

return self.PWF[self.PWTime][self.PWDiastolicPeak]-self.PWF[self

23 of 27

Near Term

  • The data must be filtered to remove artifacts as well as high and low frequencies.
  • It is unclear if the dicrotic information can be inferred accurately.
  • Critical point locating is dependent on the application. The routine is independent of the other methods, so can be replaced as needed.
  • The interface between these classes has be well defined so the that GUI people can use it.

24 of 27

Coding Corner

25 of 27

Findings

  • Variables in Python can be initialized using the equals sign (=)
    • Ex. # initialize the variable and run code
    • Systolic_amplitude = “High”
    • # print variable string
    • print(systolic_amplitude)
  • Variable can be reassigned, changing the contents
    • Ex. # assign a new string to the systolic_amplitude and run code
    • Systolic_amplitude = “Low”
    • print(systolic_amplitude)

26 of 27

  • String is a common type of data, used in programming, consisting of a sequence of 1 or more characters
    • Ex. # examples of printing strings with single and double quotes and run code
    • print(“Photoplethysmogram”)
    • print(‘PPG’)

27 of 27

  • Variables values in Python can change type , from integer to string to float
    • String
      • Ex. # assign PPG mode and run code to determine type
      • ppg_mode = “Transmissive”
      • type(ppg_mode)
    • Float
      • Ex. # assign variable a_1 and a_2 and also calculate the Pulse Area to determine type and run code
      • a_1 = .38
      • A_2 = .995
      • pulse_area = a_2/a_1
      • print(type(pulse_area))
      • print(pulse_area)
    • Integer
      • Ex. # assign variable a_1 and a_2 and also calculate the Pulse Area to determine type and run code
      • a_1 = .25
      • a_2 = .5
      • Pulse_area = a_2/a_1
      • type(pulse_area)