I am working on ECG signal processing using neural network which involves pattern recognition. As I need to collect all the data from Matlab to use it as test signal, I am
So I read this answer 3 months ago and removed the base and gain. It turns out , i completely shifted my R-peaks in various directions, screwing up all my results. While I am not sure if doing this is necessary in matlab or not, DO NOT DO THIS if you are not preprocessing your signal in matlab. I was preprocessing my signal in python, and all I did to normalizae it was
val = val/2047 % (2047 is the max volt range of signals)
and used butterworth filters to remove artifacts (range 0.5hz-45hz)
CORRECTION
The cutoff i selected is 0.5 to 45 not 5-15 as I previously reported. This cutoff preserves the QRS for various arrhythmias without adding too much noise
# baseline correction and bandpass filter of signals
lowpass = scipy.signal.butter(1, highfreq/(rate/2.0), 'low')
highpass = scipy.signal.butter(1, lowfreq/(rate/2.0), 'high')
# TODO: Could use an actual bandpass filter
ecg_low = scipy.signal.filtfilt(*lowpass, x=ecg)
ecg_band = scipy.signal.filtfilt(*highpass, x=ecg_low)