Model for Simulating ECG and PPG Signals with Arrhythmia Episodes 1.3.0

File: <base>/ECG_PPG_model/simPAF_correct_baseline.m (542 bytes)
function pqrst = simPAF_correct_baseline(pqrstIn)
% 
% [] = simPAF_correct_baseline() corrects PQRST baseline.
%
% Copyright (C) 2017  Andrius Petrenas
% Biomedical Engineering Institute, Kaunas University of Technology
%
% Available under the GNU General Public License version 3
% - please see the accompanying file named "LICENSE"
%
    pqrst(1,:) = pqrstIn;
    x = [1 length(pqrst)];
    xi = 1:1:length(pqrst);
    y = [pqrst(1,1) pqrst(1,end)];
    baseline = interp1(x,y,xi,'linear');
    pqrst = pqrst - baseline;
end