System for automatic heart rate calculation in epileptic seizures