In this paper, we present an efficient technique for extracting the fetal electrocardiogram (FECG) from a composite ECG recording. Our technique uses an adaptive neuro-fuzzy inference system (ANFIS) that operates on two ECG signals recorded at the thoracic and abdominal areas of the mother's skin. The thoracic ECG is assumed to be purely maternal. However, the abdominal ECG will contain both a maternal component as well as a fetal one. This maternal component is considered to be a nonlinearly transformed version of the thoracic ECG. Once this nonlinear transformation is determined, the thoracic ECG signal can be aligned with the maternal component in the abdominal ECG signal. We use ANFIS to perform this nonlinear alignment. The FECG signal is then extracted by simply subtracting the aligned version of the thoracic ECG signal from the abdominal ECG signal. ©2006 IEEE.