## 2 Materials and Methods  
### Composite Sensor Kit for Real-Time Multiparameter Physiological Data Acquisition  
The composite hardware consisted of an ECG, PPG sensors, a GPS module and a 3-Axis accelerometer interfaced with a Texas Instruments AM335x based Beaglebone Black (BBB) small board computer running Debian Linux 7.9. MATLAB Embedded Coder Hardware Support packages support Debian Linux 7.9 to interact with BBB for General Purpose Input Output (GPIO) and serial communication. The Embedded Coder toolbox could generate C/C++ code for the corresponding MATLAB script targeting the AM355x Cortex-A processors. The block level diagram of the setup is shown in Figure 1. The raw ECG signals from human bodies had noise due to motion artefacts and baseline wandering. MATLAB Hardware Support packages were used to interact with the motion artefact so that it could be removed using the stationary wavelet transform level 5 decomposition and'sym4' wavelet in the MATLAB Stationary Wavelet Transform tool. The signal was further smoothed using a Savitzky-Golay filter with order = 3 and frame length = 51. Alternatively, the baseline wandering [38], along with the motion artefacts, could be removed by using a Chebyshev Type II filter order = 2, sampling frequency = 1024, with a passband (Wp) of between 1 Hz and 100 Hz, and a stopband (Ws) of between 0.5 Hz to 100 Hz, according to code Expressions (1). [n,Ws] = cheb2 ord(Wp,Ws,1150); % Filter Order  
[z,p,k] = cheby2(n,Rs,Ws); % Filter Design  
[sosbp,gbp] = zp2 sos(z,p,k);  
filtered_signal = filtfit(sosbp, gbp, ecgsig); % Filter Signal  
%Source: matlabcentral/answers/364788-ecg-signal-artifact-removing  
The composite sensor kit captured signals in real time from the following sensor modules, as shown in Figure 2:  
1. ECG Sensor module
2. PPG (SpO2) sensor module
3. GPS module
4. Respiratory rate and blood pressure calculations  
(1) ECG sensor breakout board based on an Analog Devices AD8232 analog front end was used to measure the electrical biopotential activity of the heart through electrodes attached (glued/taped) to the skin. The ECG sensor board was interfaced with a Texas Instruments AM335x-based Beaglebone Black (BBB) through GPIO ports. (2) The PPG (SpO2) sensor module hosted a MAX30101 high-sensitivity pulse oximeter from Maxim Integrated. It was designed to run on either 3.3 V or 5 V power supply, and it communicated  
Figure 1: Composite sensor kit architecture showing all the data acquisition, signal processing, and computing components  
with BBB over an Inter-Integrated Circuit (I2C) interface. The MAX30101-based board included internal LEDs, photodetectors, and optical elements, and it could remove noise by low ambient light rejection. The MAX30101 integrated red, green, and IR (infrared) LED drivers to modulate the LED pulses for SpO2 and heart rate measurements. As a principle, it is known that the oxygen-saturated blood absorbs light differently than unsaturated blood. Pulse oximeters measure the oxygen saturation, giving an indication of the percentage of hemoglobin concentration in blood that is saturated with oxygen. In a healthy adult, these readings can range from 94% to 100%. Since oxygen-saturated blood absorbs more infrared light than red light, and unsaturated blood absorbs the opposite, the SpO2 readings are calculated by the comparison of the amount of absorption of these two types of light, as quantified by the current generated by the photodetectors. (3) The GPS breakout board hosts the u-blox NEO-6 series GPS module and interacts with the BBB through the serial interface. (4) Respiratory Rate and Blood Pressure Calculations  
The RR can also be calculated using the Physionet Waveform Database (WFDB) library using the EDR utility, and the derived value has a high correlation to the measured values, as found by the authors of the library [40]. Since the ECG waveforms are available, RR can be calculated from the ECG waveform itself. The EDR utility is a C program and it can be compiled on any GNU/Unix/Linux platforms.