Respiration rate calculation by using photoplethysmogram

Hi. Anyone know the calculation for respiration rate? I used this formula but it seems like for heart beat.
dataset = xlsread('rrest-syn192_data.xlsx','Sheet1','A1:B30000')
s = dataset(:,1)
%y = dataset(:,2)
data = [s];
N1 = length(s)
t=0:1/500 : N1/500-1/500
plot(t,s)
title('Plot of signal')
xlabel('Time')
ylabel('Sample(s)')
[pks,locs,w,p] = findpeaks(data)
a=size(pks)
peak_count = (a/2)
Duration_s = (N1/500)
Duration_m = (Duration_s/60)
total_rate_per_minute = (peak_count/Duration_m)

Answers (0)

Asked:

on 29 Oct 2019

Commented:

on 29 Oct 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!