EC3492 Digital Signal Processing Lecture Notes 2
EC3492 Digital Signal Processing Lecture Notes 2
com
PRE-REQUISITE:
Anything that carries some information can be called as signals. Some examples are ECG,
EEG, ac power, seismic, speech, interest rates of a bank, unemployment rate of a country,
temperature, pressure etc.
A signal is also defined as any physical quantity that varies with one or more independent variables.
A discrete time signal is the one which is not defined at intervals between two successive samples
of a signal. It is represented as graphical, functional, tabular representation and sequence.
Some of the elementary discrete time signals are unit step, unit impulse, unit ramp, exponential
and sinusoidal signals (as you read in signals and systems).
If the value of E is finite, then the signal x(n) is called energy signal.
If the value of the P is finite, then the signal x(n) is called Power signal.
Some of the operations on discrete time signals are shifting, time reversal, time scaling, signal
multiplier, scalar multiplication and signal addition or multiplication.
The response of the system for unit sample input is called impulse response of the system h(n)
The first part contain initial condition y(-1) of the system, the second part contains input x(n) of the
system.
The response of the system when it is in relaxed state at n=0 or
y(-1)=0 is called zero state response of the system or forced response.
The output of the system at zero input condition x(n)=0 is called zero input response of the system
or natural response.
The impulse response of the system is given by zero state response of the system
The total response of the system is equal to sum of natural response and forced responses.
A s we have observed from the discussion o f Section 4.1, the Fourier series representation o
f a continuous-time periodic signal can consist of an infinite number of frequency components,
where the frequency spacing between two successive harmonically related frequencies is 1 / T p, and
where Tp is the fundamental period.
Since the frequency range for continuous-time signals extends infinity on both sides it is
possible to have signals that contain an infinite number of frequency components.
In contrast, the frequency range for discrete-time signals is unique over the interval. A
discrete-time signal of fundamental period N can consist of frequency components separated by 2n /
N radians.
Consequently, the Fourier series representation o f the discrete-time periodic signal will
contain at most N frequency components. This is the basic difference between the Fourier series
representations for continuous-time and discrete-time periodic signals.
PROPERTIES OF DFT:
The development of computationally efficient algorithms for the DFT is made possible if we
adopt a divide-and-conquer approach. This approach is based on the decomposition of an N-point
DFT into successively smaller DFT. This basic approach leads to a family o f computationally
efficient algorithm s know n collectively as FFT algorithms.
UNIT-2&3
STRUCTURES OF FIR AND IIR SYSTEMS
STRUCTURES FOR THE REALIZATION OF DISCRETE-TIME SYSTEMS
The major factors that influence our choice o f a specific realization are computational complexity,
memory requirements, and finite-word-length effects in the computations.
Direct-Form Structure
The direct form realization follows immediately from the non recursive difference equation given
below
Cascade-Form Structures
The cascaded realization follows naturally system function given by equation. It is simple matter to
factor H(z) into second order FIR system so that
Frequency-Sampling Structures
The frequency-sampling realization is an alternative structure for an FIR filter in which the
parameters that characterize the filter are the values o f the desired frequency response instead of the
impulse response h(n). To derive the frequency sampling structure, we specify the desired frequency
response at a set o f equally spaced frequencies, namely
Lattice Structure
In this section w e introduce another F IR filter structure, called the lattice filter or
Lattice realization. Lattice filters are used extensively in digital speech processing
And in the implementation of adaptive filters. Let us begin the development by considering a
sequence of FIR filters with system functions
DIRECT FORM II
Cascade-Form Structures
Let us consider a high-order IIR system with system function given by equation. Without loss o
f generality we assume that N > M . T h e system can be factored into a cascade o f second-
order subsystem s, such that H (z) can b e expressed as
Parallel-Form Structures
A parallel-form realization o f an IIR system can be obtained by performing a partial-fraction
expansion o f H( z) . Without loss o f generality, w e again assume that N > M and that the poles are
distinct. Then, by performing a partial-fraction expansion o f H( z ), we obtain the result
************************************************************************
Example
Given X 1 3.5 * 10 12 , X 2 4.75 * 10 6 . Find the product X 1 X 2
X=(3.5 X 4.75) 10(-12+6)
= (16.625)10-6 in decimal
In binary: (1.5)10 X (1.25)10 = (210.75) X (210.625)
= 2001 X 0.1100 X 2001 X 0.1010
= 2010 X 0.01111
Addition and subtraction:
Here the exponent of a smaller number is adjusted until it matches the exponent of a larger number.
Then, the mantissa are added or subtracted
The resulting representation is rescaled so that its mantissa lies in the range 0.5 to 1.
Eg: Add (3.0)10 & (0.125)10
(3.0)10 =2010 X 0.1100 = r e1 X M 1
(0.125)10 =2000 X 0.0010 = r e2 X M 2
Now adjust e2 Such that e1=e2
(0.125)10 =2010 X 0.0000100
Addition 2010 (0.110000 + 0.0000100) 2010 X 0.110010
Subraction 2010 X 1.001101
Compare floating point with fixed point arithmetic.
Sl.No Fixed point arithmetic Floating point arithmetic
1 Fast operation Slow operation
2 Relatively economical More expensive because of costlier hardware
3 Small dynamic range Increased Dynamic range
4 Round off errors occurs only for Round off errors can occur with addition and
addition multiplication
5 Overflow occur in addition Overflow does not arise
6 Used in small computers Used in large general purpose computers.
2
E e 2 n e 2 n de
1
q q
2
q
1 2
E e 2 n e 2 n de ------------------------------->(4)
q q
2
E en 0
E 2 en 0 ------------------------------------------->(5)
Substituting (4) and (5) in (1)
q
2
e n de 0
1 2
q q
e2
2
1 q q
3 3
3q 2 2
1 q 3 q 3
3q 8 8
1 q 3 q 3
3q 8 8
1 2q 3
3q 8
q2
e2 ------------------------------------------------->(6)
12
1
In general, 2 b q -------------------------------------------->(7)
2b
2
2 b 2
e
12
2 b
2
e2 ----------------------------------------------->(8)
12
Equation (8) is known as the steady state noise power due to input quantization.
R
q b in two’s complement representation.
2
R
q b in sign magnitude (or) one’s complement representation.
2 1
R Range of analog signal to be quantized.
Steady state Output Noise power:
After quantization, we have noise power e2 as input noise power. Therefore, Output noise power of system is
given by
eo2 e2 h 2 n ------------------------------------>(9)
n 0
1
2j H Z H Z 1
dZ
z
e2
Where the closed contour integration is evaluated using the method of residue by taking only the poles that
lie inside the unit circle.
Z transform of h(n), H Z hn z n
n 0
Z transform of h2(n) = Z[h2(n)] h 2 n z n hn hn z n -------------------->(10)
n 0 n 0
hn H Z Z n 1 dZ -------------------------------->(11)
1
2j
By Inverse Z transform,
h 2 n z n H Z Z n 1 dZ hn z n
1
n 0 n 0 2 j
1
H Z hn Z 1 dZ
2j n 0
dZ
h 2 n hn Z 1 n
1
n 0 2j H Z
n 0 Z
1
2j
H Z hn Z
n
1
Z 1 dZ
n 0
h n 2j H Z H Z Z ----------------------------------->(12)
2 1 dZ 1
n 0
2 j c
H(z)
1 a z 1
)
1 a z 1
Given
(z a)
H(z
z 1
a
1
Substituti ng H(z) and H(z ) in equation (1), we have
e
2
1 a z 1 a z 1 e
2
1 a 2 dz
e z 1 dz z 1
2
2 j c
(z a) z 1
a 2 j c
( z a ) z a
1
2 1
e residue of H(z) H(z 1 ) z 1at z a residue of H(z) H(z 1 ) z 1at z
a
2
e z a
1 a 2 z 1 0
z a z 1 a
2 1 a 2 1 a
2
e 1 e
z a
1 a
2 2 b
Where, e
2
12
**************************************************************************************
Find the steady state variance of the noise in the output due to quantization of input for the first order
filter.
y (n ) a y (n 1) x (n )
Solution:
The impulse response for the above filter is given by h(n) an u(n)
2 e2 h 2 ( n )
k 0
e2 a 2 n
k 0
1 a 2 a 4 ....
2
e
1
e2
1 a2
2 2 b 1
( or )
12 1 a 2
***************************************************************************************
The output of the A/D converter is applied to a digital filter with the system function
H Z
0.45Z
Z 0.72
Find the output noise power of the digital filter, when the input signal is quantized to 7 bits.
Given:
H Z
0.45Z
Z 0.72
Solution:
0.45Z 1
H Z H Z 1 Z 1
0.45Z
1
Z 0.72 Z 0.72
Z 1
0.45 2 Z 1
Z 0.72 1 0.72
Z
0.2025Z 1
Z 0.72 1 0.72Z
Z
0.2025Z 1 Z
Z 0.72 Z 1
0.72
0.28125
Z 0.72Z 1.3889
Now the poles of H(Z)H(Z-1)Z-1 are p1=0.72 , p2=1.3889
Output noise power due to input quantization
1
eo2 e2
H Z H Z 1 Z 1 dZ
2j
N
e2 Re s H Z H Z 1 Z 1
i 1 z pi
N
e2 Re s H Z H Z 1 Z 1
i 1 z pi
-1 -1
Where p1,p2,…..pn are the poles of H(Z)H(Z ) Z that lies inside the unit circle in z-plane.
0.28125
eo2 e2 Z 0.72
Z 0.72Z 1.3889 Z 0.72
0.28125
e2
0.72 1.3889
0.4205 e2
***************************************************************************************
1 1
Consider the transfer function H ( z ) H 1 ( z ) H 2 ( z ) where H 1 ( z ) 1
and H 2 ( z )
1 a1 z 1 a2 z 1
1
01 H ( z ) H ( z 1 ) z 1dz
2
2j c
1 1 1 1 1
e z 1dz
2
1 1
2j c 1 a1 z 1 a 2 z 1 a1 z 1 a 2 z
2 1 1
e of residue of H ( z ) H ( z 1 ) z 1 at po1es z a1 , z a 2 , z and z
a1 a2
If a1 and a2 are less than the poles z=1/a1 and z=1/a2 lies outside of the circle z 1. So, the residue of H(z) H(z-1) z-
1
at z=1/a1 and z=1/a2 are zero. Consequently we have,
01
2
of residue of H(z)H(z 1
) z 1 at po1es z a1 , z a 2
z 1 z 1
z a1
1 a1 z 1 a2 z 1 a1 z 1 a2 z za1
1 1
z a 2
1 a1 z 1 a2 z 1 a1 z 1 a2 z za2
1 1
e
1 1
2
a2
2
a2
1 1 a 2 1 a1a 2 1 1 a1a 2 1 a 2
2
a1 a1
2 a1 1 1 a2 1 1
01 e ( 4)
2
. . . .
a1 a 2 1 a1 1 a1a 2 a 2 a1 1 a 2 1 a1a 2
2 2
2j c
02 H 2 ( z ) H 2 ( z 1 ) z 1dz
2
e
2
1 1
1
2j c 1 a2 z 1 a2 z
z 1dz
z 1
e z a2
1 a2 z 1 1 a2 z za2
2
z 1
e z a 2 z 1
1 a2 z 1 a2 z za2
2
1
2 1
e 2
(5)
1 a 2
2
e
1
a1 1 a 2 a 2 1 a1
2 2 2
1 a2
2
1 a1 1 a 2 1 a1a 2 a1 a 2
2 2
2
e
1
a1 a2 1 a1a2
1 a 2
2
1 a1 1 a 2 1 a1a 2 a1 a 2
2 2
1
2 2 b
1 a1a2
1 a 2
12 2
1 a1 1 a 2 1 a1a 2
2 2
The steady state noise power for a1 0.5, a 2 0.6 is given by
2 2 b 1 1 0.50.6
12
1 0.6
2
1 0.5 1 0.6 1 0.60.5
2 2
2 2 b
5.4315
12
*************************************************************************************
1
Draw the quantization noise model for a second order system H ( z ) and find the
1 2r cos z 1 r 2 z 2
steady state output noise variance.
Solution:
Given:
1
H ( z)
1 2r cos z 1 r 2 z 2
The quantization noise model is,
we know, 0 01 02
2 2 2
But 01 02 e
2 2 2
h
n
2
(n ), which gives us
12
r
n 0
2n
sin 2
2 b
2 2 b 1 1 r 1 cos 2
2
6 2 sin 1 r 1 2r cos 2 r
2 2 2 4
2 2 b 1 r 2
6 1 r 1 2r 2 cos 2 r 4
2
******************************************************************************
Co-efficient quantization error
We know that the IIR Filter is characterized by the system function
M
b z k
k
H Z k 0
N
1 ak z k
k 1
After quantizing ,
M
b k q z k
H Z q k 0
N
1 a k q z k
k 1
Where ak q a k a k
bk q bk bk
The quantization of filter coefficients alters the positions of the poles and zeros in z-plane.
1.
If the poles of desired filter lie close to the unit circle, then the quantized filter poles may lie outside
the unit circle leading into instability of filter.
2. Deviation in poles and zeros also lead to deviation in frequency response.
***************************************************************************************
Consider a second order IIR filter with H ( z ) 1 .0 find the effect on quantization
(1 0 .5 z 1 )(1 0 .4 5 z 1 )
on pole locations of the given system function in direct form and in cascade form. Take b=3bits.
[Apr/May-10] [Nov/Dec-11]
Solution:
Given that,
1 .0
H (z)
(1 0 .5 z 1 )(1 0 .4 5 z 1 )
z2
( z 0.5)( z 0.45)
The roots of the denominator of H(z) are the original poles of H(z). let the original poles of H(z) be p 1 and
p2 .
Here p1=0.5 and p2=0.45
Direct form I:
1 .0
H (z)
(1 0 .5 z )(1 0 .4 5 z 1 )
1
1
H ( z)
1 0.5 z 0.45 z 1 0.225 z 2
1
1
1 0.95 z 0.225 z 2
1
Y ( z) 1
let H ( z )
X ( z ) 1 0.875 z 0.125 z 2
1
In cascade realization the system can be realized as cascade of first order sections.
H(z)=H1(z)+H2(z)
Where,
1 1
H 1 (z) 1
and H 2 (z)
1 0.5 z 1 0.45 z 1
Let us quantize the coefficients of H1(z) and H2(z) by truncation.
Convert to Truncate to Convert to
.510 .10002 .1002 .510
Binary 3-bits decimal
Convert to Convert to Convert to
.4510 .01112 .0112 .37510
Binary 3-bits decimal
let , H1 (z) and H 2 (z) be the transfer function of the first-order sections after quantizing the coefficients.
Saturation arithmetic eliminates limit cycles due to overflow, but it causes undeniable signal distortion
due to the non linearity of the clipper.
In order to limit the amount of non linear distortion, it is important to scale input signal and unit sample
response between input and any internal summing node in the system to avoid overflow.
From figure
W ( z) S0 S
H ' ( z) 1 2
0
X ( z ) 1 a1 z a2 z D( z)
S0 X ( z )
W ( z) S 0 S( z ) x(Z)
D( z)
1
Where S ( z )
D( z)
we have
S
w( n ) 0 S (e j ) X (e j )(e jn ) d
2
S2 2
w(n) 2 0 2 S (e j ) X (e j )(e jn ) d
2
Using Schwartz inequality
w(n) 2 S 02 S ( e j ) d X ( e j ) d
2 2
2 2
1
S 02
2 j c S ( z ) S ( z 1 ) d z 1
1
1 z 1dz
2 j D( z ) D( z 1 )
c
1
S02
I
Where I=
Note:
Because of the process of scaling, the overflow is eliminated. Here so is the scaling factor for the first
stage.
1
Scaling factor for the second stage = S01 and it is given by S 012 2
S0 I 2
1 H 1 Z H 1 Z 1 Z 1
2j c D2 Z D2 Z 1
Where I 2
dZ
********************************************************************************************
0.25 0.7 Z 1
For the given transfer function, H Z , find scaling factor so as to avoid overflow in
1 0.5Z 1
the adder ‘1’ of the filter.
Given:
D(Z) = 1-0.5Z-1
D(Z-1) = 1-0.5 Z
Solution:
1 1 dZ
I
2j c DZ D Z
1
Z
1 1 dZ
2j c 1 0.5Z 1 0.5Z Z
1
1 Z 1 dZ
2j c Z 0.5 1 0.5Z Z
Z 1
Residue of 0
Z 0.5 1 0.5Z Z 0.5
I=1.3333
1
S0 =
I
Solution:
Given the range is ±100V
The difference equation of the system is given by y ( n ) 0 .8 y ( n 1) x ( n ) , whose impulse response h(n)
can be obtained as
h ( n ) (0.8) n u ( n )
range of the signal
quantization step size
No. of quantization levels
200
8
2
0.78125
Variance of the error signal
q2
e2
12
(0.78125) 2
12
e 0.05086
2
Variance of output
2 e2 h 2 ( n )
n0
(0.05086) (0.8) 2 n
n0
0.05086
0.14128
1 (0.8) 2
***************************************************************************************
The input to the system y(n)=0.999y(n-1)+x(n) is applied to an ADC. What is the power produced by
the quantization noise at the output of the filter if the input is quantized to a) 8 bits b)16 bits. May-07
Solution:
y(n)=0.999y(n-1)+x(n)
Taking z-transform on both sides
Y(z)=0.999z-1Y(z)+X(z)
Y (z) 1
H (z)
X ( z ) 1 0 .9 9 9 z 1
Where p1,p2,……pN are poles of H(z)H(z-1)z-1, that lies inside the unit circle in z-plane.
0.001
eoi 2 e 2 ( z 0.999)( )
( z 0.999)( z 0.001) z 0.999
e 2 500.25
b) b+1=16 bits
2 2 (1 5 )
2 (5 0 0 .2 5 ) 3 .8 8 2 1 0 8
12
***************************************************************************************
Find the effect of coefficient quantization on pole locations of the given second order IIR system, when
it is realized in direct form I and in cascade form. Assume a word length of 4 bits through truncation.
1
H (z)
1 0.9 z 1 0.2 z 2
Solution:
Direct form I
Let b=4 bits including a sign bit
If we compare the Poles of H(z) and H ( z ) we can observe that the poles of H ( z ) deviate very much from
the original poles.
Cascade form
1
H ( z)
1 0.5z (1 0.4 z 1 )
1
(0.5)10 (0.1000)2
After truncation we get
0.0331
eoi
2
e2 ( z 0.68)*
( z 0.68)( z 1.4706) z 0.68
0.0331
eoi
2
e2 * 0.0419 e2
(0.68 1.4706)
eoi
2
0.0419*1.2716*104
eoi
2
5.328*106
1. Sampling
Sampling is the conversion of a continuous- tome signal into a discrete-time signal obtained by taking
the samples of continuous-time signal at discrete instants.
Thus if xa(t) is the input to the sampler, the output is x a(nT)≡x(n), where T is called the sampling
interval.
2. Quantisation
The process of converting a discrete-time continuous amplitude signal into digital signal is called
quantization.
The value of each signal sample is represented by a value selected from a finite set of possible values.
The difference between the unquantised sample x(n) and the quantized output x q(n) is called the
quantization error or quantization noise.
eq(n)= xq(n)-x(n)
To eliminate the excess bits either discard them by the process of truncation or discard them by rounding
the resulting number by the process of rounding.
The values allowed in the digital signals are called the quantization levels
The distance ∆ between two successive quantization levels is called the quantization step size or
resolution.
The quality of the output of the A/D converter is measured by the signal-to-quantization noise ratio.
3. Coding
In the coding process, each discrete value xq(n) is represented by a b-bit binary sequence.
****************************************************************************
OUTCOMES:
TEXT BOOKS:
1. John G.Proakis and Dimitris G. Manolakis, “Digital signal processing - Principles, algorithms
REFERENCES:
1. Sanjay K.Mithra, “Digital signal processing - A Computer based approach”, Tata McGraw-Hill, 2007.
2. M.H.Hayes, “Digital signal processing”, Schum’s outlines, Tata McGraw Hill, 2007.
4. I.C.Ifeachor and B.W.Jervis, “Digital signal processing – A practical approach”, Pearson 2002
5. L.R. Rabiner and B. Gold, “Theory and application of digital signal processing”, Prentice Hall, 1992.