How do you calculate electrocardiogram?