AFE4403, SPO2 calculation!!

Hello
I am making oxygen saturation meter with arduino.
The circuit was connected to arduino via SPI as follows. So I could confirm that IR and RED signals.
But I have some problems now...
I need to measure SPO2 percentage using the AC and DC values of the signals as attached,
but i dont know how to detect AC and DC.
Also i don't know which part of the code to modify.
if anyone knows, i'd like you to see the attached code and files and advise me
thank you.

AFE4403.ino (733 Bytes)

AFE4403_Raw.cpp (5.49 KB)

AFE4403_Raw.h (2.99 KB)

calculation.png

output.png