Time-domain and morphological analysis of P-wave from surface electrocardiogram has been extensively used to identify patients prone to atrial arrhythmias, especially atrial fibrillation (AF). However, since no standard procedure exists for P-wave preprocessing, standardization of cut-off values for P-wave duration and morphological features is difficult. This study is a methodological investigation of P-wave preprocessing procedures for automatic time-domain and morphological analysis. We compared, on simulated and real data, the P-wave template obtained applying three alignment algorithms with that obtained without alignment, in terms of template error, shift error, P-wave duration, and morphological parameters. We also proposed automatic algorithms for estimation of P-wave duration. We found that alignment is necessary for a reliable extraction of P-wave template by the averaging procedure, in order to perform time-domain and morphological analysis. On simulated and real data, the error on P-wave duration can be as high as 30 ms on a template obtained without alignment; if alignment procedure is performed, the error on P-wave duration is negligible. Analogously, morphological features are correctly estimated only on a P-wave template obtained with P-waves alignment. We also found that the proposed algorithm for the automatic estimation of the P-wave duration gave reliable results.