Detecting and Quantifying T-Wave Alternans: The PhysioNet/Computing in Cardiology Challenge 2008 1.0.0
(781 bytes)
for ii=1:NrofLead
j=1;
for i=1:Rcount
j=j+1;
if i==1
zr=160;
else
zr=int32((R(i)-R(i-1))/3);
end;
zr1=6;
kvr(j,1)=R(i)-zr;
kvr(j,2)=mean(data((R(i)-zr-4):(R(i)-zr+4),ii));
kvt(j,1)=kvr(j,1);
kvt(j,2)=kvr(j,2);
j=j+1;
kvr(j,1)=R(i)-zr1;
kvr(j,2)=mean(data((R(i)-zr1-4):(R(i)-zr1+4),ii));
kvt(j,1)=kvr(j,1);
kvt(j,2)=kvr(j,2);
end;
kvr(1,1)=1;
kvr(1,2)=kvr(2,2);
kvr(j+1,1)=R(Rcount)+250;
kvr(j+1,2)=kvr(j,2);
x=1:m;
KVE=interp1(kvr(:,1),kvr(:,2),x,'spline','extrap');
ttt(:,1)=KVE.';
ttt(:,2)=data(1:m,ii);
EKG(:,ii)=data(1:m,ii)-KVE.';
end;