Tuesday, June 8, 2010

The unit delay operator

The transfer function of a digital filter

In the last section, we used two different ways of expressing the action of a digital filter: a form giving the output yn directly, and a "symmetrical" form with all the output terms (y's) on one side and all the input terms (x's) on the other.

In this section, we introduce what is called the transfer function of a digital filter. This is obtained from the symmetrical form of the filter expression, and it allows us to describe a filter by means of a convenient, compact expression. Tthe transfer function of a filter can be used to determine many of the characteristics of the filter, such as its frequency response.

The unit delay operator

First of all, we must introduce the unit delay operator, denoted by the symbol

z-1

When applied to a sequence of digital values, this operator gives the previous value in the sequence. It therefore in effect introduces a delay of one sampling interval.

Applying the operator z-1 to an input value (say xn) gives the previous input (xn-1):

z-1 xn = xn-1

Suppose we have an input sequence

x0 = 5
x1 = -2
x2 = 0
x3 = 7
x4 = 10

Then

z-1 x1 = x0 = 5
z-1 x2 = x1 = -2
z-1 x3 = x2 = 0

and so on. Note that z-1 x0 would be x-1 which is unknown (and usually taken to be zero, as we have already seen).

Similarly, applying the z-1 operator to an output gives the previous output:

z-1 yn = yn-1

Applying the delay operator z-1 twice produces a delay of two sampling intervals:

z-1 (z-1 xn) = z-1 xn-1 = xn-2

We adopt the (fairly logical) convention

z-1 z-1 = z-2

i.e. the operator z-2 represents a delay of two sampling intervals:

z-2 xn = xn-2

This notation can be extended to delays of three or more sampling intervals, the appropriate power of z-1 being used.

Let us now use this notation in the description of a recursive digital filter. Consider, for example, a general second-order filter, given in its symmetrical form by the expression

b0yn + b1yn-1 + b2yn-2 = a0xn + a1xn-1 + a2xn-2

We will make use of the following identities:

yn-1 = z-1 yn

yn-2 = z-2 yn

xn-1 = z-1 xn

xn-2 = z-2 xn

Substituting these expressions into the digital filter gives

(b0 + b1z-1 + b2z-2) yn = (a0 + a1z-1 + a2z-2) xn

Rearranging this to give a direct relationship between the output and input for the filter, we get

yn / xn = (a0 + a1z-1 + a2z-2) / (b0 + b1z-1 + b2z-2)

This is the general form of the transfer function for a second-order recursive (IIR) filter.

For a first-order filter, the terms in z-2 are omitted. For filters of order higher than 2, further terms involving higher powers ofz-1 are added to both the numerator and denominator of the transfer function.

A non-recursive (FIR) filter has a simpler transfer function which does not contain any denominator terms. The coefficient b0 is regarded as being equal to 1, and all the other b coefficients are zero. The transfer function of a second-order FIR filter can therefore be expressed in the general form

yn / xn = a0 + a1z-1 + a2z-2

Transfer function examples

  1. The three-term average filter, defined by the expression

    yn = 1/3 (xn + xn-1 + xn-2)

    can be written using the z-1 operator notation as

    yn = 1/3 (xn + z-1xn + z-2xn)

    = 1/3 (1 + z-1 + z-2) xn

    The transfer function for the filter is therefore

    yn / xn = 1/3 (1 + z-1 + z-2)

  2. The general form of the transfer function for a first-order recursive filter can be written

    yn / xn = (a0 + a1z-1) / (b0 + b1z-1)

    Consider, for example, the simple first-order recursive filter

    yn = xn + yn-1

    which we discussed earlier. To derive the transfer function for this filter, we rewrite the filter expression using the z-1 operator:

    (1 - z-1) yn = xn

    Rearranging gives the filter transfer function as

    yn / xn = 1 / (1 - z-1)

  3. As a further example, consider the second-order IIR filter

    yn = xn + 2xn-1 + xn-2 - 2yn-1 + yn-2

    Collecting output terms on the left and input terms on the right to give the "symmetrical" form of the filter expression, we get

    yn + 2yn-1 - yn-2 = xn + 2xn-1 + xn-2

    Expressing this in terms of the z-1 operator gives

    (1 + 2z-1 - z-2) yn = (1 + 2z-1 + z-2) xn

    and so the transfer function is

    yn / xn = (1 + 2z-1 + z-2) / (1 + 2z-1 - z-2)

No comments:

Post a Comment