Noninvasive fetal electrocardiogram (NIFECG) has the potential to measure fetal heart rate (FHR). However, it has low signal-to-noise ratio (SNR) because of many interferences, mainly from the mother's biosignal. The algorithm to measure FHR from NIFECG generally consists of three steps, i.e. preprocessing, FECG extraction, and fetal QRS (FQRS) detection. One of the methods to extract FECG is template subtraction (TS), which does not require many channels. Nevertheless, it cannot significantly enhance the SNR. While for the QRS detection, the Pan-Tompkins algorithm is frequently used but initially designed for the adult ECG. Other than low SNR, NIFECG also faces a problem related to the standard configuration. It is still unknown where the electrodes placement can produce optimal FECG signal quality. Hence, this study aimed to increase FHR accuracy by developing an algorithm based on template subtraction and modified Pan-Tompkins. This study also proposed a channel selection process to eliminate low SNR channels interfering with FHR detection. Another objective was to analyze the electrode placement of NIFECG that has an optimal FECG quality based on its SNR value. The results showed that the proposed algorithm could produce mean absolute error (MAE) of 1.68 ms and mean square error (MSE) of 8.04 bpm2. Increasing the SNR threshold for channel selection could decrease MAE and MSE to 1.00 ms and 1.11 bpm2. Electrodes placement analysis from the Matonia dataset configuration showed that channel three has the highest SNR FECG value (20.18 dB) compared to the other channels.