## 2 System Architecture
### PPG Signal Conditioning  
The AFE conditions the PPG signal before being sampled and digitized. This process includes passing only the AC component of the photocurrent containing the heart rate information along with its amplification and conversion to voltage. The AFE is also used for reverse biasing the PD to make the acquisition process faster, by reducing the parasitic capacitance of the diode and thereby increasing its response speed. This method also introduces a new source of DC offset and noise error, which requires further considerations [15]. The readout circuit for the PPG signal is comprised of a transimpedance amplifier (TIA), a current digital-to-analog converter (IDAC), and a switched integrator (SI), as shown in Figure 3a. The TIA converts the current captured by the PD into a voltage. The IDAC cancels out a programmable portion of the the DC component of the photocurrent at the input of TIA. The output from the TIA is then further amplified and filtered with the SI before being sampled by the ADC. In the reflection-mode PPG acquisition, the LED and PD are placed on the same side of the tissue as opposed to the transmission-mode [1]. Although, in our case, the PD is physically very close to the LED because of the size constraints, these are optically isolated by a built-in light barrier. The incident light on the PD generates an AC and DC photocurrent. The AC signal is caused by the changes in blood volume and is the signal of interest as it contains the dynamic physiological information such as heart rate or respiration rate. The slowly-varying DC component is contributed by the non-pulsatile part of the blood and other tissues, the presence of the ambient light, the leakage of light that is directly coupled from the LED despite the light barrier, and the dark noise. As the AC component is much smaller than the DC component (the ratio is usually less than 10% [16]), it is required to subtract the latter in order to avoid saturating the readout circuit and to increase the dynamic range. This is achieved by using the IDAC at the input of the TIA. In order to help the system adapt to different perfusion conditions when combined with a variable LED driver, the IDAC is designed with two control bits to select a current with a value of 1, 1.25, 1.5, or 1.75 times of a reference current (\(I_{ref}\)), which is an internally generated source of constant DC bias current. For experimental flexibility, we also included the capability to generate \(I_{ref}\) externally in this prototype. We obtained the best results during the _in vivo_ experiments by using 10 \(\upmu\)A as \(I_{ref}\). More control bits can be added to the IDAC to further expand the dynamic range. The TIA converts the remaining input current into voltage along with a gain factor, while keeping the voltage across the diode constant and operating the PD in current mode. This provides better linearity for the system [15]. We implemented the TIA using an operational transconductance amplifier (OTA) as detailed in Figure 3b. The two-stage Miller-compensated OTA consists of a differential-to-single-ended amplifier followed by a common-source amplifier. We anticipated PD current values in the order of tens of nA for small animal measurements, so we implemented amplification factors as high as \(10^{6}\) using a resistive feedback. We also included two control bits to tune the feedback resistor (\(R_{f}\)) from 250 k\(\Omega\) to 1 M\(\Omega\) in four-steps to accommodate the intrinsic variability of the PPG measurements. We also added a compensation capacitor (\(C_{f}\)) in parallel with the feedback resistor to introduce a left half-plane zero in order to prevent the instability caused by the feedback network in the TIA [17; 18].