Optimal unbiased functional filtering in the frequency domain