Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Extract respiration signal and respiratory rate from ECG using R-R interval.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RaviDurbha
Copy link

Hi Raphael,

I would like to use this algorithm to compute respiration rate from PPG signal. In this process, I would like to understand how the value of
up sampling frequency sf_up = 4 was chosen. Also is there any relation between the parameters sf, sf_ori and sf_up in the algorithm.

Thanks,
Ravi

@raphaelvallat
Copy link
Author

Hi @RaviDurbha,

A 4 Hz upsampling frequency is very common in HRV analysis, hence my choice. People have also used 2 Hz.

sf_up is not affected by sf or sf_orig. Actually you can discard the downsampling from 360 Hz to 100 Hz:

sf = sf_ori
ecg = filter_data(ecg, sf, 2, 30, verbose=0)

@RaviDurbha
Copy link

Hi @raphaelvallat,

Thanks for the clarification. Instead of RR interval from ECG signal, I can compute Inter-beat-interval from PPG signal and still use your algorithm to compute respiration rate.

Thanks,
Ravi

@raphaelvallat
Copy link
Author

Yes that should work too. Please note that this is a very simple algorithm and I'm sure there are better alternative out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment