## How can I calculate respiration rate from a respiration signal based on specific onsets?

### Gil Sharvit (view profile)

on 8 May 2013
Latest activity Edited by Peter Gamma

### Peter Gamma (view profile)

on 21 Nov 2019 at 8:21
Dear Matlab experts,
I have a respiration data and I wish to find a way to calculate the respiration rate in specific epochs that I can manually specify.
Is there a way to do that? or any known toolbox?
Thank you very much in advance, Gil

### Wayne King (view profile)

on 8 May 2013

You should be able to just do that with a frequency-domain analysis by either computing the DFT (via FFT), or using a nonparametric PSD estimator from the Signal Processing Toolbox, periodogram(), or pwelch()

Peter Gamma

### Peter Gamma (view profile)

on 29 May 2019
Did someone already create a code for calculating respiration rate, which can easily be modified?
Peter Gamma

### Peter Gamma (view profile)

on 29 May 2019
Is it necessary to have a different algorythm for calculating heart rate than for calculating respiratory rate? Is it possible to modify the following algorythm for calculating respiratory rate?:
Peter Gamma

### Peter Gamma (view profile)

on 31 May 2019
Here I found another way to calculate the heart rate:
ECG Signal Processing in MATLAB - Detecting R-Peaks: Full
Can this be modified to calculate the respiratory rate?

### nur syahida shahdan (view profile)

on 29 Oct 2019

Hi. anyone know the equation to calculate respiration rate?
I try to use this coding but it seem like for the heart beat.
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)

Show 1 older comment
nur syahida shahdan

### nur syahida shahdan (view profile)

on 29 Oct 2019
So far we need to used Digital filtering and wavelet decomposition method to extract the respiration rate?
Peter Gamma

### Peter Gamma (view profile)

on 17 Nov 2019 at 19:43
I think so. But we can also try out peak detection of the respiraton signal as it was done for ecg signals. As far as I know, nobody did try it out to this date.
Peter Gamma

### Peter Gamma (view profile)

on 17 Nov 2019 at 20:10
You tried to code it. Did it work? The problem could eventually be the flatter peaks of respiration signals.