# Issue understanding implementing digital filters in practice

I am reading Introduction to Digital Filters by J.O Smith III, which is an amazing book. The part for which I have a question is quoted below.

By virtue of Euler's relation and the linearity of the filter, setting the input to $$x(n) = e^{j\omega nT}$$ is physically equivalent to putting $$\cos(\omega nT)$$ into one copy of the filter and $$\sin(\omega nT)$$ into a separate copy of the same filter. The signal path where the cosine goes in is the real part of the signal, and the other signal path is simply called the imaginary part. Thus, a complex signal in real life is implemented as two real signals processed in parallel; in particular, a complex sinusoid is implemented as two real sinusoids, side by side, one-quarter cycle out of phase. When the filter itself is real, two copies of it suffice to process a complex signal. If the filter is complex, we must implement complex multiplies between the complex signal samples and filter coefficients.

I am having difficulty understanding the part in bold. Could someone kindly shed light on this? For example, why do we need two copies of the filter?

A real operation on a complex input can be implemented as two real operations in parallelle, rather than a truely complex operation.

An example would be multiplying a complex number with a real number. Rather than a full complex multiply, you get away with two real multiplies, one for the real part of the input, another for the imaginary part.

-k

Let's look at a simple convolution sum:

$$y[n] = \sum_{k=0}^{N-1} h[k] \cdot x[n-k]$$

where $$h[n]$$ is the impulse response of the filter and $$x[n]$$ is the input signal. If both are complex we can rewrite this as

$$y[n] = \sum_{k=0}^{N-1} h_r[k]x_r[n-k] - h_i[k]x_i[n-k] +j \cdot (h_r[k]x_i[n-k] + h_i[k]x_r[n-k]) = \ \sum_{k=0}^{N-1} h_r[k]x_r[n-k] - \sum_{k=0}^{N-1} h_i[k]x_i[n-k] +j\sum_{k=0}^{N-1} h_r[k]x_i[n-k] + j\sum_{k=0}^{N-1} h_i[k]x_r[n-k]$$

That is the most general case: a complex convolution consists of 4 real convolution sums. If any of the signal or impulse response is real (i.e. $$x_i = 0$$ and or $$h_i =$$) than the associated convolution sum is zero as well, so you end up with only two (one is real) or one (both are real) real convolution sums. The output is only real if both input and impulse response are real too.

Complex multiplication involves a cross product that rotates the vectors during filtering. If a sample of signal X is complex and a tap of filter Y is complex:

complex mul: X * Y = Xreal * Yreal - Ximag * Yimag + i * (Xreal * Yimag + Ximag * Yreal)

which requires 4 multiplies, which can be done with 4 parallel filters, plus a summation unit.

If the filter Y is strictly real (e.g. all taps of filter Yi are zero), this reduces to:

X * Y = Xreal * Y + i * (Ximag * Y)

thus reducing the 4 real multiplies to only 2 real multiplies which can be done with only two copies of the (real multiplying) filter units, or one copy run twice (or twice as fast) to handle both Xr and Xi vectors independently.