# Applying zero-phase filtering in the frequency domain - also works in real-time?

In my application a filtering in the frequency space is desired. I designed two high-pass filters: $$h_1$$ Butterworth IIR filter, and $$h_2$$ FIR. I designed them using Python's SciPy functions. Using signal.freqz I obtained the frequency response $$H_1(k)$$ and $$H_2(k)$$.

I now want to filter signal in a real-time, buffer-wise. I read buffers of certain size, say $$N=2048$$, and do a DFT and obtain $$F(k)$$. I then want to multiply the Fourier coefficient with the two filters frequency response: $$G_i(k) = F(K) H_i(k)$$ for $$i=1,2$$. Then I do inverse DFT to get the filtered signal. (Remark: in practice I use overlap/add in the buffering, and so recovering back the filtered signal in time domain requires windowing and is more complicated.)

Now for the questions:

Multiplying $$F(k)$$ by $$|H_1(k)|$$ seems to work, even in real-time. But multiplying by the absolute value is like performing zero-phase filtering, which by theory is non-causal. However, since I apply it buffer-wise, this seems to be the loophole. Am I correct?

I also filtered using $$F(k) H_2(K)$$ and in Python it works just fine. However, giving the list of coefficient $$\{ H_2(k) \in \mathbb{C} \mid k=0,...,N/2 \}$$ for a colleague, for her to filter in another application/software, the filtering didn't seem to work. The filtered signal was a total mess (the unfiltered signal is a short speech by a woman). I verified with her that she applied the filter with the "mirror conjugate" completion so $$\tilde{H}_2 = (H_2(k), \overline{H_2(N/2+1-k)}) \in \mathbb{C}^N$$. Is there a theoretical reason for it not to work? (so we can narrow the reason to a bug in her code)

• Are you sure that it is zero phase and not linear phase due to the delay of the buffer? Sep 2, 2020 at 16:13
• Good question. I am not sure of the answer, but think that since we multiply in a positive real frequency response, the filtering introduces 0 phase. Sep 3, 2020 at 12:05

• But why the zero-phase filtering $F(k)|H_1(k)|$ of the IIR works? Sep 7, 2020 at 14:50