Deriving/calculating respiration rate from raw health sensor data

Hello,

I am wondering if anyone, a solo developer or a Samsung dev/partner has implemented a method or series of methods to track the instantaneous respiration rate of a wearer (this is on the Galaxy watch platform with WearOS) by using the raw PPG data along with Heart Rate data?

When I first start this project I foolishly thought this would be a trivial matter/something which had already been worked out multiple times by others, but through my research it appears this is actually a complicated process involving quite a bit of data processing and estimation, basically having a rolling window where you are cleaning up the PPG data and analyzing it for peaks and troughs then aligning it according to heart beats.

This IS a solved problem in some sense, i.e. I have found a few academic papers where researchers have done exactly this, i.e. derive the respiration rate from raw data, but even with the algorithm they describe in the paper linked below I have NO idea how to completely implement what they describe here in Java code. I am just a software developer, not an electrical engineer…this is somewhat very over my head.

Any clever folks out there that have already solved this?
I’ll take literally any impl that you’ve got, even some pseudocode that brings me closer than this block diagram would be a huge help.

Hello,
Sorry I did not understand your query?
Can you please share the query in short?

Thanks!