## 2 Methods
### Embedded System Design of the Proposed Finger-Ring-Shaped Hybrid Smart Stethoscope  
For heart sounds and PPG signal acquisition, a digital microelectromechanical systems (MEMS) microphone and a PPG sensor were selected and incorporated in the design of the proposed finger-ring-shaped hybrid smart stethoscope. The digital microphone (ICS-43434, TDK, Tokyo, Japan) had a high SNR of 64 dBA and a wideband frequency response range of 20 to 30 MHz, suitable for recording the heart-sound frequency range of 20 to 400 Hz. In addition, the sensitivity tolerance of the sensor was \(\pm 1\) dB, which enabled high-performance microphone arrays without the need for system calibration. The microphone was available as a surface-mount package and had an I\({}^{2}\)G interface that allows it to be connected to the MCU directly. For PPG signal measurement, an ultra-low-power, completely integrated optical pulse oximeter and heart rate sensor (MAX86140, Maxim Integrated, San Jose, CA, USA) was selected for the PPG sensor. The sensor was designed with optimized architecture for heart-rate measurement and SpO\({}_{2}\) monitoring. The sensor had a low-noise signal-conditioning analog front-end with 19-bit ADC, an industry-leading ambient-light-cancellation circuit, and a picket-fence detect-and-replace function. With a standard serial peripheral interface (SPI)-compatible interface, the sensor could also be connected to the MCU directly.  
Due to the proposed device's requisite small size, long hours of use, and familiar wireless communication protocol for personal usage as a finger-ring-shaped device, a BLE-supporting ARM Cortex-M4 microcontroller (EFR32 MG, SiliconLabs, San Jose, CA, USA) was chosen as the main processor for system control, data processing, and wireless communication. This chip includes a 40 MHz ARM Cortex-M4 MCU with 1024 kB flash memory, 256 kB RAM, and a rich peripheral set to easily connect the digital microphone and PPG sensor. With 19 dBm maximum output power and a receiver sensitivity of \(-102.7\) dBm, the device provides an excellent link budget for greater range and reliable  
Figure 3: The procedure of peak point detection from the PPG signal: (**a**) recorded PPG signal; (**b**) smooth Shannon entropy envelope; (**c**) detected pulse onset and peak points.  
Bluetooth communications. The MCU was built with innovative low-energy techniques and fast wake-up times for extended usage. In addition, the chip was packaged as a ball grid array (BGA) package, which minimized the size of the printed circuit board (PCB). The BLE contained in the MCU was intended to provide considerably reduced power consumption and lower cost while maintaining a similar communication range, using the same 2.4 GHz radio frequencies as industrial, scientific, and medical (ISM) bands, aimed at novel applications in the medical field. In addition, mobile operating systems, including iOS and Android, natively support BLE and allow for easy connection between mobile devices and the proposed smart stethoscope.  
Figure 4 shows the block diagram of the proposed smart stethoscope's embedded system. Because the two selected sensors provided digital data output with I\({}^{2}\)S and I\({}^{2}\)C communication protocols, respectively, only heart sound and PPG signal processing had to be considered in the design of the proposed system's digital signal processing. However, because the two physiological signals must be acquired simultaneously, the data-acquisition procedure was separated into two channels for each heart sound and PPG signal measurement, operating as parallel processes. Considering that heart sounds are an audio stream, a ping-pong buffer was designed for this system to process the heart sounds continuously, from receiving sensor data to extracting the data features. Preprocessed data of the heart sounds and PPG signals were merged and processed through the developed automatic heart-sound-analysis algorithm. Finally, the processed data was transmitted by the BLE to the smartphone application for data display and storage.