Effacer les filtres
Effacer les filtres

How to plot RR interval?

20 vues (au cours des 30 derniers jours)
Luca Merolla
Luca Merolla le 23 Sep 2020
Commenté : Bhupati kumar le 15 Oct 2020
Hello everyone!
I have an RR interval (attached) extracted from an ECG signal that was sampled at 500 Hz. The R peaks and their indices were extracted using findpeaks(), then the diff() function was used on the R indices (expressed in seconds) to calculate the RR interval. The RR interval was converted in milliseconds following the standard procedure. Below an extract from the code:
[qrspeaks, locs] = findpeaks(iwt, time, "MinPeakHeight", 0.5, ...
"MinPeakDistance", 0.42);
% RR interval
RR = diff(Rindex);
RR = RR'.*1000; % conversion in ms
Now I should plot this signal on the y-axis, while on the x-axis I should have the time (in seconds) at which the heart beat occurs.
I need the time in seconds of the RR interval also for the spline interpolation of the signal. I would like to start interpolating from the first value of the signal, so to avoid the extra values between 0 and the first value of the RRI. I attached a plot as an example to make myself more clear. Below the code for the interpolation:
x = 1:length(RR);
xq = 0:0.25:length(RR); % Instead of 0 I would like the first index value of the RRI
s = spline(x, RR, xq);
timespline = (1:length(xq))/4;
If you have different suggestions feel free to share, they're always welcome!
Thank you in advance for your reply!
  1 commentaire
Bhupati kumar
Bhupati kumar le 15 Oct 2020
how do i get rr indices?

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by