Efficient ECG classification based on chi-square distance for arrhythmia detection