There is a respiration rate estimation Matlab toolbox available from Peter H. Charlton: https://www.mathworks.com/matlabcentral/fileexchange/55289-respiratory-rate-estimation And if we look at Peter H. Charlton Respiratory Rate Estimation project: http://peterhcharlton.github.io/RRest/ But Peter Gamma from www.petergamma.org will not buy a brain scanner for his home all the same, but will look for better devices to track respiration here: https://infozentrum.ethz.ch/en/