-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Included variable HEP.ibi to easily access the interbeat intervals obtained by any peak detection method.
- Loading branch information
Showing
5 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
% heplab_calculate_IBIs - Calculates IBIs, called by heplab_ecgplot.m | ||
% | ||
% Copyright (C) 2019 Pandelis Perakakis, Granada University, [email protected] | ||
% | ||
% This program is free software: you can redistribute it and/or modify | ||
% it under the terms of the GNU General Public License as published by | ||
% the Free Software Foundation, either version 3 of the License, or | ||
% (at your option) any later version. | ||
% | ||
% This program is distributed in the hope that it will be useful, | ||
% but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
% GNU General Public License for more details. | ||
% | ||
% You should have received a copy of the GNU General Public License | ||
% along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
|
||
function [RRinterval, RRtimes]=heplab_calculate_IBIs(qrs,signal_sec,srate) | ||
|
||
if length(qrs)>1, | ||
|
||
time=0:1/srate:signal_sec-1/srate; % time axis | ||
|
||
% convert to ms | ||
RRtimes=round(1000*time(qrs)); | ||
|
||
% calculate IBIs | ||
RR=RRtimes(1:length(RRtimes)-1); | ||
RR1=RRtimes(2:length(RRtimes)); | ||
RRinterval=diff(RRtime); | ||
|
||
% convert to sec and remove first interval | ||
RRtimes=RRtimes(2:length(RRtimes))/1000; | ||
|
||
% round IBIs | ||
RRinterval=round(RRinterval); | ||
|
||
else | ||
RRinterval=-1; | ||
RRtimes=-1; | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters