# Method and System for Heart Rate Estimation Using Linear Prediction Filtering +
## 2 Materials and Methods
### Experimental Setup  
Having understood the dynamics of the ECG signal and the technological trends in their diagnosis, the system specification was initiated according to the classification of [32], characterized as a single-lead system for outpatient/home medical application, to diagnose diseases at low cost, identifying itself as a smart system due to the use of IoT, cloud and artificial intelligence (AI) technologies. Based on the analyses of traditional ECG systems and Smarts Health Care presented in [33; 34] and considerations on the form of data acquisition and preprocessing (filtering, resampling, and normalization), some functional requirements were established:  
* Sampling rate 250 samples/s and 12-bit resolution;
* Use of instrumentation amplifier;
* 0.5 to 40 Hz bandpass filter or a high-pass filter together with a low-pass filter;
* Notch filter at 60 Hz;
* Use of processor compatible with the implementation;
* Use of 1 GB microSD card electronics;
* Use of LCD, TFT or OLED screen;
* Use of charge control electronics for lithium-ion batteries. Silver and silver chloride (Ag/AgCl) electrodes and a Sparkfun AD8232 (Analog DevicesTM, Beaverton, OR, USA) single-lead heart rate monitor module, illustrated in Figure 6, can be used for data acquisition and preprocessing. This electrode type was chosen because it is easy to find and because of its low price. The Sparkfun AD8232 module is an electronic board based on the Analog Devices AD8232 integrated circuit that is designed to extract, amplify, and filter small biopotential signals in the presence of noisy conditions, such as those created by motion or remote electrode placement. The configuration implemented in Sparkfun's AD8232 is to obtain an ECG waveform with minimal distortion, with a second-order high-pass filter and cutoff frequency of 0.5 Hz followed by a second-order low-pass filter and cutoff frequency of 40 Hz with the use of a third electrode for optimal common-mode rejection ([[https://cdn.sparkfun.com/datasheets/Sensors/Biometric/AD8232.pdf](https://cdn.sparkfun.com/datasheets/Sensors/Biometric/AD8232.pdf)]([https://cdn.sparkfun.com/datasheets/Sensors/Biometric/AD8232.pdf](https://cdn.sparkfun.com/datasheets/Sensors/Biometric/AD8232.pdf)), accessed on 18 March 2025). Since a 60 Hz _notch_ filter is not implemented via _hardware_ in the module, it was digitally implemented in the code. Figure 5: Frequency response of the LPC filter. The hardware development (processing) platform chosen to execute the project was the ESP32-DevKit of Figure 7, a small ESP32-based development board produced by Espressif. The ESP32 (Espressif(tm), Shangai, China) is a unique integrated circuit that combines 2.4 GHz Wi-Fi and Bluetooth technologies ([[https://www.espressif.com/en/products/socs/esp32](https://www.espressif.com/en/products/socs/esp32)]([https://www.espressif.com/en/products/socs/esp32](https://www.espressif.com/en/products/socs/esp32)), accessed on 18 March 2025) and has a 32-bit 240 MHz single/dual-core Xtensa processor (Espressif(tm), Shangai, China), 448 KB ROM, 520 KB SRAM, 16 KB SRAM in RTC, QSPI supporting multiple flash/SRAM chips, 34 GPIO, 4 SPI, 2 I2S, 2 I2C, 3 UART, 1 host (SD/eMMC/SDIO), 1 slave (SDIO/SPI), TWAI(r), RMT (TX/RX), PWM Motor, PWM LED, 12-bit ADC, 2 8-bit DAC, 20-bit WiFi IEEE 802.11b/g/n (up to 150 Mbps) and Bluetooth v4.2 BR/EDR and BLE. Its choice was based on the relatively low cost of the platform, reasonable processing power, and the availability of integrated Wi-Fi Bluetooth communication, which allows ease of programming and reduction in the prototype size. Although the ESP32 does not have Digital Signal Processor (DSP) functions, the literature shows that it performs well for implementations in ECG signals [35; 36]. Figure 6: Sparkfun AD8232 single-lead heart rate monitor module. Figure 7: Esp32-DevKit.