This is a naive and very basic implementation of the paper https://github.com/eth-siplab/Nightbeat since the authors haven't published their version.
There is no guarantee this works IRL, I tested on myself at rest but there is body movement rejection to be implemented and fine tuning to be done. I lack data from more IRL users and have merely experimented on myself and synthetic data.
there is no long term herd immunity with coronaviruses; which is why they are often use in disaster prevention scenarios...
what you call "herd immunity" is merely letting people die and then go "we have herd immunity" as part of your survivor bias
only solution that works most of the time, regardless of pathogen (including covid): air filtration (respirators and/or whole room)