sketch out ECG processing R script