Added filter and removed unused tmp from calc_fft