# Frequency filtering with a DFT and meaning of removing complex conjugates

I've seen many implementations to filter out frequency components of some time domain signal by performing a DFT, zeroing the unwanted frequency bins, and performing the IDFT to get the filtered signal, but more than a few times I've seen the results of the DFT treated as frequency components from 0 to the sampling rate instead of 0 to half the sampling rate then the complex conjugates. Take for example this bandpass implementation by a group at MIT: https://github.com/diego898/matlab-utils/blob/master/toolbox/EVM_Matlab/ideal_bandpassing.m

It's defining the frequency bins and corresponding bandpass filter as

Freq = 1:n;
Freq = (Freq-1)/n*samplingRate;
mask = Freq > wl & Freq < wh;


n being the number of samples and wl and wh being the low and high frequencies respectively.

My first intuition is that that's incorrect, but it makes me wonder if I'm missing something since I've seen it done this way multiple times.

But the more interesting question to me is, assuming it is wrong: what physical meaning, if any, does removing one but not both of these complex conjugates have? For example, if I used the above bandpass implementation to make a low-pass filter which filtered out one half the sampling frequency, I would keep the DC component and all the first complex values. But then I would remove all of their conjugates. While I don't actually think that's the low pass filter intended, it does still have the effect of smoothing out the signal, but how would you describe that? I don't imagine it's still considered a temporal filter in that case.

• opening statement: "I've seen many implementations to filter out frequency components of some time domain signal by performing a DFT, zeroing the unwanted frequency bins, and performing the IDFT to get the filtered signal..." --- i have never seen such an implementation work in general. it can work for the case of periodic signals where the DFT length is the same as one period (then the "DFT" is the "DFS"). but that does not work for, say, "Fast Convolution" – robert bristow-johnson Jul 18 '15 at 4:33
• The process of removing one but not both of the conjugates is called I/Q demodulation. A good question/answer can be found on the EE site here. – AnonSubmitter85 Oct 15 '15 at 18:16

Here is a different way to look at it:

The violation of complex conjugate symmetry produces and "error". That error is, that the impulse response becomes complex. By applying the "real()" operator on the inverse FFT, the error is eliminated again.

• That trickery gives a gain of 0.5 though. – Olli Niemitalo Oct 15 '15 at 17:43
• I don't think this is true. The band that is left in the negative frequencies will now be a complex signal with both real and imaginary components. – AnonSubmitter85 Oct 15 '15 at 18:15

If the filtered result in the frequency domain is no longer conjugate symmetric, then then the time domain result after a full IFFT will be complex, not real.

If one ignores the imaginary component of this complex time domain result, then all the sine components will be thrown away. Sure the signal will be filtered, but a lot more will be filtered out than expected.

But they might might be doing an inverseRealFFT, which essentially forces the input to a full IFFT be conjugate symmetric, thus ignoring the incorrectly filtered upper or negative portion of the FFT vector.

• It looks like they're applying a normal IFFT and grabbing the real parts. By inverseRealFFT, is the process to change the second half of the array to the complex conjugates of the first half and then apply an IFFT? If they were doing that I could see how that code could work, though it doesn't look like it. So then the interpretation is they're removing more sine components than they should be (or, in some bandpass cases, not removing sine components when they should). And removing one component but not the other means the power of that frequency in the signal is reduced but not eliminated? – Anthony Jun 17 '15 at 12:39