Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

% Matlab script to compare the inverse Dower transform with a real

% record VCG assumes that you have an internet connection and have
% installed WFDB libs under linux correctly. See www.physionet.org
%
% Gari D. Clifford April 2006 http://alum.mit.edu/www/gari/ecgtools

% download 10s of data form the PTBDB and save to file


% !rdsamp -r ptbdb/patient001/s0010_re | head -10000 > allLeads.dat

% load the data


clear, clc

load allLeads.dat
% column order = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
% column order = t i ii iii avr avl avf v1 v2 v3 v4 v5 v6 x y z

%find 8 lead ECG and real VCG


ecg = zeros(length(allLeads),8);
ecg(:,1:2) = allLeads(:,2:3); % DI DII
ecg(:,3:8) = allLeads(:,8:13); % V1 V2 V3 V4 V5 V6

DII = ecg(1:2500,1);
[DII,rfDII] = filtro_fft(DII,1,120);
MM = max(DII);
DII = DII/max(DII);
Amp_Picos(DII)

vcg = allLeads(:,14:16);

% subplot(211);
plot(vcg(1:2500,1))%,vcg(:,2)) %,vcg(:,3))
grid on
hold on
% Construct inverse dower transform matrix
T = [ -0.172 -0.074 0.122 0.231 0.239 0.194 0.156 -0.010 ;
0.057 -0.019 -0.106 -0.022 0.041 0.048 -0.227 0.887 ;
-0.229 -0.310 -0.246 -0.063 0.055 0.108 0.022 0.102 ];

% estimate VCG using inverse Dower Transform


vcg2 = T*ecg';
vcg2 = vcg2';
% subplot(212);
plot(vcg2(1:2000,1))%,vcg(:,2)) %,vcg(:,3))
grid on

vcg2 = T*ecg';

You might also like