T wave onset and offset in ecg signal using matlab

596 Views Asked by At

I am working in a project that intended to extract ECG features. I used wavelet transform. I successfully detect all waves including R peaks. Now, I want to measure P wave duration. first, I thought to find the onset and offset of the P wave. then, I can count how many samples in duration. My question is when I used the following code it returns empty matrix !!!!!.( I tried to find the P wave onset from the point that is crossing the zero value with reference to P peaks(P peaks location. That is, I created a window of 201 samples in which I am looking for the nearest sample that it's value close to zero in this window). Can any one help please. (Matlab code)

% P duration
pdon = [];
% y is my filtered signal
for i = 1:1:length(Ploc);
pon = Ploc(i)-200:Ploc(i);
if (y(pon)<=0 & y(pon+1)>0) 
found = (pon);
pdon = [pdon found];
pdon_amp = y(pdon);
end
end
figure(111)
plot(y)
hold on
stem(pdon,pdon_amp,'r*')
hold off
0

There are 0 best solutions below