i have a project to develop an algorithm to detect cardiac axis from an ECG signal..can anyone help me with some idea or matlab code?i am a newbie in the field of matlab.it will be helpful for me if someone provide me matlab code about this.
Use Standard Lead I for the x-axis, Augmented Lead for the y-axis, and go from there. Calculate the angles using atan2d and the magnitudes using hypot. The angle corresponding to the maximum of the hypot results is the cardiac axis. If you are doing this in 3D, use Precordial Lead for the transverse lead, and calculate that angle with respect to Standard Lead I as I already described.
Thank you very much sir for your cordial reply. Due to some problem with my account i couldn't reply to you earlier.
Based on your answer,i have two question:
1."The angle corresponding to the maximum of the hypot results is the cardiac axis."- what do you mean by that?My code was
d = atan2d(Y_Avf,X_I1)
C = hypot( X_I1,Y_Avf)
s= max(C)
and this returns maximum value
s = 0.5174
so from this maximum value.....how can i find the exact angle?manually searching is not possible beacuse there are a lot of elements in the array. Is there any easy way or matlab code to find this?
2.If you can elaborate the 3D process ,it will be helpful to me beacuse i have zero idea about 3D process.
Hope you can understand this..I will be very grateful to you if you clear those confusions.
The cardiac axis is based on the R-deflections, so use those amplitudes. (Any single R-wave will do, however it must be the same R-wave in each lead for best results, or the average of all the R-wave amplitudes in the respective leads in a healthy heart (no ectopic R-waves). (Use the isoelectric reference between the end of the P-wave and the beginning of the QRS complex as a zero reference.)
Solve the 2D problem first, then if you need to do a 3D axis, that will be easier to solve.
You need to understand the lead placement and the origional Einthoven triangle and the augmented lead system regardless in order to understand how to do these calculations. Then, they will all make sense.
'The angle corresponding to the maximum of the hypot results is the cardiac axis.' - what do you mean by that?i understood that i have to plot hypot values in y axis and atan2d values in the x axis.then the maximum value of y axis determine (hypot max value) the angle in the x axis......is it the right way?? or i have missing something?
If you calculate the angles and hypotenuse values for every corresponding set of points (points for the same time value) in the two leads for the entire cardiac cycle, the angle corresponding to the maximum hypot value is the cardiac axis.