
The ECG signals from the NSRDB is resampled to 250Hz to make them compatible to AFDB database.

Then the signal is normalized between 1 and -1

R peaks are detected using Pan Tompkins algorithm[1]}.

The continuous ECG signals are divided into a sequence of heartbeats and splitted into normal and AFib based on the annotation files. Window of 1.2 sec is taken as the normal range for RR interval is 0.6-1.2 seconds https://emedicine.medscape.com/article/2172196-overview as AFib beats RR intervals are always smaller than the normal beats.The segmented windows are zero padded as Afib has less number of samples as shown in Figure 2.

Data prepared is shuffled and splitted into test, train and validation data in the ratio of 15:75:10 percentage respectively.

To remove the affect of imbalanced data 30,000 samples for AFib and non-AFib is chosen randomly, totally 60,000 samples.

<FIGURE>