# A little bit better than zeroing bins in order to filter

The topic of zeroing frequency bins before IFFT has been discussed here : Why is it a bad idea to filter by zeroing out FFT bins? It was very helpful to understand why it is a bad idea.

What do you think about, instead of zeroing, multiplying by a window (in the frequency domain!) which is 0 at the centre and smoothly goes to 1 outside of a small interval ?

t = linspace(0, 1, 256, endpoint=False)
x = sin(2 * pi * 3 * t) + cos(2 * pi * 100 * t)
X = fft(x)
window = 1 - scipy.hamming(128)
X[64:192] *= window
y = ifft(X)


Then it would not be a "rectangular" zeroing, but a "smoothed zeroing" in the frequency domain. What do you think about such a filter ?