Need to filter very small signal
The first thing you should do is examine your signal collection hardware and do everything humanly possible to improve the signal-to-noise ratio of the analog signal applied to your A/D converter. I realize this is easier said than done, but do your very best to reduce the noise in your analog signal.
Next, you might consider the following process:

Based on the following figure, examine your noisy signal samples and identify the $T_n$ time instants of your QRS complex spikes.
Create multiple signal segments, $S_n$, where each segment comprises $N$ samples just prior to and including the QRS complex spike sample.
Average the $S_n$ signal segments.
Examine the &quot;averaged&quot; $N$-sample segment to see if your can detect an averaged p-wave.