A digital filter for unfolding pulse-height distributions