# Synthesize FIR filters using high-school algebra (Part 2)

Here's where we make an important substitution. Until now, our z has been a mystery variable with no obvious relationship to the behaviour of a sinewave. Let's introduce the expression that actually defines the z-transform. The key relationships between z , z^-1 and the frequency f of a sinewave input can be expressed in either an exponential or a trig format:

where fs is the sample rate. You can make a mental connection to the effect of a small time delay (equal to the sampling interval) on the phase of a sinewave of frequency f. z is a complex variable that 'rotates round' the complex plane between purely real and purely imaginary, as the frequency f affects the argument of the trig functions.

You'll often encounter the exponential form [3] in filter books, but the complex trig form of [4] somehow seems more relevant to the engineer's habit of stuffing a sinewave into something and seeing what happens. So, let's substitute [4] into Part 1's equation [3] and see if we can develop an expression for the frequency response.

The first line of the boxed portion of [5] shows the real part, and the second line shows the imaginary part. Now, for a quadratic section to give a null in the frequency response, there must be a frequency fn for which Q(fn)=0. This means that both the real and the imaginary parts of equation [5] must be identically zero at that frequency. It should be easy to see that for the imaginary term in [5] to vanish for a frequency fn, we simply need to have

and if this is the case, we can substitute it back into the real part of [5] and set that to equal zero, from which we get

Bingo! This corroborates our earlier observation, and what's more, it gives us a direct expression for the quadratic factor that's needed in order to locate a frequency response null at any fn that we want. Figure 2 shows the frequency response of quadratic factors (three-tap filters) built using equation [8], for several notch frequencies.

Equations [6] and [7] give the real and imaginary parts, and we can see that there are some special cases. For zero frequency (z term = -2) and half the sample rate (z term = +2), the factor Q(z) is the product of two equal real factors, either (z-1)*(z-1) or (z+1)*(z+1). For a frequency of Fs/4, the roots are purely imaginary, and Q(z)=(z+j)*(z-j).

**Figure 2: Factors of the form of equation [8] for various values of null frequency**