The error occured only when the RR and HR were the same value ...
Please give our Best Regards to the professor!

How's it done? You would need to dig into the Service Manual of the monitor. Hopefully there are some circuit diagrams and even an explanation in there. Otherwise, maybe you could figure out a method yourself. Filtering plus some sort of sampling (and) or comparator circuit(s), I wonder. There are plenty of such circuits available on the web.
Also, I
notice there are a couple of RESP adjustments on the monitor that you could take a look at.
Lastly, to get back into the professor's good books, perhaps you could interest him in
this. He might be interested in
this one, as well.
Good luck with your studies.
I have just checked the PS-420 manual. Orginally from Metron, this nice piece of test kit has now been discontinued by Fluke. The Respiration settings look comprehensive enough; including Baseline Impedance, also Apnea [sic] - so you might like to have a play with those as well.