Effects of filtering on the purity of heralded single photons from parametric sources