You are on page 1of 52

DSP2008.

doc 1

Introduction to DSP:
Text Books : (P) = Proakis , (M) = Mitra (I) = Iffeachor.
(previous reference continues to apply unless change is indicated)

Signals: (p)
speech, biomedical, music, video, radar,

DSP concerned with digital representation of signals, and use of digital processors to
analyse, modify, and extract information.

Signal converted to digital and then processed then reconverted.

Advantages:
• Guaranteed accuracy: no. of bits
• Perfect reproducibility: no equipment dependence, tolerances etc.
• No drift in performance with age, temp,
• With CMOS, reliability, small size, low cost, low power and high speed
• Flexibility: a given system can be reprogrammed, with same hardware
• Superior, near ideal performance: i.e. linearity, adaptive filtering etc
• Storage: digital storage media can be used

Applications:
• Image processing: pattern recognition, enhancement,
• Control and Instrumentation: spectral analysis, noise reduction, and data
compression
• Speech: recognition and synthesis, text to speech, equalisation
• Military: secure communication, radar and sonar, guidance systems.
• Communications: echo suppression, adaptive equalisation, spread spectrum,
• Bio-medical: EEG-ECG analysis, scanners, X-ray storage, and enhancement

Classification of Signals: (P,M)

Multichannel and Multidimensional


Signal is a function of one or more variables. It can be real valued, complex valued or
a vector
• A sin 3π t is real valued
• Aej3π t is complex valued
Vector signals are generated by multiple sources. E.g. 3 lead ECG, RGB, and are
multichannel signals.

The variable may be 1-dimensional e.g. t


DSP2008.doc 2

A picture signal (B&W) is 2-dimensional as it is a function of x and y


Colour TV is 3 channel 3 dimensional e.g. (x,y,t),

Continuous Time and Discrete Time Signals: (P,M)


• Continuous time signals are defined for all value of time i.e. speech
• Discrete time signals defined at specific instances of time x[n]

Continuous time signals may be


• analog if all values are allowed, or
• Quantized Boxcar signals if specific values are allowed.

Discrete time signals may be


• digital (specific values) or
• sampled (any value)

Deterministic and Random Signals: (P,M)


• If an expression or a table can define a signal model then it is deterministic.
The past present and future values can be known without uncertainty.
• If the signal cannot be described to any reasonable degree of accuracy by an
expression, then it is random.

Concept of Frequency in Continuous and Discrete Time Signals: (P)

Periodic Analog signal:


A periodic analog signal satisfies x a (t ) = x a (t + T ) where T is the repetition period
e.g. x a (t ) = A cos(2Ωt + θ ), Ω = 2πF uses Ω as frequency in radians /sec, F is
frequency in Hz.

Here F can be increased without limit, and can also be 0, and all resulting signals are
distinct. Increasing F results in increase in the rate of oscillation.

Periodic Discrete Time signal:


The corresponding Discrete Time sinusoid would be x(n) = A cos(ωn + θ ) where n is an
integer called sample number. ω is the freq. in radians /sample, ω = 2πf and f has
dimensions of cycles/sample.

It is periodic with a period N if and only if x(n + N ) = x(n) for all n .


Smallest value of N is the Fundamental period.

For a periodic discrete time sinusoid cos(2πf 0 n) = cos(2πf 0 (n + N ))


Thus
DSP2008.doc 3

k
2πf 0 N = 2kπ , where k is an integer, or f 0 = and must be a rational number.
N

Aliasing of Discrete Time Signals:


Discrete time sinusoids whose frequencies are separated by integer multiples of 2π
are identical. For example,
If ω k = ω 0 + 2π then cos( w0 n) and cos(ω k n) are indistinguishable.
1 1
However sinusoids in range − π ≤ ω ≤ π or − ≤ f ≤ are always distinct.
2 2
Signals with ω > π are called aliases of some corresponding sinusoid with ω < π

Fundamental Frequency Range:


1 1
The highest rate of oscillation is when ω = π or − π or f = or −
2 2
1 1
The frequency range 0 ≤ ω ≤ 2π or − π ≤ w ≤ π 0 ≤ f ≤ 1, − ≤ f ≤ is the called
2 2
the fundamental range.

Representation as Complex Exponentials:


Continuous time exponential components can be used to represent a given periodic
signal, i.e. Fourier series.
+∞
xa (t ) = ck e jkΩ0t
k = −∞

The discrete time complex exponential is periodic if its relative frequency is a


1
rational number. We may choose f 0 = and define
N
s k ( n) = e j 2πf 0 n , with k = 0, ± 1, ± 2 etc.

In this case however s k + N (n) = e j 2π n ( k + N ) = e j 2π N s k (n) = s k (n) and there are only N
distinct complex exponentials in the set.
N −1
Hence x(n) = c k e j 2π k n / N is a periodic signal with fundamental period N
k =0

Sampling: (P)
Consider uniform sampling of an analogue signal x(n) = x a (nT ) where T is sampling
1
period, and Fs = the sampling frequency.
T
n
Since t = nT = the analogue sinusoid can be written as
Fs
x a (t ) = A cos(2πFt + θ )
F
thus x a (nT ) = x(n) = A cos(2πFnT + θ ) = A cos 2πn +θ
Fs
Comparing with the discrete time sinusoid expression
DSP2008.doc 4
x(n) = A cos(2πfn + θ )
F
we find f = or ω = ΩT .
Fs
1 1
Since − ≤ f ≤ and − π ≤ ω ≤ π , the frequency of the continuous time sinusoid
2 2
1
when sampled at Fs = must fall in range
T
1 Fs Fs 1
− T =− ≤F≤ ≤ T
2 2 2 2 ,
π π
− = −πFs ≤ Ω ≤ πFs =
T T

Thus a fundamental difference is in the range of values. Periodic sampling of a


continuous time signal involves a mapping of the infinite frequency range for F or
Ω into a finite range for f or ω .
1
The highest freq. in a discrete time signal is ω = π or f = ,
2
Fs 1 π
the corresponding highest values of F and Ω are = , and πFs = respectively.
2 2T T
Thus sampling produces an ambiguity with the highest frequency that can be
Fs
uniquely distinguished being .
2
This can be seen from the following:
If x(n) = A cos(2πf 0 n) is the sampled signal derived from an analog signal
x a (t ) = A cos(2πF0 t ) with frequency F0 ,
Then for Fk = F0 + kFs , the sinusoid x a (t ) = A cos(2πFk t ) gives a sampled signal

F0 + kFs F
x(n) = x a (nT ) = A cos 2π n = A cos 2π 0 n
Fs Fs
which is the same as the first signal.
Thus the process of sampling introduces an ambiguity (Aliasing).

If the signal has a highest freq. Fmax = B then it follows that to avoid aliasing,
Fs
Fmax < or Fs > 2Fmax
2

Recovery of Analog Signals :

The sampling theorem states that for Fs > 2 B , x a (t ) can be exactly recovered using
sin(2πBt )
the interpolation function G (t ) =
2πBt
Thus

n n
x a (t ) = xa g t−
n = −∞ Fs Fs
DSP2008.doc 5

At the minimum sampling rate Fs = 2 B


n

sin 2πB t −
n 2B
x a (t ) = xa
2B n
n = −∞
2πB t −
2B

Discrete-Time Signals:
Sequences of numbers (samples) represented by x[n] where n is integer with range
−∞ < n < ∞.
The signal is the set {x[n]}.

x[n] may be periodic samples of a continuous waveform x a (t ) .


x[n] = x a (nT ) where T = sampling period, 1 = FT Hz.
T
x[n] may be complex and {x[n]} = {x re [n]} + j{xim [n]} .

Types of Sequences: (M)


Finite:
A sequence is finite if N1 ≤ n ≤ N2, N2 > N1 , -∞ < N1 , N2 < ∞
Length is defined as N = N1 + N2 -1 (N point sequence)
Such a sequence can be made infinite by assigning zero values outside defined range.
h[n] = [3.5, -9.4, 0.05, 67.0, 205, 0.8]

Above sequence is defined from –2 ≤ n ≤ 3.
It can be made infinite by defining h[n] = 0 for n < -2, n > 3

Infinite:
Right Sided.
Zero values for n < N1, N1 negative or positive.
x[n] = 0 n <-2, and
=n n ≥ -2
If N1 ≥ 0 then CAUSAL.
Left Sided:
zero for n > N2.
If N2 ≤ 0 then ANTI CAUSAL.
x[n] = -(1/n) n ≤ -5
=0 n > -5
Two Sided:
Has -∞ ≤ n ≤ + ∞.
x[n] = 1/n2
DSP2008.doc 6

Even / Odd:
Conjugate symmetric x[n] = x*[-n]
If all x[n] real then EVEN
Conjugate asymmetric x[n] = -x * [-n],
If all x[n] real then ODD

Periodic:
x[n] = x[n + kN] for all n, N is a positive integer, and is the PERIOD of sequence
Nf = fundamental period is the period with smallest N

Bounded:
|x[n]| ≤ Bx < ∞
x[n] = 0 n≤0
= 1/n n > 0

Absolutely Summable:
|x[n]| < ∞

Square Summable:
E = |x[n]|2 < ∞, E is the energy

Basic Sequences: (M)


Unit Sample:
δ[n] = 1 n=0
=0 n≠0
Unit Step:
µ[n] = 1 n ≥ 0
=0 n<0

µ[n] = δ [k], δ[n] = µ[n] - µ[n-1]

Exponential:
x[n] = Aα n , where A , α are complex in general and α = e σ 0+ jω 0
, A = A e jΦ .
x re [n] = A e σ 0 n cos(ω 0 n + Φ )
xim [n] = A e σ 0 n sin (ω 0 n + Φ )
For a real sinusoid x[n] = A cos(ω 0 n + Φ ) , ω 0 is angular frequency.

In Phase Sequence:
For a real sinusoid sequence x[n] = xi [n] + x q [n] ,
DSP2008.doc 7

xi [n] = A cos φ cos(ω 0 n) is the in-phase sequence

Quadrature Sequence:
x q [n] = − A sin φ sin(ω 0 n) is the quadrature sequence.

Complex exponential sequence with σ 0 = 0 and real sinusoidal sequence


are periodic with period N as long as ω 0 n = 2πr where r is an integer.
Or 2π ω = N r .
0

Thus Periodic only if 2π ω is rational.


0

Operations on Sequences: (M)


Product:
w[n] = x[n] . y[n] i.e. in modulation, windowing

Addition:
w2[n] = x[n] + y[n]

Scalar multiplication:
w3[n] = A . x[n]

Time Reversal:
w4[n] = x[-n]

Delay:
w5 [n] = x[n - N] N positive

Advance:
w6[n] = x[n + N]

Sampling rate alteration:


If x[n] sampled at FT then y[n] samples will be at FT’ where FT’/FT = R

If R > 1 then Interpolation


If R < 1 then Decimation

Sampling Process: ( M)
samples at nT = n F = 2π n Ω
T T

where ΩT = sampling angular frequency = 2 π FT


If analog signal sampled is
x a (t ) = A cos(2πf 0 t + Φ ) = A cos(Ω 0 t + Φ )
We get discrete time signal
x[n] = A cos(Ω 0 nT + Φ ) = A cos((2πΩ 0 / Ω T )n + Φ ) = A cos(ω 0 n + Φ )
DSP2008.doc 8

with ω 0 = (2πΩ 0 ) / Ω T = Ω 0T called the normalised digital angular frequency (in


radians/sample)

In the general case, a family of sinusoids


x a ,k (t ) = A cos((Ω 0 + kΩ T )t + Φ k = 0, ± 1, ± 2, ± 3,….
gives sampled signal
x a ,k (nT ) = A cos((Ω 0 + kΩ T )nT + Φ)

= A cos 2π Ω 0 + kΩ T ) n +Φ
ΩT

= A cos 2πΩ 0 n +Φ
ΩT
= A cos(ω 0 n + Φ )
= x[n]
If Ω T > 2Ω 0 , then − π < ω 0 < π implies no aliasing, otherwise aliasing is observed.

Example:
v(t) = 6 cos (60 π t) + 3 sin (300 π t) + 2 Cos (340 π t) + 4 cos (500 π t)
+ 10 sin (660 π t) is sampled at T =1/200 sec.
Giving
v[n] = 6 cos (0.3πn) + 3 sin (1.5πn) +2 cos (1.7πn) + 4 cos (2.5πn)
+ 10 sin (3.3πn)
= 6 cos (0.3πn) + 3 sin ((2π - 0.5π)n) + 2 cos ((2π - 0.3π)n)+4 cos((2π + 0.5π)n)
- 10 sin ((4π - 0.7π)n)
= 8 cos (0.3πn) + 5 cos (0.5πn + 0.6435) - 10 sin (0.7πn)

Same results are obtained if


w(t) = 8 cos (60πt) + 5 cos (100πt + 0.6435) -10 sin (140πt) are sampled at the same
rate.

Linear Systems: (M, P)


Input x[n] = α x1[n] + β x2[n] gives an output y[n] = α y1[n] + β y2[n]
for all α, β, x1, and x2

example:
y[n] = nx[n] is linear
y1[n[ = nx1[n], y2[n] = nx2[n] thus y3[n] = n([a1x1[n] + a2x2[n])
also a1y1[n] +a2y2[n] = a1nx1[n] + a2nx2[n] .

y[n] = x[n2] is linear


y1[n] = x1[n2] and y2[n] = x2[n2] hence y3[n] = a1 x1[n2] + a2 x2[n2]
linear combination of outputs is a1y1[n] +a2y2[n] = a1 x1[n2] + a2 x2[n2]
DSP2008.doc 9

y[n] = x2[n] is non-linear


y1[n] = x12[n] and y2[n] = x22[n] hence y3[n] = (a1 x1[n] + a2 x2[n])2
linear combination of outputs is a1y1[n] +a2y2[n] = a1 x12[n] + a2 x22[n]

y[n] = Ax[n] + B is linear only if B = 0


y1[n] = Ax1[n] + B and y2[n] = Ax2[n] + B hence y3[n] = A(a1 x1[n] + a2 x2[n]) + B
linear combination of outputs is a1y1[n] +a2y2[n] = Aa1x1[n] + a1B + Aa2x2[n] + a2B

Accumulator y[n] = x[n]


y[n] = (α x1[k] + β x2[k]) = α x1[k] + β x2[k] = α y1[n] + β y2[n] is linear

Accumulator with an initial condition (Causal accumulator) has


n n
y1 [ n ] = y1 [ −1] + x1 [ k ] and y 2 [n] = y 2 [−1] + x 2 [k ]
k =0 k =0

Hence for input α x1[n] + β x2[n]


n n n
y1 [n] = y1 [−1] + αx1 [k ] + βx 2 [k ] = y[−1] + α x1 [k ] + β x2 [k ]
l =0 k =0 k =0

but
n n
αy1 [n] + βy 2 [n] = αy1 [−1] + α x1 [k ] + β y 2 [−1] + β x2 [k ]
k =0 k =0

which can equal y[n] only if y[-1] = α y1[-1] + β y2[-1] for all α, β, y[-1], y1[-1] and
y2[-1]. This is possible if and only if system starts from rest with initial condition
zero. Otherwise it is Nonlinear

Shift Invariance: (Time Invariance) (M,P)


If x[n] → y[n] then x[n-n0] → y[n-n0]

Y[n] = x[n] – x[n-1] is time invariant


If input is delayed and applied y(n,k) = x(n-k) – x(n-k-1)
If output is delayed y(n-k) = x(n-k) – x(n-k-1)

Y[n] = nx[n] is time variant


Response to x(n-k) is y(n,k) = nx(n-k)
However if output is delayed, y(n-k) = (n-k)x(n-k)

Y[n] = x[-n] is time variant


Response to x(n-k) is y(n,k) = x(-n-k)
However if output is delayed, y(n-k) = (-n+k)

Y[n] = x[n]cos(wn) is time variant

Linear Time Invariant (LTI):


A system having both Linear and Time-invariance properties.
DSP2008.doc 10

Causality:
y[n0] depends only on x[n] where n ≤ n0

Stability:
Bounded input gives bounded output (BIBO Stability)
if |x[n]| < Bx then |y[n]| < By

Impulse Response And Step Response:

Impulse Response:
denoted by {h[n]} is the response to a unit sample sequence {δ[n]}

Step Response:
{S[n]} → response to {µ [n]}

Response To Signal x[n]: (M,P)


k = +∞
Expressing x[n] sequence as x[n] = x[k ]δ (n − k ) the response of LTI system to
k = −∞

x[k]δ(n-k) will be x[k]h[n-k]


Thus
y[n] = x[k]h[n-k] or by a change of variables
y[n] = x[n-k]h[k]
which is a convolution y[n] = x[n] * h[n]
example:
a = [ -2 0 1 –1 3], b = [1 2 0 –1]
a*b = [-2 –4 1 3 1 5 1 –3]

Because of the summation both x[n] and y[n] cannot be infinite.


Convolution of sequence of lengths M and N gives a sequence of length M+N-1
Convolution is commutative, associative and distributive.

Stability Condition For LTI System: (P)


S = |h[n]| < ∞

Causality Condition: (P)


h[n] = 0 for n < 0
n n
y[n] = h[k ]x[n − k ] = x[k ]h[n − k ]
k =0 k =0

For a Causal sequence input into a causal LTI system


i.e. y[n] = 0 for n < 0 and is thus also causal
DSP2008.doc 11

Classes Of LTI Systems: (P)

FIR: Finite Impulse Response

if h[n] is of finite length


h[n] = 0 for n < N1 and n > N2 with N1 < N2
Impulse response is zero outside a finite time interval. Causal FIR system has
h[n] = 0 n < 0 and n ≥ M.
The convolution equation for causal FIR is
M −1
y[n] = h[k ]x[n − k ]
k =0

Output is the weighted linear combination of the past M input samples. Has a
memory of M samples. It can be realised by adders, multipliers and finite memory.

IIR: infinite impulse response

IIR if h[n] is of infinite length.


In a causal IIR summation in the convolution is from k = 0 to ∞ It involves all the
past input samples, and requires infinite memory. So realisation by convolution
form is impractical. A more practical way is by the difference equation form.

Example: cumulative average of x[n] in 0 ≤ k ≤ n


1 n
y[n] = x[k ] n = 0,1
n + 1 k =0
Knowledge of all input samples required, and therefore an increasing memory
requirement with time.
However rewriting the above expression as:
n −1
(n + 1) y[n] = x[k ] + x[n] = ny[n − 1] + x[n]
0


n 1
y[n] = y[n − 1] + x[n]
n +1 n +1
The expression is recursive, and calculation requires 2 multiplication, 1 addition and
1 memory location (y[n-1]).

Recursive System:
Systems whose output depends on past output values. In the previous example
y[n0] = (n0/ n0+1)y[n0-1] + (1/ n0+1)x[n0],
y[n0-1] is the initial condition at n = n0. Computation of the output of a recursive
system at a time say n0 requires computation of the previous values of y[k] in correct
order.

Non-Recursive System:
Such systems depend only on the present and past inputs.
DSP2008.doc 12

Causal FIR systems are non-recursive. Their computation can be in any order

Simple Recursive System:


Let y[n] = ay[n-1]+x[n] & let initial condition be y[-1]
y[0] = ay[-1] +x[0]
y[1] = ay[0] +x[1] = a2y[-1] +ax[0] +x[1]
y[2] = ay[1]+x[2] = a3y[-1] + a2x[0]+ax[1]+x[2]
y[n] = an+1y[-1] + anx[0] + an-1x[1] + …..+ax[n-1]+x[n]
or
n
y[n] = a n +1 y[−1] + a k x[n − k ] n≥0
k =0

For an initially relaxed system y[-1] = 0, and the output is the zero-state response or
the Forced response.
For a non-relaxed system, with x[n] = 0 for all n output is called zero input response
or Natural or Free response.

Finite Dimensional LTI System: (M)

A sub-class of LTI system characterised by a linear constant coefficient difference


equation:
N M
d k y[n − k ] = p k x[n − k ]
k =0 k =0

where dk and pk are constants, N ≥ M and N is the order of the equation.

Linearity, Time Invariance and Stability: (P)

Constant coefficient linear difference equation implies a time invariant system.

BIBO:

Bounded Input Bounded Output Stable if and only if for every bounded input, and
every bounded initial condition the total system response is bounded.

Example:
y[n] = ay[n-1] +x[n]
Assume x[n] is bounded i.e. |x[n]| ≤ Mx ≤ ∞ for all n ≥ 0. Then
n
|y[n]| ≤ | an+1y[-1] | + a k x[n − k ]
k =0
n
≤ |a| n+1|y[-1]| + Mx
k
a
k =0
n +1
n+1 1− a
≤ |a| |y[-1]| + Mx = My
1− a
DSP2008.doc 13

If n is finite My is finite irrespective of a, but as n → ∞, My is finite only if |a| < 1.


Thus system is stable only if |a| < 1.

Z-Transform and Transfer Functions:

Direct z-transform: (P)

x[n] has a z-transform X(z) given by



X ( z) = x[n]z − n
n = −∞
where z is complex. The infinite series converges for a set of values of z (Region of
Convergence – ROC)

examples:
1. x[n] = [1,2,5,7,0,1]
x(z) = 1 + 2z-1 + 5 z-2 + 7z-3 + z-5 ; ROC entire z-plane except z = 0

2. x[n] = [1,2,5,7,0,1]
x(z) = 1z2 + 2z + 5 + 7z-1 + z-3 ; ROC entire z-plane except z = 0, ∞

3. x[n] = [0,0,1,2,5,7,0,1]
x(z) = z -2 + 2z-3 + 5z-4 + 7z-5 + z-7 ; ROC entire z-plane except z = 0

4. x[n] = δ [n]
X(z) = 1; ROC entire z-plane

5. x[n] = δ [n - k], k > 0


X(z) = z – k ; ROC entire z-plane except z = 0

6. x[n] = δ [n + k], k > 0


X(z) = zk; ROC entire z-plane except z = ∞

x[n] having infinite duration can be described by a closed form expression in z


(infinite geometric series)

example:
x[n] = αn u[n] i.e. α n when n ≥ 0 and 0 when n < 0
has
∞ ∞
X ( z) = α n z −n = (αz −1 ) n
0 0

in closed form this is expressed as 1/(1- α z-1), ROC | z | > | α |


however if
DSP2008.doc 14

x[n] = -αn u[-n-1] i.e. = 0 when n ≥ 0 and -αn when n ≤ -1


in closed form this is expressed as 1/(1-α z-1), ROC | z | < | α |
Thus the z-transform is the same for both series, only the region of convergence
differs. Therefore it needs to be stated to uniquely identify the sequence.
x[n] = α nu[n] + bnu[-n-1]
has
∞ −1
X ( z) = α n z −n + b n z −n
0 −∞

The first converges for | z | > | α |, the second for | z | < | b |


If | b |<| α | ROCs do not overlap and hence X(z) does not exist
If | b | > | α | ROCs do overlap giving a ring in the z-plane where both terms
converge. Hence X(z) exists, with ROC |α| < |z| < |b|. This is the general case with
two-sided infinite duration signals

POLES and ZEROS of Z-transform: (P)

If X(z) is rational then


N ( z ) b0 + b1 z −1 + .... + bM z − M
X ( z) = =
D ( z ) a 0 + a1 z −1 + .... + a N z − N
Which can be expressed as
M

∏ (z − z k )
X ( z ) = Gz N − M 1
N

∏ (z − p
1
k )

where G = b0/a0, then there are M finite zeros, N finite poles and N - M zeros
(if N > M) or poles (if N < M) at the origin. Zeros and poles may also exist at ∞
The ROC of the z-transform does not contain poles, and is bounded by them.

single pole - real signal: pole also must be real. –ve pole causes signal to alternate in
sign.
double real poles in expression of type x[n] = nanu[n]. unbounded increase even on
unit circle.
DSP2008.doc 15

complex conjugates → exponentially weighted sinusoid, envelope varies as rn,


frequency depends on angle.
double complex → even on unit circle increasing envelope
Poles inside unit circle give bounded output, faster decay as pole is nearer to origin.
poles outside unit circle give unbounded output and hence unstable

Transfer Function:

Let system have a linear coefficient difference equation


N M
y[n] = − a k y[n − k ] + bk x[n − k ]
1 0

taking z- transform with time shifting


N M
Y ( z) = − ak Y ( z) z −k + bk X ( z ) z − k
1 0

hence in above equation if ak=0 then for 1 ≤ k ≤ n


M
1 M
H ( z) = bk z M − k = bk z
0 zM 0

The multiple M poles at 0 are trivial, and there are M nontrivial zeros. This is an All-
Zero system, It has a finite duration Impulse response (FIR).
If bk= 0 for 1 ≤ k ≤ n the system is an All-Poles system. Its impulse response is
infinite duration (IIR).
In the general case both poles and zeros exist. Because of the poles the system will be
IIR.

Frequency response: (M)

The frequency response is the complex DTFT of the LTI system.


+∞
H (e jw ) = h[n]e − jwn
−∞

Its magnitude is the magnitude response and its angle is the phase response.
G(w) = 20 log10| H(ejw) | dB is the GAIN function and – G(w) is called Attenuation
or LOSS function.
For a real impulse response h[n] magnitude response is even and phase response is
odd.
The negative of derivative of the angle θ(w) w.r.t. w is called the GROUP DELAY.
DSP2008.doc 16

For the LTI system Y(ejw) = H(ejw).X(ejw)


If the system is characterised by a constant coefficient difference equation
N M
d k y[n − k ] = p k x[n − k ]
k =0 k =0

then
M
p k e − jwk
H (e jw ) = k =0
N
d k e − jwk
k =0

The transfer function is a generalisation of the frequency response.


It is the z-transform of h[n], has real coefficients and is a rational polynomial in z-1.
N2
H ( z) = h[ n] z − n
N1

The frequency response is the transfer function evaluated at z = ejw.


For a FIR filter, we have.
Then for a causal FIR filter N1= 0 and N2 > 0, all poles are at the origin, and ROC is
the entire z-plane except z = 0.

For a finite dimensional IIR characterised by a difference equation the transfer


function is a rational expression
p 0 + p1 z −1 + p 2 z −2 + + pM z −M
H ( z) =
d 0 + d1 z −1 + d 2 z − 2 + + d N z −N
which can be written as

p ∏ (z − ξ k )
H ( z) = 0 z N −M 1
N
d0
∏ (z − λ
1
k )

where ξ1, ξ2, are the finite zeros and λ1, λ2 etc are the finite poles. There are
additional N-M zeros or poles at origin.
• FIR transfer function is always stable, For IIR all poles must be within the unit
circle for stability.
• Poles and zeros determine the filter behaviour, and may be placed to obtain a
particular frequency response.
• Poles near the points (but inside unit circle) emphasise the frequency
corresponding to the point on the circle.
• Zeros may be placed near frequency to be de-emphasised, and need not be
within the unit circle.
DSP2008.doc 17

• Complex zeros and poles must occur in conjugate pairs to make filter
coefficients real

Geometric evaluation of the Frequency Response: (P)

The z-transform of the LTI system may be expressed in terms of its poles and zeros
N

∏ K (z − z ) i
H ( z) = 1
N

∏ (z − p )
1
i

for N = M for simplicity

Frequency response is by substituting z =e jwt with w from 0 to ws/2.


Thus H(ejwt) = K (U1∠θ1 U2∠θ2 ) / ( V1∠ϕ 1 V2∠ϕ 2).
Where U’s are the distances from the zeros to the point z = ejwt, and V’s the distances
from poles.
Frequency response is obtained as one moves from z = 0 to z = -1.
When p moves closer to a pole V decreases and thus magnitude response increases.
Near zero opposite happens.

Examples of Frequency Response:


DSP2008.doc 18

LTI systems as Filters: (P)

Ideal magnitude response characteristics of basic filter types are as under:

The gain in the pass band is unity and in stop band is 0


Ideal filters have linear phase response
If a signal x[n] with frequency components in range w1 < w < w2 is passed through a
filter with frequency response
DSP2008.doc 19

H(w) = Ce−jwno w 1 < w < w2


=0 otherwise
the output has spectrum Y(w) = C.X(w)e−jwno, and from the properties of Fourier
transform y(n) = C.x(n - n0) the output is a delayed and scaled input, without
distortion.
Ideal Filters have linear phase characteristic in the pass-band.
Θ(w) = −wn0
Derivative of the phase with respect to frequency has units of delay called Group
Delay or Envelope delay.
Ideal filters are not physically realisable but are mathematical idealisations.
e.g. the ideal LPF has a impulse response
hlp(n) = sin wc π n / π n with –∞ < n < ∞ , and is neither causal, nor absolutely
summable.

LOW PASS: (P,M)

To be lowpass, we must have poles near the unit circle near w = 0 and zeros near or
on unit circle at w = π .
Single pole filter
1− a
H ( z) =
1 − az −1
Constant factor is (1-a),to make the amplitude gain unity at w = 0 and the gain is
small at high frequency.
Addition of a zero at –1 attenuates response at high frequency further.

1 − a 1 + z −1
H ( z) =
2 1 − az −1
with a < 1 for stability

2(1 − a) 2 (1 + cos w)
H (e ) =
jw

2(1 + a 2 − 2a cos w)
Here | H(ejw)|2 = H(z)H(z-1)| z = ejw is given by
This is monotonically decreasing, it is maximum at w = 0 and is 0 at w = π
DSP2008.doc 20

The 3 dB cut-off frequency is obtained from


(1 − a 2 (1 + cos wc ) 1
=
2(1 + a 2 − 2a cos wc ) 2

or

(1-a )2(1+ cos wc) = 1+a 2-2a cos wc

which gives cos wc = 2 a /(1+a 2).

Solving for a and considering the requirement for stability we get


a = (1−sin wc)/cos wc

Example:
the M-point moving average system
has
M −1
1
y[n] = x[n − k ]
M k =0
h[n] = (1/M) 0 ≤ n ≤ M-1
=0 otherwise
with M = 2 the transfer function is
H(z) = ½(1 + z-1)
Its frequency response is
H(jw) = e-jw/2 cos(w/2)

Thus magnitude response | H(ejw) | = cos(w/2) is monotonically decreasing from


w = 0 to w = π and the –3 dB frequency is at cos2(wc/2) = ½ i.e. at π/2

a cascade of M such sections has wc = 2cos-1(2-1/2M)

for M =3 wc = 0.3 π and thus higher order has a sharper cut-off.


DSP2008.doc 21

A higher order moving average filter will be an even better approximation to ideal LP
filter.

Example:
A two pole LP filter is H(z) = b0/(1−pz-1)2
Determine b0 and p such that H(0) = 1 and |H(π/4)|2 = ½
Here when w = 0
H(ej0) = b0/(1-p)2 = 1 at w = 0
so b0 = (1-p)2
At w = π / 4
H(ejπ/4)= (1-p)2 / (1-pe-j π /4)2
= (1-p)2 / (1-p Cos(π /4) + j p sin(π /4))2
= (1-p)2 / (1-p/√2 + jp/√2)2
Then (1-p)4 / [(1-p/√2)2 + p2/2] 2 = ½
Or √2(1-p)2 = 1 + p2 – √(2p)
Solution is p = 0.32 giving H(z) = 0.46 / (1-0.32z-1)2

High Pass: (P,M)

Translating Hlp (w) by π radians (i.e. replacing w by w - π) converts it into a HP


filter.
i.e. Hhp(w) = Hlp(w - π)
The frequency translation of π is equivalent to multiplication of impulse reponse hlp
by e j n
Thus hhp(n) = (e j )n hlp(n) = (−1)n hlp(n)
This means changing signs of the odd samples in hlp(n)
Conversely, hlp(n) = (−1)n hhp(n)

Proof: Let the LPF be described by the difference equation


N M
y ( n) = − ak y ( n − k ) + bk x(n − k )
k =1 k =0

Its frequency response is


M
bk e − jwk
H lp ( w) = k =0
N
1+ ak e − jwk
k =0

replacing w by w- π gives
M
(−1) k bk e − jwk
H hp ( w) = k =0
N
1+ (−1) k ak e − jwk
k =1

corresponding to the difference equation


N M
y ( n) = − (−1) k ak y (n − k ) + (−1) k bk x(n − k )
k =1 k =0
DSP2008.doc 22

Example:

The LPF y(n) = 0.9y(n-1) + 0.1x(n) give HPF y(n) = -0.9y(n-1) + 0.1x(n)
with frequency response as Hhp(w) = 0.1/(1− 0.9e –jw)

Thus high pass single pole amplifier


1 − a 1 − z −1
H ( z) =
2 1 + az −1
has the response

To get a HP FIR filter replace z in the moving average filter with –z


to get
H(z) = ½ (1-z-1). For M = 2,
This has
H(ejw) = e-jw/2 sin(w/2)

a higher order filter of the form


M −1
1
H ( z) = (−1) n z − n
M n =0

yields a sharper HP response.

Band- Pass Filter and Band- Stop Filter: (M,P)

A Band pass filter should contain one or more pairs of complex conjugate poles near
the unit circle, near the frequency band that is the pass-band.
1− a 1 − z −2
H ( z) =
2 1 − β (1 + a ) z −1 + az − 2
Has centre frequency w0 = cos-1(β) and 3-dB bandwidth = cos-1 (2a/(1+a2))
A band stop filter has zero on the unit circle at the frequency w0, and has a transfer
function of the form
1+ a 1 − 2 βz −1 + z −2
H ( z) =
2 1 − β (1 + a ) z −1 + az − 2
Its notch frequency is w0 = cos-1(β) and 3-dB bandwidth is cos-1 (2a/(1+a2)) like in
the BPF.

Example:
Design a two pole BPF with pass-band centred at w = π/2 zeros at w = 0 and π and
magnitude response is 1/√2 at w = 4 π / 9

Let the poles be p1,2 = re± j π /2 and zeros be at –1 and 1


DSP2008.doc 23

Then
( z − 1)( z + 1) z 2 −1
H ( z) = G =G 2 2
( z − jr )( z + jr ) z +r
The frequency response at π/2 is

π 2
H =G =1
2 (
1− r2 )
or G = (1-r2)/2

Evaluating |H(4 π/9)|2 at w = 4 π/9


2
4π (1 − r 2 ) 2 2 − 2 cos(8π / 9)
H = = 1
9 4 1 + r 4 + 2r 2 cos(8π / 9) 2

which gives
1.94(1-r2)2 = 1 − 1.88 r2 + r4
which is having solution
r2 = 0.7,
so the system function is
H(z) = (0.15)(1−z -2)/(1+ 0.7z−2)

Digital Resonator:

This is a two-pole BPF with a pair of complex conjugate poles near the unit circle.
Angular position of the poles determines the resonant frequency. For resonance at
w = w0 we select poles at
p1, 2 = re ± jw
0
0<r<1
we may also select two zeros at the origin or at 1 and –1
choosing zeros at the origin, the system function is

b0 b0
H ( z) = − jw0 −1
=
(1 − re jw0
z )(1 − re z ) 1 − (2r cos w0 ) z −1 + r 2 z − 2
−1

at w = w0
b0 b0
H ( w0 ) = =
(1 − re jw0 e − jw0 )(1 − re − jw0 e − jw0 ) (1 − r )(1 − re − j 2 w0 )
we select b0 such that
b0
H ( w0 ) = =1
(1 − r ) (1 + r 2 − 2rCos 2 w0 )

Thus b0 = (1 − r ) (1 + r 2 − 2rCos 2 w0 )
DSP2008.doc 24

The frequency response can be expressed as |H(w)| = b0/U1U2


Where
U1 ( w) = 1 + r 2 − 2r cos( w0 − w)
And
U 2 ( w) = 1 + r 2 − 2r cos( w0 + w)
For any r, U1 takes its minimum value (1- r) at w = w0
The product U1U2 reaches minimum value at
1+ r 2
wr = cos −1 cos w0
2r
when r ≅ 1 wr = w0. Also as r approaches 1 the resonance peaks get sharper and r ≅ 1
gives 3 dB bandwidth ∆w ≅ 2(1-r).
If zeros are placed at +1 and –1, the system function becomes
Giving frequency response
(1 − z −1 )(1 + z −1 ) 1− z2
H ( z) = G =G
(1 − re jw0 z −1 )(1 − re − jw0 z −1 ) 1 − (2r cos w0 ) z −1 + r 2 z −2

1 − e− j 2w
H ( w) = b0
[ ][
1 − re j ( w0 − w) 1 − re j ( w0 + w) ]

N ( w) = 2(1 − cos 2 w
The amplitude response is |H(w)| = b0N(w)/U1(w)U2(w) where N(w) is defined as
above.
Thus the resonant frequency and bandwidth are altered by the added zeros.

Digital Oscillator: (P)

A two pole resonator for which the poles lie on the circle.

b0
H ( z) =
1 − (2r cos w0 ) z −1 + r 2 z −2

± jω
has complex conjugate poles at re 0 and unit sample response
h[n] = [born/(sin wo)]×sin(n+1)wou(n)
If r = 1, bo = A sinwo then h[n] =A sin(n+1)wou(n) giving sinusoidal oscillations.

Notch filters: (P)

Used to eliminate specific frequencies. E.g. power line frequency and its harmonics.
To create a notch at w0 introduce a pair of conjugate complex zeros at angle w0 on the
unit circle.
DSP2008.doc 25

z1, 2 = e ± jω0
Thus system function for a FIR notch filter would be
H ( z ) = b0 (1 − e jω0 z −1 )(1 − e − jω0 z −1 ) = (1 − 2 cos ω 0 z −1 + z −2 )
The notch will have a large bandwidth. This can be reduced by adding a pair of
complex poles at p1, 2 = re ± jω 0

The poles introduce resonance and reduce bandwidth.


The system transfer function is then:
1 - 2cosw 0 z -1 + z -2
H ( z ) = b0
1 - 2rcosw 0 z -1 + r 2 z -2
Introduction of a pole near the zero may result in a ripple in the pass-band, which
may be removed by adding more poles and zeros.

Comb Filters: (P)

A notch filter with a periodic set of notches is a comb filter.


A moving average FIR filter with
1 M
y[n] = x(n − k )
M + 1 k =0
has

1 M −k 1 [1 − z − ( M +1) ]
H ( z) = z =
M + 1 k =0 M + 1 1 − z −1

with zeros on unit circle at z = ej2π k/(M+1) with k = 1 to M, A pole at z = 1 is cancelled


by the zero at z = 1
giving frequency response

The plot of magnitude shows periodic zeros at wk = 2 π k/(M+1) for k = 1,2,3 …M


M +1
− jwM / 2 sin w
e 2
H ( w) =
M +1 sin (w / 2 )
DSP2008.doc 26

Any FIR filter with a system function


M
H ( z) = h( k ) z − k
k =0

can be converted to a comb filter by replacing z with zL where L is an integer


M
H L ( z) = h(k ) z − kL
k =0

If the frequency response of the original filter is H(w) then for the above equation it
is
M
H ( w) = h(k )e − jkLw = H ( Lw)
k =0

It is an L-th order repetition of H(w) from 0 to 2 π.

Zero Phase and Linear Phase Functions: (M)

To avoid phase distortion phase should vary linearly with frequency.


In a digital filter this requirement is satisfied by making frequency response real and
non-negative (zero phase) As this makes the filter non-causal, it can be implemented
only in non-real time processing.

One way is to process finite data by passing it through a causal real coefficient filter,
reversing the output in time and reprocessing it by the same filter.

Else, we can use a filter having a response H(ejw) = e-jwD, having a group delay D.

Thirdly an approximation may be developed by truncating the h[n]


e.g.
Response of an ideal LP with linear phase e − jwn in 0 <| w | <wc 0

is h[n] = sin wc(n-n0)/π (n-n0) - ∞ <n < ∞


choosing n0 = N/2 and truncating to N+1 terms
h[n] = sin wc(n-N/2)/π (n-N/2) 0 ≤ n ≤ N gives a FIR filter
having a frequency response
N
H (e jw ) = h[n]e − jwn = e − jwN / 2 H ( w)
n =0

where H(w) is the zero-phase response, real function of w.


The resulting filter exhibits ripples around the cut-off frequency. Increasing N
increases sharpness of response but increases the no. of ripples. (GIBBS Phenomena)

Symmetry / anti-symmetry of the impulse response is a necessary condition for a


linear phase FIR filter

Symmetric Impulse Response With Odd Length N+1: (M,P)

Frequency response is of form


N /2
H (e jw ) = e − jNw / 2 a[n] cos( wn)
n=0

where a[0] = h[ N / 2], a[n] = 2h[ N2 − n], 1 ≤ n ≤ N / 2


DSP2008.doc 27

Group delay is N/2


for example
N =8, and (N+1) = 9 odd
using symmetry of coefficients
H(z) = h[0](1+z-8) + h[1](z-1+z-7) + h[2](z-2+z-6) + h[3](z-3+z-5) + h[4]z-4
giving
H(z) = z-4{ h[0](z4+z-4) + h[1](z3+z-3) + h[2](z2+z-2) + h[3](z1+z-1) + h[4]}
or
H(z) = e-j4w{2h[0]cos(4w) + 2h[1]cos(3w) + 2h[2]cos(2w) + 2h[3]cos(w) + h[4]}

Zero Locations:
Using symmetry we can write

N N
h( z ) = h[n]z − n = h[ N − n]z − n
n=o n =o

using m= N-n
N N
H ( z) = h[m]z − N + m = z − N h[m]z m = z − N H ( z −1 )
m =0 0

Thus for a given zero of H(z) its reciprocal is also a zero. Further zeros must be
conjugates for a real coefficient response. Hence any complex zero not on unit circle
is associated with three other zeros

z = re±j ϕ and z = (1/r)e±j ϕ

for the zeros on the unit circle, its reciprocal is also the conjugate, so these zeros are a
pair

z = e±j ϕ

A real zero pairs with its reciprocal

z = σ and z = 1/σ

Any zero at +1 or –1 is its own reciprocal and can appear only once.

Symmetrical Impulse Response with Even Length: (M)


N +1 / 2
H (e jw ) = e − jNw / 2 b[n] cos( w(n − 12 ))
n =1

where b[n] = 2h[ N2+1 − n], 1 ≤ n ≤ ( N + 1) / 2


e.g.
N =7, (N+1) even
using symmetry of coefficients
H(z) = h[0](1+z-7) + h[1](z-1+z-6) + h[2](z-2+z-5) + h[3](z-3+z-4)
DSP2008.doc 28

giving
H(z) = z-7/2{ h[0](z7/2+z-7/2) + h[1](z5/2+z-5/2) + h[2](z3/2+z-3/2) + h[3](z1/2+z-1/2)}
or
H(z) = e-j7w/2{2h[0] cos (7w/2) + 2h[1] cos(5w/2) + 2h[2] cos(3w/2) + 2h[3]cos(w/2)}

For this filter by using symmetry we have


H(-1) = (-1)NH(-1) = -H(-1)
hence
H(-1) = 0.
Therefore there is always a zero at –1
Thus this filter cannot be used as a high-pass filter.

Anti-Symmetric Response with Odd Length: (M)

Here h[n] = -h[N-n], here N+1 is odd


group delay is N/2
expression of the frequency response is

N /2
H (e jw ) = e − jNw / 2 e jπ / 2 c[n] sin( wn)
n =0

where c[n] = 2h[ N2 − n], 1 ≤ n ≤ N / 2


For these functions anti-symmetry gives

H(z) = -z-NH(z-1)

Hence the poles are located as in the previous case and there is also a zero at z = -1 as
H(-1) = -H(-1).
Similarly there is a zero at +1 as H(1) = -H(1)
It cannot be used in high-pass, Low-pass or Band-stop filters because of these zeros.

Anti Symmetric Response with Even Length: (M)

zero placements follow same rules as earlier cases but there is no zero at –1, and
there is a zero at 1
This means it cannot be used as a low-pass filter
group delay is N/2 and frequency response has form

N +1 / 2
H (e jw ) = e − jNw / 2 e jπ / 2 d [n] cos( w(n − 12 ))
n =1

where d [n] = 2h[ N2+1 − n], 1 ≤ n ≤ ( N + 1) / 2

As a general form describing all four cases.


DSP2008.doc 29

H (e jw ) = e − jNw / 2e jβ h( w) where β = 0 or π / 2

Zero locations for various cases of symmetric and anti-symmetric impulse response
functions.

All-Pass Filter: (P,M)

It is a filter with a constant magnitude response at all frequencies.


The simplest example is H(z) = z-k , but that is a trivial case.
A system function of form
N
ak z − N + k
a + a N −1 z −1 + a N − 2 z − 2 + ... + a1 z − N +1 + z − N
H ( z) = N = k =0
(a0 = 1)
1 + a1 z −1 + ... + a N z − N N
−k
ak z
k =0

is an all pass filter with {ak} real.


If we define the denominator as A(z), with a0 = 1 then

A( z −1 )
H ( z) = z − N
A( z )
and H(z)H(z-1) = 1= |H(z)|2, If z0 is a pole, then 1/z0 is a zero.
DSP2008.doc 30

Phase function shows discontinuities of 2π which can be removed by


UNWRAPPING.

Unwrapped phase function is non-positive, and continuous in 0 to π range.


In factored form can thus be given in general as
Nr
H AP ( z ) = ∏
( )(
z −1 − ak N i z −1 − bk z −1 − bk* )
−1 ∏
k =1 1 − ak z (
k =1 1 − bk z )(
−1
)
1 − bk* z −1
With Nr being the real poles and Ni the complex poles
and |ak| < 1, and |bk| < 1 for stability.

Properties:
The All-pass function is a lossless bounded real transfer function.
The magnitude of A(z)< 1 for  z  >1, = 1 for  z  = 1, < 1 for  z  <1
Unwrapped phase is monotonically decreasing so that group delay is positive.
The change in the phase of the Mth order all-pass function as w goes from 0 to π
radians is M π
Application is as a delay equaliser. If G(z) is a filter designed to meet a given
amplitude specification, its phase response will inn general be non-linear, It can then
be cascaded with an all-pass filter A(z) such that the overall function has a linear
phase and constant group delay

Minimum Phase and Maximum Phase functions: (M,P)

Given the same poles in two functions, the zeros influence the phase of the functions.
H1(z) = (z+b)/(z+a) and H2(z) = (bz+1)/(z+a) with  a  <1,  b  <1 both have poles
within unit circle and are stable zeros are at –b and –1/b.
Magnitudes are identical as H1(z).H1(z-1) = H2(z).H2(z-1)
Phase of H1(z) varies from 0 at w = 0 to +ve values to 0 at w = π , of H2(z) phase
varies from 0 at w = 0 to – π at w = π
In general, a causal, stable transfer function with all zeros outside the unit circle has
an excess phase (maximum phase function) compared with a function having all
zeros inside (minimum phase function)
DSP2008.doc 31

If the zeros have a mirror image symmetry, the magnitude responses are identical, but
phase responses differ.

H1(z) = 1 + ½ z-1 = z-1(z + ½)


H2(z) = ½ + z-1 = z-1( ½ z +1)

| H1,2(w)| = (5/4 +cos w)1/2 and


sin w
θ1 ( w) = − w + tan −1 1
2
+ cos w
sin w
θ 2 ( w) = − w + tan −1
2 + cos w

In the first case ∠H(π ) – ∠ H(0) = 0.


In the second this is π
A general FIR system of length M+1 has M zeros.

When all the zeros are inside the unit circle, net phase change between w = 0 and
w = π is 0. This is called a MINIMUM PHASE system. It has minimum group
delay.

When all zeros are outside the unit circle, the net change is M π
This is called a MAXIMUM PHASE system.
Any non-minimum phase function can be expressed as a product of a minimum phase
function and an all-pass function.

Stability:

Stability Triangle: (M,P)

If denominator in the H(z) is D(z) = 1 + d1z-1 + d2z-2


In terms of its poles
D(z) = (1-λ 1z-1) (1-λ 2z-1) = 1-(λ1+λ2)z-1 +λ1 λ2 z-2
Thus d1 = -(λ1+λ2) and d2 = λ1 λ2
As poles are within unit circle, + λ1  < 1,  λ2  < 1 hence  d2  < 1
Also

d1 ± d12 − 4d 2
λ1, 2 = −
2

Gives  d1  < 1 + d2
The poles (roots) will be within unit circle if d1 and d2 lie in the stability triangle.
DSP2008.doc 32

Test for Stability of higher order functions:

Schur-Cohn Stability Test: (M, p253)

Let DM(z) be the denominator polynomial and let DM be its mirror image
polynomial.
M
DM ( z ) = d i z −i with d 0 = 1
i =0

Form Mth order All-pass function

DM ( z )
AM ( z ) =
DM ( z )
If
M M
DM ( z ) = ∏ (1 − λi z −1 ) then d M = ∏ λi hence dM < 1
i =1 i =1

let kM = AM(∞ ) then kM = dM giving condition for stability of AM(z) as

k2M <1
now form a new AM-1(z) given by

AM ( z ) − k M A ( z) − d M
AM −1 ( z ) = z =z M
1 − k M AM ( z ) 1 − d M AM ( z )

Substituting AM(z) we get


−1 − ( M −2)
d'M −1 + d 'M −2 z + + d' 1 z + z − ( M −1)
AM −1 ( z ) = −1 −( M − 2) − ( M −1)
1+ d' 1 z + + d' M −2 z + d' M −1 z

d i − d M d M −i
i =
with d ' i = 1,2,3, M −1
1 − d M2

the poles of AM-1(z) are the roots of AM(λ0) = 1/kM


hence | AM (λ0)| > 1
As AM(z) is stable, it follows that | AM (z)| > 1 for z < 1
hence |λ0| < 1
thus AM-1(z) is stable.

We carry out this process for kM-2,….k1


then AM(z) is stable if Ki2 < 1 for all i.

example:using
DSP2008.doc 33

Hence system is stable.

Digital FIR Filter Design:

IIR and FIR selection:

• FIR can have linear phase response, are always stable if realised non-
recursively, are affected less by quantisation and rounding errors
• IIR require less no. of coefficients. They are derivable using analog filter
design techniques, and are easier to synthesise
• Therefore use IIR when requirement is for a sharp cut-off and high throughput
• Use FIR if no . of coefficients is not too large, and if linear phase is required

Steps in Design of digital filters:

1. Give specifications and filter type


2. Select suitable method and calculate coefficients of the filter transfer function.
3. Convert transfer function into a suitable structure such as cascade realisation or
parallel realisation.
4. Analyse for error from finite bit number effects.
5. Implement by building hardware or software for actual filtering operation.

FIR filter design:

FIR filter is characterised by a constant coefficient difference equation


DSP2008.doc 34
N −1
y[n] = h(k ) x( n − k )
k =0

where N is the filter length. It is a non-recursive all zero form and is always stable.
This is a straightforward way to calculate the response.
FIR filters can also be made to have an exactly linear phase response, with constant
group and phase delays. Thus the filter is non-distorting.
Finally FIR structures are easier to implement, and typical DSP processor
architectures are suited to FIR filtering, the implementation results in less finite
word-length errors.

Window method: (I,M)

Let the ideal filter be HD(w), then its impulse response is hD(n) which is obtained by
inverse Fourier transform.
Ideal impulse responses of the different filters are given below;
LP:
sin( nω c )
hD (n) = 2 f c
nω c
n ≠ 0, with hD(0) = 2fc

HP:
sin( nω c )
hD (n) = −2 f c
nω c
n ≠ 0, with hD(0) =1- 2fc

BP:
sin( nω 2 ) sin( nω1 )
hD (n) = 2 f 2 − 2 f1
nω 2 nω1
n ≠ 0, with hD(0) =2(f2-f1)

BS:
sin( nω1 ) sin( nω 2 )
hD (n) = 2 f1 − 2 f2
nω1 nω 2
n ≠ 0, with hD(0) =1-2(f2-f1)

Ideal responses are infinite in duration, and decrease with increasing n.


They are also symmetric, thus requiring calculation of only half the total number of
coefficients.
However, infinite duration implies infinite number of coefficients.
Practical approach is to truncate the impulse response by setting hD(n) = 0 for n > say
M. This is equivalent to multiplying hD(n) by a rectangular WINDOW

w(n) = 1 , n = 0,1,…,M-1
= 0 elsewhere.
DSP2008.doc 35

In the frequency domain, this gives convolution of HD(w) and W(w), the latter having
the (sin x)/x shape.

The resulting impulse response of the windowed filter has ripples and overshoots in
the pass and stop bands (Gibbs Phenomena).
The transition width of the filter is greater, and depends on the width of the main lobe
of the window function, and the ripples depend on the sidelobes.

Instead of a rectangular window, other window functions may be used, which


produce reduced ripples at the cost of greater transition width.

Gibbs phenomena: (M,P)

Truncating filter length causes oscillations in frequency response. As length


increases, ripples are closer, but height of largest ripples on either side of cut-off is
unchanged. These ripples arise because of convolution of the ideal response and the
transfer function of the window.

Rectangular window, N =11, cut-off = 0.3

N =51, cut-off = 0.3


DSP2008.doc 36

N = 101, cut-off = 0.3

Characteristics of some common window functions: (M)

Rectangular:

The frequency response of the rectangular window has a narrow main lobe and much
lower ripples or sidelobes. Main lobe width is 4 π /(2M+1), defined by zero crossings
of the main lobe. As M increases this width decreases., but the area under each lobe
remains constant. The main-lobe width is also the width measured between the
maxima and minima on either side of wc., at wc , H(jw) = 0.5, and pass-band and
stop-band ripples are the same. The transition band is less than lobe width. The ripple
does not depend on the filter length and wc.
w(n) = 1  n  ≤ (N-1)/2 = M
Transition width: 0.92 π /M, main lobe width 4 π /(2M+1)
Passband ripple: 0.7416
Main lobe relative to side lobe: 13 dB
DSP2008.doc 37

Stopband attenuation: 21 dB

Hanning: (M,I)
w(n) = 0.5 + 0.5Cos(2πn/N)  n  ≤ (N-1)/2
Transition width: 3.1 π /M, main lobe width 8π /(2M+1)
Passband ripple: 0.0546
Main lobe relative to side lobe: 31 dB
Stopband attenuation: 44 dB

Hamming: (M,I)
w(n) = 0.54 + 0.46Cos(2πn/N)  n  ≤ (N-1)/2
Transition width: 3.3 π /M, main lobe width 8 π /(2M+1)
Passband ripple: 0.0194
Main lobe relative to side lobe: 41 dB
Stopband attenuation: 53 dB

Blackman: (M,I)
w(n) = 0.42 + 0.5Cos(2πn/N-1) + 0.08 Cos(4πn/N-1)  n  ≤ (N-1)/2
Transition width: 5.5 π /M main lobe width 12π /(2M+1)
Passband ripple: 0.0017
Main lobe relative to side lobe: 57 dB
Stopband attenuation: 74 dB

These windows have fixed characteristics, and equal Passband and Stopband ripples.
This is their major disadvantage.
DSP2008.doc 38

Kaiser window: (M,I)


This window has a ripple control parameter β which allows adjustment of ripple
against transition width.
The window function is:
2 1/ 2
2n
I0 β 1−
N −1
w(n) =
I0 (β )
for -(N-1)/2 ≤ n ≤ (N-1)/2, and = 0 elsewhere.
Here I0 is the zero-order modified Bessel’s function of the first kind., and β controls
the way the function tapers at the edges in the time domain.

With β = 0 Kaiser window corresponds to the rectangular window.


With β = 5.44 results are very similar to the Hamming window.

β is determined according to Stopband attenuation requirement as follows:

if A ≤ 21 dB, β=0
21 < A < 50 dB β = 0.5842(A-21)0.4 + 0.07886(A-21)
A ≥ 50 dB β = 0.1102(A-8.7)
where A = -20 log (δ ) and δ = min(δp, δs).
The number of coefficients N is given by

N ≥ (A-7.95)/14.36 ∆f where ∆f is the normalised transition width.

Example:
FIR filter having specifications:
DSP2008.doc 39

Passband edge: 1.5 kHz


Transition width 0.5 kHz
Stopband attenuation > 50 dB
Sampling frequency 8 kHz
Here Stopband requirements satisfied by Kaiser, Blackman, Hamming.
Use Hamming
Hence δf = 0.5/8 = 0.0625
N = 3.3/δf = 52.8 = 53
For LP hD[n]= [2fCsin(nwc)] /nwc
And w(n) = 0.54 + 0.46Cos(2 π n/53) -26≤ n ≤ 26
Use fc centred on the transition band = 1.5 + 0.25 = 1.75 kHz, normalised to 1.75/8 =
0.21875
Then filter coefficients = hD(n)*w(n), e.g. n = 26,
hD(26) = (2 × 0.21876)×sin(26 × 2 π × 0.21875) / (26 × 2 π × 0.21875) × 2 π
= 0.01131
w(26) = 0.54+0.46 cos(2 π × 26/53) = 0.08081 and thus
h(26) = h(-26) = 0.01131× 0.08081 = 0.000913
to make the filter causal, add 26 to the indices.

Example:
Passband 150-250 Hz, Transition width 50 Hz, Passband ripple 0.1dB Stopband
attenuation 60 dB, sampling frequency 1kHz.
Here 20 log(1+ δp) = 0.1 giving δp = 0.0115
-20 log δs = 60 giving δs = 0.001
now δ = min(δp, δs) = 0.001
Attenuation requirements can only be met by Kaiser and Blackman.
For Kaiser number of coefficients
N ≥ (60-7.95) / 14.36(50/1000) = 72.49 i.e. 73
The ripple parameter is β = 0.1102(60-8.7) = 5.65
Ideal response cutoffs are at fc1 – δf/2 and fc2 + δf/2, i.e. 125 and 275 Hz
For Blackman window N = 5.5/δf = 5.5/(50/1000) = 110.
DSP2008.doc 40

Kaiser is more efficient.

FIR Filters with Smooth Transition: (M)

Sharp discontinuities in ideal filters result in ripples in frequency response. Using


tapered windows is one solution, the other is to specify a smoother transition band. If
the edge frequency responses are connected by a straight line (first order spline) LPF
response requirement is now for a trapezoidal response
Higher order splines in the transition region may be used.
For Pth order spline, LP impulse response with ∆w = transition bandwidth
h(n) = wc/ π for n = 0, and [(sin (∆wn/2P))/ (∆wn/2P)]P.(sin wcn) / π n for  n  >0
The optimum P is 0.624(∆w)N

Frequency Sampling Method: (I)

This method is based on the sampling of the ideal frequency response desired, and
then taking the inverse DFT of the samples to get h(n)
If N samples are taken at intervals kFs/N, k ==0,1,…N-1
Then
N −1
1
h( n) = H (k )e j ( 2π / N ) nk
N k =0

H(k) are the samples of the target frequency response.


N −1
1
h ( n) = H (k ) e − j 2πak / N e j ( 2π / N ) nk
N k =0

where a = (N-1)/2
N −1
1
h( n) = H (k ) cos[2πk (n − a ) / N ]
N k =0

as h(n) is real. For a linear phase filter h(n) is symmetric leading to:

N / 2 −1
1
h( n) = 2 H (k ) cos[2πk (n − a ) / N ] +H (0)
N k =0

for N odd upper limit is (N-1)/2


Example:
DSP2008.doc 41

LP filter, length 9, sampling 18 kHz, pass-band 0-5kHz


Samples at 18/9 = 2kHz intervals
H(k) = 1 k= 0,1,2
=0 k = 3,4

h[0] = 7.2522e-02 = h[8], h[1] = -1.1111e-01 = h[7], h[2] = -5.91209e-02 = h[6],


h[3] = 3.19931e-01 = h[5], h[4] = 5.5555e-01

The response is poor in the transition region, and stop band attenuation is insufficient.
Better response can be obtained by including samples in the transition region.

Alternatively larger number of samples (sampling at closer intervals) may be done


and h[n] calculated, Then windows functions may be applied to reduce filter length.
The frequency sampling method is useful in designing piecewise non-standard filters

Optimal (CAD) Method or Parks-McCallen or Remez Method: (P,M)

The window and frequency sampling methods produce ripple that is maximum near
band edges, and decreases further away..
The Optimal method distributes ripples evenly (equiripple) over stop and pass bands,
giving a better approximation to the desired frequency response.

Let HD(w) be the ideal and H(w0 the actual and W(w) be a weighting function that
allows the relative error of the approximation to be defined
Then the difference between ideal and practical is E(w) = W(w)[HD(w) –H(w)]
The method finds the h(n) which minimises the maximum weighted error in the pass
and stop bands
It can be shown that when max E(w) is minimised the filter will have an equi-
ripple response, with the ripple alternating between two equal amplitude levels.
(Alteration Theorem) for linear phase filters there are
R+1 or R+2 such extremas, R = (N+1)/2.
The locations of the extremal frequencies are generally not known except at the band
edges fp and fs/2
If the extremal frequencies can be found, then the frequency response is known, and
the impulse coefficients can be obtained.
DSP2008.doc 42

To find the extremal frequency the REMEZ algorithm (Parks-McCallen Algorithm)


starts with an initial estimate of three R+1 extremas, and then uses a convergent
iterative process to arrive at the extremal frequency values.
The number of the extremal frequencies depends on the filter length, which can be
calculated from the desired attenuation, ripple and transition band

Example:

Linear phase equiripple filter , pb 0.3 –0.5 , sb 0 – 0.25, 0.55-1, desired pb magnitude
= 1 , sb magnitude 0, order 27
» n= 27;
» f = [0,0.25,0.3, 0.5,0.55,1];
» m= [0,0,1,1,0,0];
» b = remez(n,f,m);
» [h,w] = freqz(b,1,256);
» mag = 20*log10(abs(h));
» plot(w/pi, mag,' b'); grid;
»
BPF, passband 8-12kHz, Sbripple 60dB, peak pb ripple: 0.001, fs = 44.14 kHz,
transition width 3 kHz

f =[5,8,12,15];
» m=[0,1,0];
» dev = [0.001, 0.001,0.001];
» fs = 44.14;
» [n,fo,mo,w] = remezord(f,m,dev,fs);
» b= remez(n,fo,mo,w);
» [h,om] = freqz(b,1,256);
» mag = 20*log10(abs(h));
» plot(om/(2*pi),mag,'b'); grid;
DSP2008.doc 43

n = 48
fo = 0, 0.22655188038061, 0.36248300860897, 0.54372451291346,
0.67965564114182
1.00000000000000
mo =0 0 1 1 0 0
w =1 1 1

Comparison of methods: (I,M)

• Optimum method is the easiest and efficient, with total control over
specifications, but requires the necessary software.
• Window method gives equal pass and Stopband ripples, and is suitable for
direct application. It may result in overdesign in any one band, and does not
give full control over ripples and cut-off frequencies.
• Frequency sampling method can be applied directly or recursively, and integer
coefficients can be used. It is suitable for primitive ALUs and for designing
filters with arbitrary bands. It lacks control over edge frequencies and ripples.

Finite wordlength effects: (I)

ADC noise:
Quantization error, reduced by using ADC with larger bit length

Coefficient quantization error:


Coeficients represented by fixed no. of bits and equivant to adding E(w) to H(w)
Altering the structure, giving greater peak ripple, and inaccurate cutoff

Bounds on the error are given by different authors


 E(w)  = N2-B
under worst case, is overly pessimistic
 E(w)  = 2-B(N/3)1/2
and
 E(w)  = 2-B[(NlogeN)/3]1/2
are based on statistical bounds and give a more realistic estimate.

Roundoff error:
x(n-m) is 12 bit and h(n) is 16 bit. The 24 bit product is rounded off to 16 bits in
memeory, or 12 bit in DAC, may result in more severe effect than ADC quantisation.
Avoided partly by using double length registers and rounding in the final step.
DSP2008.doc 44

Overflow error:
When the sums exceed allowed wordlength. Avoided by scaling down h(n) and
inputs by constants = sum of terms and then rescaling.

IIR Filter Design: (I, P,M)

IIR selection:
• IIR require less no. of coefficients. They are derivable using analog filter
design techniques, and are easier to synthesise
• Therefore Use IIR when requirement is for a sharp cut-off and high throughput

Steps in Design of digital IIR filters:

1. Give specifications and filter type


2. Select suitable lowpass analog filter prototype to meet the specifications.
3. Design the analog filter using specifications to find required order and
find prototype analog coefficients of the filter transfer function.
4. Use frequency band transformation (with pre-warping if necessary) to
convert the LP prototype to the required type of filter, and determine the
equation of H(s).
5. Choose suitable analog to digital filter transformation method, and apply
it to the analog filter to get the digital filter design.
6. Convert digital transfer function into a suitable structure such as cascade
realisation or parallel realisation.
7. Analyse for error from finite bit number effects. If specifications are not
met, repeat above steps choosing a higher order for the filter or different
prototype.
8. Implement by building hardware or software for actual filtering
operation.

Analog filter specifications: (M)

Ideal filters have brick-wall characteristics, which do not give causal impulse
responses, and are therefore unrealisable.
A realisable filter, say a LPF is generally specified by giving a desired passband gain
of 1 with acceptable error (tolerance) ±δ p (Pass band deviation).

1-δp < | Ha(j Ω ) | <1+δp for | Ω | ≤ Ω p

Ap = 20log(1+δ p) is called the Passband ripple in dB

Stopband Ωs ≤ Ω ≤ ∞ response approximates 0 with error δ s (stopband deviation)


DSP2008.doc 45

| Ha(j Ω ) | ≤ δs for Ωs ≤ Ω ≤ ∞

As = -20log(δS) is the stopband attenuation in dB

Ωp and Ωs are the passband and stopband edge frequencies and δp and δs are the
ripples

1+δ p
1
1-δ p
1/√1+ε2

passband passband

stopband stopband
δs 1/A

Ωp Ωs Ωp Ωs F/2
transition band transition band

In the Normalised specification, maximum value of passband magnitude is made 1


and the passband ripple is the minimum value of magnitude in the passband, given by

1//√ (1+ε2),
The maximum stopband ripple is 1/A.

A p = 10log(1+ε2) = -20log(1-δ p), and As = -20log(1/A) = -20log(δs)

normalised frequency is Ω /F where F is the sampling frequency

The Transition ratio or the selectivity parameter is


k = Ωp /Ωs and is <1 for LPF.
The discrimination parameter
k1 = ε / (√ (A2-1)). generally k1 <<1.

Design by pole – zero placement: (I)

Placing a zero at given point in z-plane makes frequency response 0 at that point and
a pole produces maximum response.
Poles close to unit circle give large peaks and zeros close to the circle produce
troughs.
For the coefficients to be real poles and zeros must be either real or in conjugate
pairs. Further, poles must be within unit circle for stability
For the pole with r > 0.9, bandwidth is approximately
DSP2008.doc 46

r = 1-(BW/F)π
Example:

Bandpass filter with complete rejection at 0 and 250 Hz, narrow passband centred at
125 Hz, and 3-dB bandwidth 10 Hz. Sampling frequency 500 Hz.
zeros at 0 and 360 x 250/500 = 180 degrees. Pass band at 125 requires poles at
± 360 x 125/500 = ± 90 as conjugate pair.
with BW = 10, F = 500, r = 0.937 for poles 0.937

thus H(z) = (z-1)(z+1)/(z - 0.937ej π /2)(z - 0.937e-j π /2)

i.e. H(z) = (1-z -2)/(1+0.877969z –2)


The difference equation is y[n] = -0.877969y[n-2] + x[n] – x[n-2]

Example 2
Notch filter, notch frequency 50 Hz, 3 dB BW ± 5Hz, sampling
500 Hz.
To reject 50 Hz, a pair of complex zeros at ± 360 x 50/500
= ± 36 degrees
To get sharp rejection a pair of poles at r < 1, from BW 10 Hz
we get r = 0.938

The H(z) is
H(z) = [z- e - j36][z- e j36]/ [z-0.937e –39.6] [z-0.937e +39.6] giving
1 − 1.6180 z −1 + z −2
H ( z) =
1 − 1.5161z −1 + 0.8780 z − 2
with
y[n] = x[n] − 1.6180 x[n − 1] + x[n − 2] + 1.5161 y[n − 1] − 0.8780 y[n − 2]

IIR Filter Design By Approximation Of Derivatives: (P)


(Refer to Proakis and Manolakis)

Bilinear Transform Method Of IIR Filter Design: (P)

(For derivation of the bilinear transformation equation refer to Proakis and


Manolakis)
Bilinear transformation maps Left half s-plane uniquely into the unit circle in z-plane.
2 1 − z −1
s =
T 1 + z −1
and an analog transfer function H(s) is mapped to the z plane as H(z) .
H (z) = H (s) 2 1− z −1
s=
T 1+ z −1
DSP2008.doc 47

jw’ Im z

-1 1 Re z
σ

s-plane z-plane

Bilinear transformation mapping

imaginary axis maps to unit circle, LHP to a point within the unit circle, and RHP to
a point outside.
Making substitution z = ejwT and s = jw’
s-plane w’ = k tan (wT/2), k = 1 or T/2
so +ve imaginary axis in s-plane is the upper half of unit circle. Similarly for the
negative imaginary axis the lower half of the unit circle. This is a non-linear
mapping and introduces a distortion called frequency warping.

We therefore have to pre-warp the critical bandedge frequency to find their analog
equivalents, design the analog prototype, using these pre-warped frequency and the
transform with bilinear transform
w’=k tan(wT/2)
w
π

0 W’

In design the digital specifications are transformed to analogue by inverse bilinear


transform, to get specifications of the analogue prototype.
Then analogue filter is designed for the transformed specifications,
Finally the bilinear transform is applied again to get the digital filter

The process is summarised by:


DSP2008.doc 48

1. Use digital specifications to decide upon a suitable normalised analogue transfer


function H(s)
2. Let the critical frequency of the digital filter be wp (cut-off or pass-band edge)
3. Obtain analogue critical frequency wp’ by pre-warping wp’ = k tan(wpT/2)
4. De-normalise the analogue filter replacing s with s/wp’
5. Apply bilinear transformation replacing s by (z-1)/(z+1)

Example:

Normalised transfer function is H(s) = 1 / (s+1). Sampling frequency 150 Hz and cut-
off 30 Hz
Critical frequency is wp = 2 π 30 rad.
analogue frequency after pre-warping wp’ = tan (wpT/2) with T = 1/150 we get
wp’=0.7265
The de-normalised transfer function is H’(s) = 1/[(s / 0.7265) + 1]
then H(z) = H’(s) with bilinear transform substitution
H(z) = 0.4208 (1 + z –1) / (1-0.1584 z –1)
The difference equation is y[n] = 0.1584y[n-1] + 0.4208[x[n] +x[n-1]]

Design using Analog filters:

Butterworth LPF: (I,P)

2 1
) =
H ( w'
1 + ( w'/ w'
p)
2N

LP Butterworth has a magnitude squared response

wp’ is the 3-dB cut-off frequency and N is the order.


Response is monotonic in passband and stopband, and is maximally flat.

Stopband attenuation is –20log(δ s) and filter order is given by


log[(1 δ s ) − 1]
N=
2 log(ws' / w 'p )
1 n=10

n=4

0
0 1 3
Butterworth LP
DSP2008.doc 49

The transfer function has zero at ∞ and uniformly spaced poles on a circle of radius
wp’ in the s-plane These poles occur in conjugate pairs and lie on LHS of s-plans

pk = wp’ ej π (2k + N –1)/2N k = 1,2, …,N

Chebychev: (I,P)

Two types
1. Type 1 with equiripple passband, monotonic stopband
2. Type II with monotonic passband, equiripple stopband

| H(w’) | 2 = K/1+ ε2C2N(w’/w’p)

CN is a Chebychev polynomial of order N

Passband ripple in dB is ≤ 10log(1 + ε2) = -20 log(1- δ p)


Stopband attenuation ≥ - 20 log (δ s)
for these filters
N ≥ cosh –1 (δ /ε) / cosh -1(wS’/w’p) δ S =1/(1+δ 2)1/2
Poles of Chebychev filter lie on an ellipse in s-plane, and have co-ordinates
pk = w’p [sinh (α)cos(β k) + j cosh (α) sin (β k)]
where
α = (1/N)sinh –1 (1/ε); β k = (2k+N-1) π / 2N, k = 1,2,3,…,N

1 1

n=3

n=2 n=4

0 0
0 1 3 0 1 3
Cheby I LP Cheby II LP

Elliptic filter (Cauer Filter): (I,P)

This is equiripple in both passband and stop band.


DSP2008.doc 50

| H(w’) | 2 = K/1+ ε2G2N(w’


Elliptic filters provide the most efficient filters in terms of amplitude response.

n=4

0
0 1 3
Elliptic LP

Comparison of analog filters: (I)

For given specification, lowest order is required for Elliptic. next Chebychev and
highest order for Butterworth.
For a given order, sharpest transition region in the same order
In Butterworth and Chebychev Linear phase is approximated for up to ¾ pass-band
region
Elliptic has a linear phase response unto about half its passband.
Best phase performance is by Bessel filter of order N. This gives linear phase
response, but amplitude performance has a less sharp roll-off.

Band transformations: (I,P)

The design of a LPF can be converted to other types of filters by Band-


transformations.

Steps in the design of these filters are

1. From specifications determine a suitable normalised LPF H(s)


2. Determine and pre-warp the critical frequencies
3. Replace s in the H(s) using one of the following:

s
For LP to LP : s = where w'p is the critical frequency
w'p
w'p
For LP to HP : s =
s
2
s + w0
2
For LP to BP : s = ; w02 = w1 'w1 '
; Ws = w2 '
− w1 '
Ws
Ws
For LP to BS : s = 2 2
s + w0
DSP2008.doc 51

4. Apply the BZT

example:

BP filter, Butterworth, Passband 200-300 Hz. Sampling frequency 2000 Hz.


filter order 2

Pre-warp the frequencies:

w1T
w1' = tan = tan(200π / 2000) = 0.3249
2
w2T
w2' = tan = tan(300π / 2000) = 0.5095
2
∴ w0 = 0.1655, W = w2 '
− w1 '= 0.1846
ana log LP has 1 / 2 order of BP
1
∴ H (s) =
s +1

Using LP to BP transformation
1 Ws
( s ) = H ( s ) s = ( s 2 + w 2 ) / Ws =
H' 2
= 2 2
0
( s + w0 ) / WS + 1 s + Ws + w0
2

Applying BZT
W ( z − 1) /( z + 1)
H ( z) = H '
( s ) s = ( z −1) /( z +1) = 2
[( z − 1) /( z + 1)]2 + W ( z − 1) /( z + 1) + w0
Substituting value for W and w02
1 − z2
H ( z ) = 0.1367
1 − 1.2362 z −1 + 0.7265 z − 2

If the H(s) is of a high order, we express it in a factored form for cascade realisation
with first and second order factors and then transform each factor separately.

Finite word-length effects: (I)

Errors in filter can be due to the following


1. ADC quantisation noise as sample is represented by a limited number of bits.
2. Coefficient quantisation error: same cause. If poles are very close to unit circle,
deviation in their position may create instability.
3. Overflow error when additions of partial results take place in a register of limited
word-length. Overflow can change the sign making a large +ve number a large –
ve number. Feedback in IIR realisation increases this tendency to oscillate. These
are called LIMIT CYCLES. These can be solved by scaling the inputs to the
adders so that it is always low. The scale factor s1 is obtained from the impulse
response from input to output of the first adder. f(k)
L1 norm defines s1 as s1 = Σ | f(k) | ensuring a gain of at most 1
DSP2008.doc 52

L2 norm defines it as √ Σ(f2(k)), limiting energy.


L∞ norm defines it as Max | F(w)| where f(w) is peak amplitude of frequency
response
L2 < L∞ < L1
4. Product-round off error when results of arithmetic operations are rounded off to
the allowed word-length.

You might also like