Sei sulla pagina 1di 125

10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

10: Digital Filter Structures

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 1 / 19

Direct Forms
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

B(z)

Filter: H(z) = A(z) with input x[n] and output y[n]

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 2 / 19

Direct Forms
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

B(z)

Filter: H(z) = A(z) with input x[n] and output y[n]

y[n] =

PM

k=0 b[k]x[n

k]

PN

k=1 a[k]y[n

k]

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 2 / 19

Direct Forms
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

B(z)

Filter: H(z) = A(z) with input x[n] and output y[n]

y[n] =

PM

k=0 b[k]x[n

k]

PN

k=1 a[k]y[n

k]

Direct forms use coefficients a[k] and b[k] directly

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 2 / 19

Direct Forms
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

B(z)

Filter: H(z) = A(z) with input x[n] and output y[n]

y[n] =

PM

k=0 b[k]x[n

k]

PN

k=1 a[k]y[n

k]

Direct forms use coefficients a[k] and b[k] directly


Direct Form 1:

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 2 / 19

Direct Forms
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

B(z)

Filter: H(z) = A(z) with input x[n] and output y[n]

y[n] =

PM

k=0 b[k]x[n

k]

PN

k=1 a[k]y[n

k]

Direct forms use coefficients a[k] and b[k] directly


Direct Form 1:
Direct implementation of difference equation

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 2 / 19

Direct Forms
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

B(z)

Filter: H(z) = A(z) with input x[n] and output y[n]

y[n] =

PM

k=0 b[k]x[n

k]

PN

k=1 a[k]y[n

k]

Direct forms use coefficients a[k] and b[k] directly


Direct Form 1:
Direct implementation of difference equation
1
Can view as B(z) followed by A(z)

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 2 / 19

Direct Forms
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

B(z)

Filter: H(z) = A(z) with input x[n] and output y[n]

y[n] =

PM

k=0 b[k]x[n

k]

PN

k=1 a[k]y[n

k]

Direct forms use coefficients a[k] and b[k] directly


Direct Form 1:
Direct implementation of difference equation
1
Can view as B(z) followed by A(z)
Direct Form II:

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 2 / 19

Direct Forms
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

B(z)

Filter: H(z) = A(z) with input x[n] and output y[n]

y[n] =

PM

k=0 b[k]x[n

k]

PN

k=1 a[k]y[n

k]

Direct forms use coefficients a[k] and b[k] directly


Direct Form 1:
Direct implementation of difference equation
1
Can view as B(z) followed by A(z)
Direct Form II:
1
Implements A(z)
followed by B(z)

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 2 / 19

Direct Forms
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example
Numerator

Summary
MATLAB routines

B(z)

Filter: H(z) = A(z) with input x[n] and output y[n]

y[n] =

PM

k=0 b[k]x[n

k]

PN

k=1 a[k]y[n

k]

Direct forms use coefficients a[k] and b[k] directly


Direct Form 1:
Direct implementation of difference equation
1
Can view as B(z) followed by A(z)
Direct Form II:
1
Implements A(z)
followed by B(z)
Saves on delays (= storage)

DSP and Digital Filters (2014-5560)

Structures: 10 2 / 19

Transposition
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Can convert any block diagram into an equivalent transposed form:

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 3 / 19

Transposition
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Can convert any block diagram into an equivalent transposed form:


Reverse direction of each interconnection

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 3 / 19

Transposition
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Can convert any block diagram into an equivalent transposed form:


Reverse direction of each interconnection
Reverse direction of each multiplier

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 3 / 19

Transposition
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Can convert any block diagram into an equivalent transposed form:


Reverse direction of each interconnection
Reverse direction of each multiplier
Change junctions to adders and vice-versa

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 3 / 19

Transposition
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Can convert any block diagram into an equivalent transposed form:


Reverse direction of each interconnection
Reverse direction of each multiplier
Change junctions to adders and vice-versa
Interchange the input and output signals

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 3 / 19

Transposition
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Can convert any block diagram into an equivalent transposed form:


Reverse direction of each interconnection
Reverse direction of each multiplier
Change junctions to adders and vice-versa
Interchange the input and output signals
Example:
Direct form II Direct Form IIt

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 3 / 19

Transposition
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Can convert any block diagram into an equivalent transposed form:


Reverse direction of each interconnection
Reverse direction of each multiplier
Change junctions to adders and vice-versa
Interchange the input and output signals
Example:
Direct form II Direct Form IIt

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 3 / 19

Transposition
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Can convert any block diagram into an equivalent transposed form:


Reverse direction of each interconnection
Reverse direction of each multiplier
Change junctions to adders and vice-versa
Interchange the input and output signals
Example:
Direct form II Direct Form IIt
Would normally be drawn with input on the left

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 3 / 19

Transposition
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example
Numerator

Can convert any block diagram into an equivalent transposed form:


Reverse direction of each interconnection
Reverse direction of each multiplier
Change junctions to adders and vice-versa
Interchange the input and output signals
Example:
Direct form II Direct Form IIt
Would normally be drawn with input on the left
Note: A valid block diagram must never have any feedback loops that dont
go through a delay (z 1 block).

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 3 / 19

State Space
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

v[n] is a vector of delay element outputs


Can write: v[n + 1] = Pv[n] + qx[n]

y[n] = rT v[n] + sx[n]

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 4 / 19

State Space
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

v[n] is a vector of delay element outputs


Can write: v[n + 1] = Pv[n] + qx[n]

y[n] = rT v[n] + sx[n]

Numerator

Summary
MATLAB routines

Example: Direct Form IIt

P=

DSP and Digital Filters (2014-5560)

a[1] 1
a[2] 0

Structures: 10 4 / 19

State Space
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

v[n] is a vector of delay element outputs


Can write: v[n + 1] = Pv[n] + qx[n]

y[n] = rT v[n] + sx[n]

Numerator

Summary
MATLAB routines

Example: Direct Form IIt

P=

DSP and Digital Filters (2014-5560)

a[1] 1
a[2] 0

q=

b[1] b[0]a[1]
b[2] b[0]a[2]

Structures: 10 4 / 19

State Space
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

v[n] is a vector of delay element outputs


Can write: v[n + 1] = Pv[n] + qx[n]

y[n] = rT v[n] + sx[n]

Numerator

Summary
MATLAB routines

Example: Direct Form IIt

P=
rT =

DSP and Digital Filters (2014-5560)

a[1] 1
a[2] 0

1 0

q=

b[1] b[0]a[1]
b[2] b[0]a[2]

Structures: 10 4 / 19

State Space
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

v[n] is a vector of delay element outputs


Can write: v[n + 1] = Pv[n] + qx[n]

y[n] = rT v[n] + sx[n]

Numerator

Summary
MATLAB routines

Example: Direct Form IIt

P=
rT =

DSP and Digital Filters (2014-5560)

a[1] 1
a[2] 0

1 0

q=

b[1] b[0]a[1]
b[2] b[0]a[2]

s = b[0]

Structures: 10 4 / 19

State Space
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

v[n] is a vector of delay element outputs


Can write: v[n + 1] = Pv[n] + qx[n]

y[n] = rT v[n] + sx[n]




T
P, q, r , s is the state-space
representation of the filter structure.

Numerator

Summary
MATLAB routines

Example: Direct Form IIt

P=
rT =

DSP and Digital Filters (2014-5560)

a[1] 1
a[2] 0

1 0

q=

b[1] b[0]a[1]
b[2] b[0]a[2]

s = b[0]

Structures: 10 4 / 19

State Space
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

v[n] is a vector of delay element outputs


Can write: v[n + 1] = Pv[n] + qx[n]

y[n] = rT v[n] + sx[n]




T
P, q, r , s is the state-space
representation of the filter structure.

The transfer function is given by:

H(z) =

B(z)
A(z)

det(zIP+qrT )
det(zIP)

+s1

Numerator

Summary
MATLAB routines

Example: Direct Form IIt

P=
rT =

DSP and Digital Filters (2014-5560)

a[1] 1
a[2] 0

1 0

q=

b[1] b[0]a[1]
b[2] b[0]a[2]

s = b[0]

Structures: 10 4 / 19

State Space
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

v[n] is a vector of delay element outputs


Can write: v[n + 1] = Pv[n] + qx[n]

y[n] = rT v[n] + sx[n]




T
P, q, r , s is the state-space
representation of the filter structure.

The transfer function is given by:

H(z) =

B(z)
A(z)

det(zIP+qrT )
det(zIP)

+s1

Numerator

Summary
MATLAB routines

Example: Direct Form IIt

P=
rT =

a[1] 1
a[2] 0

1 0

From which H(z) =


DSP and Digital Filters (2014-5560)

q=

b[1] b[0]a[1]
b[2] b[0]a[2]

s = b[0]
b[0]z 2 +b[1]z+b[2]
z 2 +a[1]z+a[2]
Structures: 10 4 / 19

State Space
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

v[n] is a vector of delay element outputs


Can write: v[n + 1] = Pv[n] + qx[n]

y[n] = rT v[n] + sx[n]




T
P, q, r , s is the state-space
representation of the filter structure.

The transfer function is given by:

H(z) =

B(z)
A(z)

det(zIP+qrT )
det(zIP)
T

The transposed form has P P

+s1

and q r

same H(z)

Numerator

Summary
MATLAB routines

Example: Direct Form IIt

P=
rT =

a[1] 1
a[2] 0

1 0

From which H(z) =


DSP and Digital Filters (2014-5560)

q=

b[1] b[0]a[1]
b[2] b[0]a[2]

s = b[0]
b[0]z 2 +b[1]z+b[2]
z 2 +a[1]z+a[2]
Structures: 10 4 / 19

Precision Issues
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

If all computations were exact, it would not make any difference which of
the equivalent structures was used.

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 5 / 19

Precision Issues
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

If all computations were exact, it would not make any difference which of
the equivalent structures was used. However ...

Coefficient precision

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 5 / 19

Precision Issues
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

If all computations were exact, it would not make any difference which of
the equivalent structures was used. However ...

Coefficient precision
Coefficients are stored to finite precision and so are not exact.

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 5 / 19

Precision Issues
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

If all computations were exact, it would not make any difference which of
the equivalent structures was used. However ...

Coefficient precision
Coefficients are stored to finite precision and so are not exact.
The filter actually implemented is therefore incorrect.

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 5 / 19

Precision Issues
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

If all computations were exact, it would not make any difference which of
the equivalent structures was used. However ...

Coefficient precision
Coefficients are stored to finite precision and so are not exact.
The filter actually implemented is therefore incorrect.

Arithmetic precision
Arithmetic calculations are not exact.

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 5 / 19

Precision Issues
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

If all computations were exact, it would not make any difference which of
the equivalent structures was used. However ...

Coefficient precision
Coefficients are stored to finite precision and so are not exact.
The filter actually implemented is therefore incorrect.

Arithmetic precision
Arithmetic calculations are not exact.
Worst case for arithmetic errors is when calculating the
difference between two similar values:

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 5 / 19

Precision Issues
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

If all computations were exact, it would not make any difference which of
the equivalent structures was used. However ...

Coefficient precision
Coefficients are stored to finite precision and so are not exact.
The filter actually implemented is therefore incorrect.

Arithmetic precision

Numerator

Arithmetic calculations are not exact.


Worst case for arithmetic errors is when calculating the
difference between two similar values:
1.23456789 1.23455678 = 0.00001111: 9 s.f. 4 s.f.

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 5 / 19

Precision Issues
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

If all computations were exact, it would not make any difference which of
the equivalent structures was used. However ...

Coefficient precision
Coefficients are stored to finite precision and so are not exact.
The filter actually implemented is therefore incorrect.

Arithmetic precision

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Arithmetic calculations are not exact.


Worst case for arithmetic errors is when calculating the
difference between two similar values:
1.23456789 1.23455678 = 0.00001111: 9 s.f. 4 s.f.
Arithmetic errors introduce noise that is then filtered by the transfer
function between the point of noise creation and the output.

Structures: 10 5 / 19

Coefficient Sensitivity
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

The roots of high order polynomials can be very sensitive to small changes
in coefficient values.

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 6 / 19

Coefficient Sensitivity
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

The roots of high order polynomials can be very sensitive to small changes
in coefficient values.
Wilkinsons polynomial: (famous example)

f (x) =

Q20

20
19
18
(x

n)
=
x

210x
+
20615x
...
n=1

has roots well separated on the real axis.

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 6 / 19

Coefficient Sensitivity
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

The roots of high order polynomials can be very sensitive to small changes
in coefficient values.
Wilkinsons polynomial: (famous example)

f (x) =

Q20

20
19
18
(x

n)
=
x

210x
+
20615x
...
n=1

has roots well separated on the real axis.

Numerator

Summary
MATLAB routines

-5
0

DSP and Digital Filters (2014-5560)

10

15

20

25

Structures: 10 6 / 19

Coefficient Sensitivity
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

The roots of high order polynomials can be very sensitive to small changes
in coefficient values.
Wilkinsons polynomial: (famous example)

f (x) =

Q20

20
19
18
(x

n)
=
x

210x
+
20615x
...
n=1

has roots well separated on the real axis.


Multiplying the coefficient of x19 by 1.000001 moves the roots a lot.

Numerator

Summary
MATLAB routines

-5
0

DSP and Digital Filters (2014-5560)

10

15

20

25

Structures: 10 6 / 19

Coefficient Sensitivity
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

The roots of high order polynomials can be very sensitive to small changes
in coefficient values.
Wilkinsons polynomial: (famous example)

f (x) =

Q20

20
19
18
(x

n)
=
x

210x
+
20615x
...
n=1

has roots well separated on the real axis.


Multiplying the coefficient of x19 by 1.000001 moves the roots a lot.

Numerator

Summary
MATLAB routines

-5

-5

DSP and Digital Filters (2014-5560)

10

15

20

25

10

15

20

25

Structures: 10 6 / 19

Coefficient Sensitivity
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

The roots of high order polynomials can be very sensitive to small changes
in coefficient values.
Wilkinsons polynomial: (famous example)

f (x) =

Q20

20
19
18
(x

n)
=
x

210x
+
20615x
...
n=1

has roots well separated on the real axis.


Multiplying the coefficient of x19 by 1.000001 moves the roots a lot.
Speaking for myself I regard it as the most traumatic experience in
my career as a numerical analyst, James Wilkinson 1984

Numerator

Summary
MATLAB routines

-5

-5

DSP and Digital Filters (2014-5560)

10

15

20

25

10

15

20

25

Structures: 10 6 / 19

Coefficient Sensitivity
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

The roots of high order polynomials can be very sensitive to small changes
in coefficient values.
Wilkinsons polynomial: (famous example)

f (x) =

Q20

20
19
18
(x

n)
=
x

210x
+
20615x
...
n=1

has roots well separated on the real axis.


Multiplying the coefficient of x19 by 1.000001 moves the roots a lot.
Speaking for myself I regard it as the most traumatic experience in
my career as a numerical analyst, James Wilkinson 1984

Numerator

Summary
MATLAB routines

-5

-5

10

15

20

25

10

15

20

25

Moral: Avoid using direct form for filters orders over about 10.

DSP and Digital Filters (2014-5560)

Structures: 10 6 / 19

Cascaded Biquads
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Avoid high order polynomials by factorizing into quadratic terms:


B(z)
A(z)

Q
(1+bk,1 z1 +bk,2 z2 )
Q
g (1+ak,1 z1 +ak,2 z2 )

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 7 / 19

Cascaded Biquads
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Avoid high order polynomials by factorizing into quadratic terms:


B(z)
A(z)

Q
(1+bk,1 z1 +bk,2 z2 )
Q
g (1+ak,1 z1 +ak,2 z2 ) =

1+bk,1 z 1 +bk,2 z 2
k=1 1+ak,1 z 1 +ak,2 z 2

QK

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 7 / 19

Cascaded Biquads
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Avoid high order polynomials by factorizing into quadratic terms:


B(z)
A(z)

Q
(1+bk,1 z1 +bk,2 z2 )
Q
g (1+ak,1 z1 +ak,2 z2 ) =

1+bk,1 z 1 +bk,2 z 2
k=1 1+ak,1 z 1 +ak,2 z 2

QK

 M   N 
.
where K = max
2 ,
2

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 7 / 19

Cascaded Biquads
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Avoid high order polynomials by factorizing into quadratic terms:


B(z)
A(z)

Q
(1+bk,1 z1 +bk,2 z2 )
Q
g (1+ak,1 z1 +ak,2 z2 ) =

1+bk,1 z 1 +bk,2 z 2
k=1 1+ak,1 z 1 +ak,2 z 2

QK

 M   N 
.
where K = max
2 ,
2

The term

1+bk,1 z 1 +bk,2 z 2
1+ak,1 z 1 +ak,2 z 2

is a biquad (bi-quadratic section).

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 7 / 19

Cascaded Biquads
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Avoid high order polynomials by factorizing into quadratic terms:


B(z)
A(z)

Q
(1+bk,1 z1 +bk,2 z2 )
Q
g (1+ak,1 z1 +ak,2 z2 ) =

1+bk,1 z 1 +bk,2 z 2
k=1 1+ak,1 z 1 +ak,2 z 2

QK

 M   N 
.
where K = max
2 ,
2

The term

1+bk,1 z 1 +bk,2 z 2
1+ak,1 z 1 +ak,2 z 2

is a biquad (bi-quadratic section).

Numerator

Summary
MATLAB routines

Direct Form II
Transposed

DSP and Digital Filters (2014-5560)

Structures: 10 7 / 19

Cascaded Biquads
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Avoid high order polynomials by factorizing into quadratic terms:


B(z)
A(z)

Q
(1+bk,1 z1 +bk,2 z2 )
Q
g (1+ak,1 z1 +ak,2 z2 ) =

1+bk,1 z 1 +bk,2 z 2
k=1 1+ak,1 z 1 +ak,2 z 2

QK

 M   N 
.
where K = max
2 ,
2

The term

1+bk,1 z 1 +bk,2 z 2
1+ak,1 z 1 +ak,2 z 2

is a biquad (bi-quadratic section).

We need to choose:
(a) which poles to pair with which zeros in each biquad

Numerator

Summary
MATLAB routines

Direct Form II
Transposed

DSP and Digital Filters (2014-5560)

Structures: 10 7 / 19

Cascaded Biquads
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example
Numerator

Summary
MATLAB routines

Avoid high order polynomials by factorizing into quadratic terms:


B(z)
A(z)

Q
(1+bk,1 z1 +bk,2 z2 )
Q
g (1+ak,1 z1 +ak,2 z2 ) =

1+bk,1 z 1 +bk,2 z 2
k=1 1+ak,1 z 1 +ak,2 z 2

QK

 M   N 
.
where K = max
2 ,
2

The term

1+bk,1 z 1 +bk,2 z 2
1+ak,1 z 1 +ak,2 z 2

is a biquad (bi-quadratic section).

We need to choose:
(a) which poles to pair with which zeros in each biquad
(b) how to order the biquads

Direct Form II
Transposed

DSP and Digital Filters (2014-5560)

Structures: 10 7 / 19

Pole-zero Pairing/Ordering
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Example: Elliptic lowpass filter

1
0.5
0
-0.5
-1
-1

0
z

Numerator

Summary
MATLAB routines

Gain (dB)

20
0
-20
-40
0

DSP and Digital Filters (2014-5560)

0.5

1.5

2.5

Structures: 10 8 / 19

Pole-zero Pairing/Ordering
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Example: Elliptic lowpass filter


2 pole pairs and 2 zero pairs

1
0.5
0
-0.5
-1
-1

0
z

Numerator

Summary
MATLAB routines

Gain (dB)

20
0
-20
-40
0

DSP and Digital Filters (2014-5560)

0.5

1.5

2.5

Structures: 10 8 / 19

Pole-zero Pairing/Ordering
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Example: Elliptic lowpass filter


2 pole pairs and 2 zero pairs
need 2 biquads

1
0.5
0
-0.5
-1
-1

0
z

Numerator

Summary
MATLAB routines

Gain (dB)

20
0
-20
-40
0

DSP and Digital Filters (2014-5560)

0.5

1.5

2.5

Structures: 10 8 / 19

Pole-zero Pairing/Ordering
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Example: Elliptic lowpass filter


2 pole pairs and 2 zero pairs
need 2 biquads
Noise introduced in one biquad is amplified
by all the subsequent ones:

1
0.5
0
-0.5
-1
-1

0
z

Numerator

Summary
MATLAB routines

Gain (dB)

20
0
-20
-40
0

DSP and Digital Filters (2014-5560)

0.5

1.5

2.5

Structures: 10 8 / 19

Pole-zero Pairing/Ordering
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Example: Elliptic lowpass filter


2 pole pairs and 2 zero pairs
need 2 biquads
Noise introduced in one biquad is amplified
by all the subsequent ones:

1
0.5
0
-0.5
-1
-1

0
z

Make the peak gain of each biquad as small as possible

Numerator

Summary
MATLAB routines

Gain (dB)

20
0
-20
-40
0

DSP and Digital Filters (2014-5560)

0.5

1.5

2.5

Structures: 10 8 / 19

Pole-zero Pairing/Ordering
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Example: Elliptic lowpass filter


2 pole pairs and 2 zero pairs
need 2 biquads
Noise introduced in one biquad is amplified
by all the subsequent ones:

1
0.5
0
-0.5
-1
-1

0
z

Make the peak gain of each biquad as small as possible


Pair poles with nearest zeros to get lowest peak gain

Numerator

Summary
MATLAB routines

Nearest

Gain (dB)

20
0
-20
-40
0

DSP and Digital Filters (2014-5560)

0.5

1.5

2.5

Structures: 10 8 / 19

Pole-zero Pairing/Ordering
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Example: Elliptic lowpass filter


2 pole pairs and 2 zero pairs
need 2 biquads
Noise introduced in one biquad is amplified
by all the subsequent ones:

1
0.5
0
-0.5
-1
-1

0
z

Make the peak gain of each biquad as small as possible


Pair poles with nearest zeros to get lowest peak gain
begin with the pole nearest the unit circle

Numerator

Summary
MATLAB routines

Nearest

Gain (dB)

20
0
-20
-40
0

DSP and Digital Filters (2014-5560)

0.5

1.5

2.5

Structures: 10 8 / 19

Pole-zero Pairing/Ordering
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Example: Elliptic lowpass filter

1
0.5

2 pole pairs and 2 zero pairs


need 2 biquads

0
-0.5
-1

Noise introduced in one biquad is amplified


by all the subsequent ones:

-1

0
z

Make the peak gain of each biquad as small as possible


Pair poles with nearest zeros to get lowest peak gain

begin with the pole nearest the unit circle


Pairing with farthest zeros gives higher peak biquad gain

Numerator

Summary
MATLAB routines

Nearest

0
-20
-40
0

DSP and Digital Filters (2014-5560)

0.5

1.5

2.5

Farthest

20
Gain (dB)

Gain (dB)

20

0
-20
-40
0

0.5

1.5

2.5

Structures: 10 8 / 19

Pole-zero Pairing/Ordering
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Example: Elliptic lowpass filter

1
0.5

2 pole pairs and 2 zero pairs


need 2 biquads

0
-0.5
-1

Noise introduced in one biquad is amplified


by all the subsequent ones:

-1

0
z

Make the peak gain of each biquad as small as possible


Pair poles with nearest zeros to get lowest peak gain

begin with the pole nearest the unit circle


Pairing with farthest zeros gives higher peak biquad gain

Numerator

Poles near the unit circle have the highest peaks and introduce most

Summary
MATLAB routines

noise so place them last in the chain


Nearest

0
-20
-40
0

DSP and Digital Filters (2014-5560)

0.5

1.5

2.5

Farthest

20
Gain (dB)

Gain (dB)

20

0
-20
-40
0

0.5

1.5

2.5

Structures: 10 8 / 19

Linear Phase
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Implementation can take advantage of any symmetry in the coefficients.

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 9 / 19

Linear Phase
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Implementation can take advantage of any symmetry in the coefficients.


Linear phase filters are always FIR and have symmetric (or, more rarely,
antisymmetric) coefficients.

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 9 / 19

Linear Phase
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Implementation can take advantage of any symmetry in the coefficients.


Linear phase filters are always FIR and have symmetric (or, more rarely,
antisymmetric) coefficients.

H(z) =

PM

m
h[m]z
m=0

h[M m] = h[m]

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 9 / 19

Linear Phase
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Implementation can take advantage of any symmetry in the coefficients.


Linear phase filters are always FIR and have symmetric (or, more rarely,
antisymmetric) coefficients.

PM

m
h[M m] = h[m]
h[m]z
m=0
 M  M P M2 1

m
mM
= h 2 z 2 + m=0 h[m] z
+z

H(z) =

[m even]

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 9 / 19

Linear Phase
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Implementation can take advantage of any symmetry in the coefficients.


Linear phase filters are always FIR and have symmetric (or, more rarely,
antisymmetric) coefficients.

PM

m
h[M m] = h[m]
h[m]z
m=0
 M  M P M2 1

m
mM
= h 2 z 2 + m=0 h[m] z
+z

H(z) =

[m even]

For M even, we only need M


2 + 1 multiplies instead of M + 1.
We need M additions in each case.

Numerator

Summary
MATLAB routines

M = 6:

DSP and Digital Filters (2014-5560)

Structures: 10 9 / 19

Linear Phase
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Implementation can take advantage of any symmetry in the coefficients.


Linear phase filters are always FIR and have symmetric (or, more rarely,
antisymmetric) coefficients.

PM

m
h[M m] = h[m]
h[m]z
m=0
 M  M P M2 1

m
mM
= h 2 z 2 + m=0 h[m] z
+z

H(z) =

[m even]

For M even, we only need M


2 + 1 multiplies instead of M + 1.
We need M additions in each case.

Numerator

Summary
MATLAB routines

M = 6:
1
For M odd (no central coefficient), we only need M
+
2
2 multiplies.

DSP and Digital Filters (2014-5560)

Structures: 10 9 / 19

Hardware Implementation
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Software Implementation:
All that matters is the total number of multiplies and adds

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 10 / 19

Hardware Implementation
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Software Implementation:
All that matters is the total number of multiplies and adds
Hardware Implementation:
Delay elements (z 1 ) represent storage registers
The maximum clock speed is limited by the number of sequential
operations between registers

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 10 / 19

Hardware Implementation
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Software Implementation:
All that matters is the total number of multiplies and adds
Hardware Implementation:
Delay elements (z 1 ) represent storage registers
The maximum clock speed is limited by the number of sequential
operations between registers
Example: Symmetric Linear Phase Filter
Direct form: Maximum sequential delay = 4a + m

Numerator

a and m are the delays of adder and multiplier respectively

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 10 / 19

Hardware Implementation
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example
Numerator

Software Implementation:
All that matters is the total number of multiplies and adds
Hardware Implementation:
Delay elements (z 1 ) represent storage registers
The maximum clock speed is limited by the number of sequential
operations between registers
Example: Symmetric Linear Phase Filter
Direct form: Maximum sequential delay = 4a + m
Transpose form: Maximum sequential delay = a + m ,
a and m are the delays of adder and multiplier respectively

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 10 / 19

Allpass Filters
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Allpass filters have mirror image numerator and denominator coefficients:

b[n] = a[N n]

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 11 / 19

Allpass Filters
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Allpass filters have mirror image numerator and denominator coefficients:

b[n] = a[N n]

B(z) = z N A(z 1 )

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 11 / 19

Allpass Filters
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Allpass filters have mirror image numerator and denominator coefficients:

b[n] = a[N n]



j

H(e ) 1

B(z) = z N A(z 1 )

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 11 / 19

Allpass Filters
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Allpass filters have mirror image numerator and denominator coefficients:

b[n] = a[N n]



j

H(e ) 1

B(z) = z N A(z 1 )

There are several efficient structures, e.g.

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 11 / 19

Allpass Filters
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Allpass filters have mirror image numerator and denominator coefficients:

b[n] = a[N n]



j

H(e ) 1

B(z) = z N A(z 1 )

There are several efficient structures, e.g.

First Order: H(z) =

a[1]+z 1
1+a[1]z 1

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 11 / 19

Allpass Filters
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Allpass filters have mirror image numerator and denominator coefficients:

b[n] = a[N n]



j

H(e ) 1

B(z) = z N A(z 1 )

There are several efficient structures, e.g.

First Order: H(z) =

a[1]+z 1
1+a[1]z 1

Second Order: H(z) =

a[2]+a[1]z 1 +z 2
1+a[1]z 1 +a[2]z 2

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 11 / 19

Allpass Filters
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Allpass filters have mirror image numerator and denominator coefficients:

b[n] = a[N n]



j

H(e ) 1

B(z) = z N A(z 1 )

There are several efficient structures, e.g.

First Order: H(z) =

a[1]+z 1
1+a[1]z 1

Second Order: H(z) =

a[2]+a[1]z 1 +z 2
1+a[1]z 1 +a[2]z 2

Numerator

Summary
MATLAB routines

Allpass filters have a gain magnitude of 1 even with coefficient errors.

DSP and Digital Filters (2014-5560)

Structures: 10 11 / 19

Lattice Stage
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Suppose G is allpass: G(z) =

z N A(z 1 )
A(z)

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 12 / 19

Lattice Stage
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Suppose G is allpass: G(z) =

z N A(z 1 )
A(z)

V (z) = X(z) kGz 1 V (z)

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 12 / 19

Lattice Stage
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Suppose G is allpass: G(z) =

z N A(z 1 )
A(z)

V (z) = X(z) kGz 1 V (z)


V (z) =

1
1+kGz 1 X(z)

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 12 / 19

Lattice Stage
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Suppose G is allpass: G(z) =

z N A(z 1 )
A(z)

V (z) = X(z) kGz 1 V (z)


V (z) =

1
1+kGz 1 X(z)

Y (z) = kV (z) + Gz 1 V (z)

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 12 / 19

Lattice Stage
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Suppose G is allpass: G(z) =

z N A(z 1 )
A(z)

V (z) = X(z) kGz 1 V (z)


V (z) =

1
1+kGz 1 X(z)

Y (z) = kV (z) + Gz

V (z) =

k+z 1 G
1+kGz 1 X(z)

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 12 / 19

Lattice Stage
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Suppose G is allpass: G(z) =

z N A(z 1 )
A(z)

V (z) = X(z) kGz 1 V (z)


V (z) =

1
1+kGz 1 X(z)

Y (z) = kV (z) + Gz
If |k| < 1 then

Y (z)
X(z)

V (z) =

k+z 1 G
1+kGz 1 X(z)



j j

<1
is stable since kG(e )e

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 12 / 19

Lattice Stage
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Suppose G is allpass: G(z) =

z N A(z 1 )
A(z)

V (z) = X(z) kGz 1 V (z)


V (z) =

1
1+kGz 1 X(z)

Y (z) = kV (z) + Gz
If |k| < 1 then
Y (z)
X(z)

Y (z)
X(z)

V (z) =

k+z 1 G
1+kGz 1 X(z)



j j

<1
is stable since kG(e )e

kA(z)+z N 1 A(z 1 )
A(z)+kz N 1 A(z 1 )

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 12 / 19

Lattice Stage
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Suppose G is allpass: G(z) =

z N A(z 1 )
A(z)

V (z) = X(z) kGz 1 V (z)


V (z) =

1
1+kGz 1 X(z)

Y (z) = kV (z) + Gz
If |k| < 1 then
Y (z)
X(z)

Y (z)
X(z)

V (z) =

k+z 1 G
1+kGz 1 X(z)



j j

<1
is stable since kG(e )e

kA(z)+z N 1 A(z 1 )
A(z)+kz N 1 A(z 1 )

z (N +1) D(z 1 )
D(z)

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 12 / 19

Lattice Stage
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example
Numerator

Summary
MATLAB routines

Suppose G is allpass: G(z) =

z N A(z 1 )
A(z)

V (z) = X(z) kGz 1 V (z)


V (z) =

1
1+kGz 1 X(z)

Y (z) = kV (z) + Gz
If |k| < 1 then
Y (z)
X(z)

Y (z)
X(z)

V (z) =

k+z 1 G
1+kGz 1 X(z)



j j

<1
is stable since kG(e )e

kA(z)+z N 1 A(z 1 )
A(z)+kz N 1 A(z 1 )

z (N +1) D(z 1 )
D(z)

Obtaining {d[n]}
from {a[n]}:

n=0
1
d[n] = a[n] + ka[N + 1 n] 1 n N

k
n=N +1

DSP and Digital Filters (2014-5560)

Structures: 10 12 / 19

Lattice Stage
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example
Numerator

Summary
MATLAB routines

Suppose G is allpass: G(z) =

z N A(z 1 )
A(z)

V (z) = X(z) kGz 1 V (z)


V (z) =

1
1+kGz 1 X(z)

Y (z) = kV (z) + Gz
If |k| < 1 then
Y (z)
X(z)

Y (z)
X(z)

V (z) =

k+z 1 G
1+kGz 1 X(z)



j j

<1
is stable since kG(e )e

kA(z)+z N 1 A(z 1 )
A(z)+kz N 1 A(z 1 )

z (N +1) D(z 1 )
D(z)

Obtaining {d[n]}
from {a[n]}:

n=0
1
d[n] = a[n] + ka[N + 1 n] 1 n N

k
n=N +1

Obtaining {a[n]} from {d[n]}:

k = d[N + 1]
DSP and Digital Filters (2014-5560)

a[n] =

d[n]kd[N +1n]
1k2
Structures: 10 12 / 19

Example A(z) D(z)


10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

A(z) = 1 + 4z 1 6z 2 + 10z 3
k = 0.5, N = 3

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 13 / 19

Example A(z) D(z)


10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

A(z) = 1 + 4z 1 6z 2 + 10z 3
k = 0.5, N = 3
A(z) D(z)
A(z)
z 4 A(z 1 )
D(z) = A(z) + kz 4 A(z 1 )

z0
1
1

z 1
4
10
9

z 2
6
6
9

z 3
10
4
12

z 4
1
0.5

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 13 / 19

Example A(z) D(z)


10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example
Numerator

Summary
MATLAB routines

A(z) = 1 + 4z 1 6z 2 + 10z 3
k = 0.5, N = 3
A(z) D(z)
z0
1

A(z)
z 4 A(z 1 )
D(z) = A(z) + kz 4 A(z 1 )

z 1
4
10
9

z 2
6
6
9

z 3
10
4
12

z 4
1
0.5

D(z) A(z)
D(z)
k = d[N + 1]
z 4 D(z 1 )
D(z) kz 4 D(z 1 )
A(z) =

DSP and Digital Filters (2014-5560)

D(z)kz 4 D(z 1 )
1k2

z0
1

z 1
9

z 2
9

z 3
12

0.5
0.75

12
3

9
4.5

9
7.5

z 4
0.5
0.5
1
0

10

Structures: 10 13 / 19

Allpass Lattice
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

We can implement any allpass filter H(z) =

z M A(z 1 )
A(z)

as a lattice filter

with M stages:

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 14 / 19

Allpass Lattice
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

We can implement any allpass filter H(z) =

z M A(z 1 )
A(z)

as a lattice filter

with M stages:

Initialize AM (z) = A(z)

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 14 / 19

Allpass Lattice
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

We can implement any allpass filter H(z) =

z M A(z 1 )
A(z)

as a lattice filter

with M stages:

Initialize AM (z) = A(z)


Repeat for m = M : 1 : 1

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 14 / 19

Allpass Lattice
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

We can implement any allpass filter H(z) =

z M A(z 1 )
A(z)

as a lattice filter

with M stages:

Initialize AM (z) = A(z)


Repeat for m = M : 1 : 1
k[m] = am [m]

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 14 / 19

Allpass Lattice
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

We can implement any allpass filter H(z) =

z M A(z 1 )
A(z)

as a lattice filter

with M stages:

Initialize AM (z) = A(z)


Repeat for m = M : 1 : 1
k[m] = am [m]
am1 [n] =

am [n]k[m]am [mn]
1k2 [m]

for 0 n m 1

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 14 / 19

Allpass Lattice
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

We can implement any allpass filter H(z) =

z M A(z 1 )
A(z)

as a lattice filter

with M stages:

Initialize AM (z) = A(z)


Repeat for m = M : 1 : 1
k[m] = am [m]
am1 [n] =

am [n]k[m]am [mn]
1k2 [m]

equivalently Am1 (z) =

for 0 n m 1

Am (z)k[m]z m Am (z 1 )
1k2 [m]

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 14 / 19

Allpass Lattice
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

We can implement any allpass filter H(z) =

z M A(z 1 )
A(z)

as a lattice filter

with M stages:

Initialize AM (z) = A(z)


Repeat for m = M : 1 : 1
k[m] = am [m]
am1 [n] =

am [n]k[m]am [mn]
1k2 [m]

equivalently Am1 (z) =

for 0 n m 1

Am (z)k[m]z m Am (z 1 )
1k2 [m]

Numerator

Summary
MATLAB routines

A(z) is stable iff |k[m]| < 1 for all m (good stability test)

DSP and Digital Filters (2014-5560)

Structures: 10 14 / 19

Lattice Filter

Label outputs um [n] and vm [n] and define Hm (z) =

DSP and Digital Filters (2014-5560)

Vm (z)
Um (z)

z m Am (z 1 )
Am (z)

Structures: 10 15 / 19

Lattice Filter

Label outputs um [n] and vm [n] and define Hm (z) =

Vm (z)
Um (z)

z m Am (z 1 )
Am (z)

From earlier slide:


Um1 (z)
Um (z)

1
1+k[m]z 1 Hm1 (z)

DSP and Digital Filters (2014-5560)

Structures: 10 15 / 19

Lattice Filter

Label outputs um [n] and vm [n] and define Hm (z) =

Vm (z)
Um (z)

z m Am (z 1 )
Am (z)

From earlier slide:


Um1 (z)
Um (z)

1
1+k[m]z 1 H

DSP and Digital Filters (2014-5560)

m1 (z)

Am1 (z)
Am1 (z)+k[m]z m Am1 (z 1 )

Structures: 10 15 / 19

Lattice Filter

Label outputs um [n] and vm [n] and define Hm (z) =

Vm (z)
Um (z)

z m Am (z 1 )
Am (z)

From earlier slide:


Um1 (z)
Um (z)

1
1+k[m]z 1 H

DSP and Digital Filters (2014-5560)

m1 (z)

Am1 (z)
Am1 (z)+k[m]z m Am1 (z 1 )

Am1 (z)
Am (z)

Structures: 10 15 / 19

Lattice Filter

Label outputs um [n] and vm [n] and define Hm (z) =

Vm (z)
Um (z)

z m Am (z 1 )
Am (z)

From earlier slide:


Um1 (z)
Um (z)

1
1+k[m]z 1 H

m1 (z)

Am1 (z)
Am1 (z)+k[m]z m Am1 (z 1 )

Am1 (z)
Am (z)

Hence:
Um (z)
X(z)

Am (z)
A(z)

DSP and Digital Filters (2014-5560)

Structures: 10 15 / 19

Lattice Filter

Label outputs um [n] and vm [n] and define Hm (z) =

Vm (z)
Um (z)

z m Am (z 1 )
Am (z)

From earlier slide:


Um1 (z)
Um (z)

1
1+k[m]z 1 H

m1 (z)

Am1 (z)
Am1 (z)+k[m]z m Am1 (z 1 )

Am1 (z)
Am (z)

Hence:
Um (z)
X(z)

Am (z)
A(z)

DSP and Digital Filters (2014-5560)

and

Vm (z)
X(z)

Um (z)
X(z)

Vm (z)
Um (z)

Structures: 10 15 / 19

Lattice Filter

Label outputs um [n] and vm [n] and define Hm (z) =

Vm (z)
Um (z)

z m Am (z 1 )
Am (z)

From earlier slide:


Um1 (z)
Um (z)

1
1+k[m]z 1 H

m1 (z)

Am1 (z)
Am1 (z)+k[m]z m Am1 (z 1 )

Am1 (z)
Am (z)

Hence:
Um (z)
X(z)

Am (z)
A(z)

DSP and Digital Filters (2014-5560)

and

Vm (z)
X(z)

Um (z)
X(z)

Vm (z)
Um (z)

z m Am (z 1 )
A(z)

Structures: 10 15 / 19

Lattice Filter

Label outputs um [n] and vm [n] and define Hm (z) =

Vm (z)
Um (z)

z m Am (z 1 )
Am (z)

From earlier slide:


Um1 (z)
Um (z)

1
1+k[m]z 1 H

m1 (z)

Am1 (z)
Am1 (z)+k[m]z m Am1 (z 1 )

Am1 (z)
Am (z)

Hence:
Um (z)
X(z)

Am (z)
A(z)

and

Vm (z)
X(z)

Um (z)
X(z)

Vm (z)
Um (z)

z m Am (z 1 )
A(z)

V (z)

m
is of order m so you can create any numerator of order M by
The numerator of X(z)
summing appropriate multiples of Vm (z):

w[n] =

PM

m=0 cm vm [n]

DSP and Digital Filters (2014-5560)

Structures: 10 15 / 19

Lattice Filter

Label outputs um [n] and vm [n] and define Hm (z) =

Vm (z)
Um (z)

z m Am (z 1 )
Am (z)

From earlier slide:


Um1 (z)
Um (z)

1
1+k[m]z 1 H

m1 (z)

Am1 (z)
Am1 (z)+k[m]z m Am1 (z 1 )

Am1 (z)
Am (z)

Hence:
Um (z)
X(z)

Am (z)
A(z)

and

Vm (z)
X(z)

Um (z)
X(z)

Vm (z)
Um (z)

z m Am (z 1 )
A(z)

V (z)

m
is of order m so you can create any numerator of order M by
The numerator of X(z)
summing appropriate multiples of Vm (z):

w[n] =

PM

m=0 cm vm [n]

DSP and Digital Filters (2014-5560)

W (z) =

PM

m=0

cm z m Am (z 1 )
A(z)
Structures: 10 15 / 19

Lattice Example

A(z) = A3 (z) = 1 + 0.2z 1 0.23z 2 + 0.2z 3

DSP and Digital Filters (2014-5560)

Structures: 10 16 / 19

Lattice Example

A(z) = A3 (z) = 1 + 0.2z 1 0.23z 2 + 0.2z 3


k[3] = 0.2 a2 [ ] =

DSP and Digital Filters (2014-5560)

[1, 0.2, 0.23]0.2[0.2, 0.23, 0.2]


10.22

= [1, 0.256, 0.281]

Structures: 10 16 / 19

Lattice Example

A(z) = A3 (z) = 1 + 0.2z 1 0.23z 2 + 0.2z 3


k[3] = 0.2 a2 [ ] =

[1, 0.2, 0.23]0.2[0.2, 0.23, 0.2]


10.22

k[2] = 0.281 a1 [ ] =

DSP and Digital Filters (2014-5560)

= [1, 0.256, 0.281]

[1, 0.256]+0.281[0.281, 0.256]


10.2812

= [1, 0.357]

Structures: 10 16 / 19

Lattice Example

A(z) = A3 (z) = 1 + 0.2z 1 0.23z 2 + 0.2z 3


k[3] = 0.2 a2 [ ] =

[1, 0.2, 0.23]0.2[0.2, 0.23, 0.2]


10.22

k[2] = 0.281 a1 [ ] =

= [1, 0.256, 0.281]

[1, 0.256]+0.281[0.281, 0.256]


10.2812

= [1, 0.357]

k[1] = 0.357 a0 [ ] = 1

DSP and Digital Filters (2014-5560)

Structures: 10 16 / 19

Lattice Example

A(z) = A3 (z) = 1 + 0.2z 1 0.23z 2 + 0.2z 3


k[3] = 0.2 a2 [ ] =

[1, 0.2, 0.23]0.2[0.2, 0.23, 0.2]


10.22

k[2] = 0.281 a1 [ ] =

= [1, 0.256, 0.281]

[1, 0.256]+0.281[0.281, 0.256]


10.2812

= [1, 0.357]

k[1] = 0.357 a0 [ ] = 1
V0 (z)
X(z)

1
1+0.2z 1 0.23z 2 +0.2z 3

DSP and Digital Filters (2014-5560)

Structures: 10 16 / 19

Lattice Example

A(z) = A3 (z) = 1 + 0.2z 1 0.23z 2 + 0.2z 3


k[3] = 0.2 a2 [ ] =

[1, 0.2, 0.23]0.2[0.2, 0.23, 0.2]


10.22

k[2] = 0.281 a1 [ ] =

= [1, 0.256, 0.281]

[1, 0.256]+0.281[0.281, 0.256]


10.2812

= [1, 0.357]

k[1] = 0.357 a0 [ ] = 1
V0 (z)
X(z)

1
1
1+0.2z 0.23z 2 +0.2z 3

DSP and Digital Filters (2014-5560)

V1 (z)
X(z)

0.357+z 1
1+0.2z 1 0.23z 2 +0.2z 3

Structures: 10 16 / 19

Lattice Example

A(z) = A3 (z) = 1 + 0.2z 1 0.23z 2 + 0.2z 3


k[3] = 0.2 a2 [ ] =

[1, 0.2, 0.23]0.2[0.2, 0.23, 0.2]


10.22

k[2] = 0.281 a1 [ ] =

= [1, 0.256, 0.281]

[1, 0.256]+0.281[0.281, 0.256]


10.2812

= [1, 0.357]

k[1] = 0.357 a0 [ ] = 1
V0 (z)
X(z)

1
1
1+0.2z 0.23z 2 +0.2z 3

V2 (z)
X(z)

0.281+0.256z 1 +z 2
1+0.2z 1 0.23z 2 +0.2z 3

DSP and Digital Filters (2014-5560)

V1 (z)
X(z)

0.357+z 1
1+0.2z 1 0.23z 2 +0.2z 3

Structures: 10 16 / 19

Lattice Example

A(z) = A3 (z) = 1 + 0.2z 1 0.23z 2 + 0.2z 3


k[3] = 0.2 a2 [ ] =

[1, 0.2, 0.23]0.2[0.2, 0.23, 0.2]


10.22

k[2] = 0.281 a1 [ ] =

= [1, 0.256, 0.281]

[1, 0.256]+0.281[0.281, 0.256]


10.2812

= [1, 0.357]

k[1] = 0.357 a0 [ ] = 1
V0 (z)
X(z)
V2 (z)
X(z)

1
1
1+0.2z 0.23z 2 +0.2z 3

V1 (z)
X(z)

0.357+z 1
1+0.2z 1 0.23z 2 +0.2z 3

0.281+0.256z 1 +z 2
1+0.2z 1 0.23z 2 +0.2z 3

V3 (z)
X(z)

0.20.23z 1 +0.2z 2 +z 3
1+0.2z 1 0.23z 2 +0.2z 3

DSP and Digital Filters (2014-5560)

Structures: 10 16 / 19

Lattice Example

A(z) = A3 (z) = 1 + 0.2z 1 0.23z 2 + 0.2z 3


k[3] = 0.2 a2 [ ] =

[1, 0.2, 0.23]0.2[0.2, 0.23, 0.2]


10.22

k[2] = 0.281 a1 [ ] =

= [1, 0.256, 0.281]

[1, 0.256]+0.281[0.281, 0.256]


10.2812

= [1, 0.357]

k[1] = 0.357 a0 [ ] = 1
V0 (z)
X(z)
V2 (z)
X(z)

1
1
1+0.2z 0.23z 2 +0.2z 3

V1 (z)
X(z)

0.357+z 1
1+0.2z 1 0.23z 2 +0.2z 3

0.281+0.256z 1 +z 2
1+0.2z 1 0.23z 2 +0.2z 3

V3 (z)
X(z)

0.20.23z 1 +0.2z 2 +z 3
1+0.2z 1 0.23z 2 +0.2z 3

V (z)

B(z)

m
to create an arbitrary 1+0.2z 1 0.23z 2 +0.2z 3
Add together multiples of X(z)

DSP and Digital Filters (2014-5560)

Structures: 10 16 / 19

Lattice Example Numerator


Form a new output signal as w[n] =

DSP and Digital Filters (2014-5560)

PM

m=0 cm vm [n]

Structures: 10 17 / 19

Lattice Example Numerator


Form a new output signal as w[n] =

W (z) =

PM

m=0 cm Vm (z) =
B(z)
1
1+0.2z 0.23z 2 +0.2z 3 X(z)

DSP and Digital Filters (2014-5560)

PM

m=0 cm vm [n]

Structures: 10 17 / 19

Lattice Example Numerator


Form a new output signal as w[n] =

W (z) =

PM

m=0 cm Vm (z) =
B(z)
1
1+0.2z 0.23z 2 +0.2z 3 X(z)
V0 (z)
X(z)
V2 (z)
X(z)

PM

m=0 cm vm [n]

1
1+0.2z 1 0.23z 2 +0.2z 3

V1 (z)
X(z)

0.281+0.256z 1 +z 2
1+0.2z 1 0.23z 2 +0.2z 3

V3 (z)
X(z)

DSP and Digital Filters (2014-5560)

0.357+z 1
1+0.2z 1 0.23z 2 +0.2z 3

0.20.23z 1 +0.2z 2 +z 3
1+0.2z 1 0.23z 2 +0.2z 3

Structures: 10 17 / 19

Lattice Example Numerator


Form a new output signal as w[n] =

W (z) =

PM

m=0 cm Vm (z) =
B(z)
1
1+0.2z 0.23z 2 +0.2z 3 X(z)
V0 (z)
X(z)
V2 (z)
X(z)

PM

m=0 cm vm [n]

1
1+0.2z 1 0.23z 2 +0.2z 3

V1 (z)
X(z)

0.281+0.256z 1 +z 2
1+0.2z 1 0.23z 2 +0.2z 3

V3 (z)
X(z)

b[0]
b[1]
We have
b[2]
b[3]

0.357+z 1
1+0.2z 1 0.23z 2 +0.2z 3

0.20.23z 1 +0.2z 2 +z 3
1+0.2z 1 0.23z 2 +0.2z 3

c0
1 0.357 0.281
0.2

0
1
0.256 0.23
c1
=
0
0
1
0.2 c2
c3
0
0
0
1

DSP and Digital Filters (2014-5560)

Structures: 10 17 / 19

Lattice Example Numerator


Form a new output signal as w[n] =

W (z) =

PM

m=0 cm Vm (z) =
B(z)
1
1+0.2z 0.23z 2 +0.2z 3 X(z)
V0 (z)
X(z)
V2 (z)
X(z)

PM

m=0 cm vm [n]

1
1+0.2z 1 0.23z 2 +0.2z 3

V1 (z)
X(z)

0.281+0.256z 1 +z 2
1+0.2z 1 0.23z 2 +0.2z 3

V3 (z)
X(z)

b[0]
b[1]
We have
b[2]
b[3]

1 0.357
0
1
=
0
0
0
0

c0
c1

Hence choose cm as
c2 =
c3

DSP and Digital Filters (2014-5560)

0.357+z 1
1+0.2z 1 0.23z 2 +0.2z 3

0.20.23z 1 +0.2z 2 +z 3
1+0.2z 1 0.23z 2 +0.2z 3

c0
0.281
0.2

0.256 0.23
c1
1
0.2 c2
c3
0
1
1
1 0.357 0.281
0.2

0
1
0.256 0.23

0
0
1
0.2
0
0
0
1

b[0]
b[1]

b[2]
b[3]

Structures: 10 17 / 19

Summary
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Filter block diagrams


Direct forms
Transposition
State space representation

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 18 / 19

Summary
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Filter block diagrams


Direct forms
Transposition
State space representation
Precision issues: coefficient error, arithmetic error
cascaded biquads

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 18 / 19

Summary
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

Filter block diagrams


Direct forms
Transposition
State space representation
Precision issues: coefficient error, arithmetic error
cascaded biquads
Allpass filters
first and second order sections

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 18 / 19

Summary
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example
Numerator

Summary
MATLAB routines

Filter block diagrams


Direct forms
Transposition
State space representation
Precision issues: coefficient error, arithmetic error
cascaded biquads
Allpass filters
first and second order sections
Lattice filters
Arbitrary allpass response
Arbitrary IIR response by summing intermediate outputs

DSP and Digital Filters (2014-5560)

Structures: 10 18 / 19

Summary
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example
Numerator

Summary
MATLAB routines

Filter block diagrams


Direct forms
Transposition
State space representation
Precision issues: coefficient error, arithmetic error
cascaded biquads
Allpass filters
first and second order sections
Lattice filters
Arbitrary allpass response
Arbitrary IIR response by summing intermediate outputs
For further details see Mitra: 8.

DSP and Digital Filters (2014-5560)

Structures: 10 18 / 19

MATLAB routines
10: Digital Filter Structures

Direct Forms
Transposition
State Space
Precision Issues
Coefficient Sensitivity
Cascaded Biquads
Pole-zero Pairing/Ordering
Linear Phase
Hardware Implementation
Allpass Filters
Lattice Stage
Example
A(z) D(z)
Allpass Lattice
Lattice Filter
Lattice Example
Lattice Example

residuez
tf2sos,sos2tf
zp2sos,sos2zp
zp2ss,ss2zp

tf2ss,ss2tf
poly

b(z 1)
a(z 1 )
b(z 1)
a(z 1 )

k 1prkkz1
Q b0,l +b1,l z1 +b2,l z2

{zm , pk , g}

l 1+a1,l z 1 +a2,l z 2
Q b0,l +b1,l z1 +b2,l z2
l 1+a1,l z 1 +a2,l z 2
(

x = Ax + Bu
{zm , pk , g}
y = Cx + Du
(
x = Ax + Bu
b(z 1)
a(z 1 )
y = Cx + Du
poly(A) = det (zIA)

Numerator

Summary
MATLAB routines

DSP and Digital Filters (2014-5560)

Structures: 10 19 / 19

Potrebbero piacerti anche