# excluding the value of some frequency in a Fourier Transform

I have a variable in time and I calculated its mean which is 9.5. I have done the Fourier Transform of this variable, using the FFT in matlab. I would like to consider only a range of frequencies, so I substituted with zero all the frequencies that I have excluded. After this I did the ifft of this, obtaining again a variable in time. I calculated its mean and now is 9.5. I am surprised because I supposed that it should have been a lower value because the signal does not include some frequencies.

Maybe substituting with 0 the value in the frequencies that I don't want to include is not the right procedure. Can you help me?

• Don't zero out FFT bins to filter. You can convolve the signal with a sine wave and it's equivalent to multiplication a delta function in the frequency domain. Jul 21 at 9:36

[Pictures to follow] Let us start with a thought experiment (which can be simulated): imagine a constant signal with value $$c$$. Add a full period of a pure sine with non-zero frequency. If you can remove this harmonic contribution by zeroing out its frequency bin in the Fourier domain, then the resulting inverse Fourier signal will still have mean $$c$$. So remove "some frequency" does not reduce the mean per se.
Now remember that, in the Fourier domain, the "O-th" frequency ought to be equal (up to a constant scale factor) to the average of the signal. This is consistent with the above. The pure sine period has equally distributed values above and below $$0$$, so this does not contribute to the signal's average.