function [t,rr,jqrs_ann,SQIjw, StartIdxSQIwindows_jw] = ConvertRawDataToRRIntervals(ECG_RawData ,HRVparams, subjectID) % [t,rr,jqrs_ann,sqijs, StartIdxSQIwindows_jw] = ConvertRawDataToRRIntervals(ECG_RawData ,HRVparams, subjectID) % % OVERVIEW: % Load raw signal perfom QRS detection & Signal Quality Index SQI % and extract RR intervals from ECG signal % (single lead ECG signal) % % INPUT: % ECG_RawData : vector containing the 'raw' ECG signal (in mV) % HRVparam : struct of settings for hrv_toolbox analysis % subjectID : name that identify the analyzed signal % % OUTPUT: % rr : Vector containing RR interval % t : Time indices of the rr interval data (seconds) % SQIjs : Signal Quality Index values comparing jqrs and wqrsm % StartIdxSQIwindows_jw : Indexes of SQI windows % % DEPENDENCIES & LIBRARIES: % PhysioNet Cardiovascular Signal Toolbox % https://github.com/cliffordlab/PhysioNet-Cardiovascular-Signal-Toolbox % % REFERENCE: % Vest et al. "An Open Source Benchmarked HRV Toolbox for Cardiovascular % Waveform and Interval Analysis" Physiological Measurement (In Press), 2018. % % REPO: % https://github.com/cliffordlab/PhysioNet-Cardiovascular-Signal-Toolbox% ORIGINAL SOURCE AND AUTHORS: % Written by Giulia Da Poian (giulia.dap@gmail.com) % Dependent scripts written by various authors % (see functions for details) % COPYRIGHT (C) 2018 % LICENSE: % This software is offered freely and without warranty under % the GNU (v3 or later) public license. See license file for % more information %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% if nargin < 3 error('Wrong number of arguments in ConvertRawDataToRRIntervals') end % run_sqrs and wqrsm detectors require ECG in digital values % thus ECG data input that is in physical units will multiply the value % GainQrsDetect GainQrsDetect = 2000; % Default value for gain (adu/physical unit) if size(ECG_RawData,1)