ENH: Refactored code for FFT filtering