Basic EMG processing code