You are on page 1of 94

Downloaded from www.jayaram.com.

np

DIGITAL SIGNAL PROCESSING


BEG 433 EC
.Year: IV Semester: II
Teaching Schedule Examination Scheme
Hours/Week
Theory Tutorial Practical Internal Assessment Final Total
3 - 3/2 Theory Practical* Theory Practical**
20 25 80 - 125
* Continuous
** Duration: 3 hours
Course objectives: To provide

1. Discrete signals 5
1.1 Discrete signals – unit impulse, unit step, exponential sequences
1.2 Linearity, shift invariance, causality
1.3 Convolution summation and discrete systems, response to discrete inputs
1.4 Stability sum and convergence of power series
1.5 Sampling continuous signals spectral properties of sampled signals

2. The discrete Fourier transforms 5


2.1 The discrete Fourier transform (DFT) derivation
2.2 Properties of the DFT, DFT of non-periodic data
2.3 Introduction of the fast fourier transform (FFT)
2.4 Power spectral density using DFT/FFT algorithms

3. Z transform 8
3.1 Definition of Z transform one sided and two sided transforms
3.2 Region of convergence relationship to causality
3.3 Inverse Z transform – by long division, by partial fraction expansion.
3.4 Z transform properties – delay advance, convolution, Parseval’s theorem
3.5 Z transforn transfer function H (Z) –transient and steady state sinusoidal
response pole zero relationships, stability
3.6 General form of the linear, shift invariant constant coefficient difference
equation
3.7 Z transform of difference equation.

4. Frequency response 4
4.1 Steady state sinusoidal frequency response derived directly from the
difference equation
4.2 Pole zero diagrams and frequency response
4.3 Design of a notch filter from the pole zero diagram.

5. Discrete filters 6
5.1 Discrete filters structures, second order sections ladder filters frequency response
5.2 Digital filters finite precision implementations of discrete filters
5.3 Scaling and noise in digital filters, finite quantized signals quantization error
linear models.
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 1
Downloaded from www.jayaram.com.np

6. HR Filter Design 7
6.1 Classical filter design using polynomial approximations – Butterworth Chebishev
6.2 HR filter design by transformation matched Z transform impulse, invariant transform and
bilinear transformation
6.3 Application of the bilinear transformation to HR low pass discrete filter design
6.4 Spectral transformations, high pass, band pass and notch filters.

7. FIR Filter Design 3


7.1 FIR filter design by fourier approximation the complex fourier series
7.2 Gibbs phenomena in FIR filter design approximations, applications of window
Functions to frequency response smoothing rectangular hanning Hamming and Kaiser
windows.
7.3 FIR filter design by the frequency sampling method
7.4 FIR filter design using the Remez exchange algorithm

8. Digital filter Implementation


8.1 Implementations using special purpose DSP processors, the Texas Instruments TMS320.
8.2 Bit serial arithmetic distributed arithmetic implementations, pipelined implementations

Laboratory:
1. Introduction to digital signals sampling properties, aliasing, simple digital notch filter behaviour
2. Response of a recursive (HR) digital filter comparison to ideal unit sample and frequency
response coefficient quantization effects.
3. Scaling dynamic range and noise behaviour of a recursive digital filter, observation of nonlinear
finite precision effects.

Downloaded from www.jayaram.com.np/ -2


Downloaded from www.jayaram.com.np

Digital Signal processing:-


Application:-
1) Speech recognition.
2) Telecommunication.

Digital Signal processing over analog signal processing:


1) Accuracy.
2) Offline processing.
3) Software control.
4) Cheaper than analog counterpart.

Basic element of D.S.P system:-


A/D Digital D/A
Converter signal Converter
Analog processing
input signal Analog
output signal

Digital Digital
input signal output signal

Fig: Block diagram of DSP

- Most of the signal encountering science and engineering are analog in nature i.e the signals are
function of continuous variable substance in usually take on value in a continuous range.
- To perform the signal processing digitally, there is need for interface between the analog signal and
digital processor. This interface is called analog to digital converter. The o/p of A/D converter is
digital signal i.e appropriate as an i/p to the digital processor.
- Digital signal processor may be a large programmable digital computer or small microprocessor
program to perform the desired operation on i/p signal.
- It may a also be a hardwired digital processor configure to perform a specified set of operation on
the i/p signal.
- Programming machine provide the flexibility to change the signal processing operation through a
change in software whereas hardwired m/c are difficult to reconfigure.
- In application where the distance o/p from digital signal processor is to be given to the user in analog
form, we must provide another interface on the digital domain into analog domain. Such an interface
is called D/A converter.

Advantage of Digital over analog signal processing:-

1. A Digital programmable system allows flexibility in reconfiguring the digital signal processing
operation simply by changing the program. Reconfiguration of analog system usually implies
redesign of hardware followed by testing and verification to see that if operates properly.
2. Digital system provide much better control of accuracy requirements.
3. Digital system are easily stored on magnetic media without loss of signal ………… beyond that
introduce in A/D conversion. As a consequence, the signals become transportable and can be
processed offline in a remote laboratory.
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 3
Downloaded from www.jayaram.com.np

4. Digital signal processing method also allows for the implementation of more sophisticated.
5. In some cases a digital implementation of signal processing system is cheaper than its analog counter
part.

* Signal:
It is defined as any physical quantity which is a function of one or more independent variable and
contains some information.
In electrical sense, the signal can be voltage or current. The voltage or current is a function of time
as an independent variable.
The independent variable in the mathematical representation of a signal may be either continues or
discrete.
Continues time signals are defined analog continues times. Contineous time signals are often
referred to as analog signals.
Discrete time signals are defined as certain time instant.
Digital signals are those for which both time and amplitude discrete.

Discrete- time signals or sequence:-


D.T.S are re………. mathematically as a sequence of numbers. A sequence of numbers x in which
the nth no in the sequence is denoted by x(n) and written as:
x = { x(n)} - infinity < n < infinity

Figure:

• unit sample or unit impulse sequence:


It is denoted by δ(n) and defined as:
0 n≠0
δ ( n) = 
1 n =1

n
-2 -1 1 2

* Unit step sequence:


It is denoted by U(n) and is defined as:

U(n) = 1 , n ≥ 0
= 0, n<0

0 1 2 3

U(n) = δ(n) + δ(n-1) + δ(n-2)+ …………

Downloaded from www.jayaram.com.np/ -4


Downloaded from www.jayaram.com.np


= ∑ δ (n − k )
0

U(n) = ∑ δ (k)
k = −∞
i.e the value of unit step sequence at time n is equal to the accumulated sum of value at index n and all
prvious value of impulse sequence.
Conversely the impulse sequence can be expressed as the first backward difference of unit step
sequences.
i.e. δ(n) = u(n) – u(n-1)

* Unit ramp sequence:-


It is denoted by ur(n) and defined as
ur(n) = n n ≥ 0
=0 n<0
4
3
2
1

* Exponential Sequence:-
The exponential signal is a sequence of the form x(n) = an for all n.
If the parameter ‘a’ is real, then x(n) is real signal. Fig illustrate x(n) for various values of parameter
‘a’.

a>1
0<a<1

a< 1

Fig: Graphical representation of Exponential signals.

0 < a < 1:
Eg a = ½
i.e (1/2)n = 0, ½ , ¼, 1/8 (exponential decreasing)
(see figure (i))
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 5
Downloaded from www.jayaram.com.np

a > 1,
E.g , a = 2
i.e (2)n = 1,2, 4, 8 (Exponential increasing)
(See figure (ii))

-1 < a <0
Eg.: -1/2
i.e (-1/2)n = 1, -1/2, ¼, -1/8
(See fig (iii) )

a <-1
E.g a = -2
(-2)n = 1, -2, 4, -8
(See figure(iv) )

Exponential sequence:-
When the parameter ‘a’ is complex values , it can be expressed as:
a = rejθ
Where r and θ are new parameters. Hence, we can express x(n) as:
X(n) = rn ejθ
= rn (cos θn + jsin θn)
Since, x(n) is now complex values, it can represented graphically by plotting the real part,
xe(n) = rncos θn as a function of n and separately plotting the imaginary part.
xi(n) = rsinθn as a function of n.
Fig. illustrates the graphs fo

Xe(n) and xi (n) .

Downloaded from www.jayaram.com.np/ -6


Downloaded from www.jayaram.com.np

We observe that the signals xe(n) and xi(n) are damaged (decaying exponentially, i.e r <r ) cosine
function and damped sine function.
If r =1 , the damping disappears and xe(n) , xi(n) and x(n) have fixed amplitude which is unity.
Alternatively, the signal x(n) can be represented graphically by the amplitude function.
|x(n)| = A(n) = rn
And phase function
∠x(n) = ø(n) = θn

Representation of discrete-time signal: -

1) Functional representation:-

E.g x(n) = 1 , for n = 1,3


= 4, for n = 2
= 0 elsewhere,

2) Tabular representation:

n ----- 2 -1 0 1 2 3 4
x(n) ----- 0 0 0 1 4 1 0

3) Sequence representation:

X(n) = { ………0 , 0, 1, 4, 1, 0, ……….} Infinite duration .


X(n) = { 0, 1, 4, 1) finite duration (4- point sequence)

4) Graphical representation:-
Figure:

Date: 2066/05/23

Linearity: A system is called liner of superposition principal applies to that system. This means that
the liner system may be defined as one whose response to the sum of weighted inputs is same as the sum
of weighted response.
Let us consider a system. If x1(n) is the input and y1(n) is the output. Similarly y2(n) is the response to
x2(n) . Then for liner system.
a1 x1 (n) + a1 x 2 (n) → a1 y1 (n) + a 2 y 2 (n) ………………..(1)

For any nonlinear system the principle of superposition doesnot hold true and equation (i) is not
satisfied.

Numerical:
For the following system, determine whether the system is liner or not.
(1) y(n) = 2x(n) +3
Solution:
y1(n) = 2x1(n)+3
y2(n) = 2x2(n)+3
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 7
Downloaded from www.jayaram.com.np

Applying superposition principle suppose,


x(n) = a1x1(n)+a2x2(n)
Then,
y3(n) = 2[a1x1(n)+a2x2(n)]+3
= 2a1x1(n)+ 2a2x2(n)+3
y4(n) = a1y1(n)+ a2y2(n)
= a1 [2x1(n)+3]+ a2[2x2(n)+3]
= = 2x1(n)a1 +2a2x2(n)+3a1+3a2
Since,
y 3 (n) ≠ y 4 (n) . The system is nonlinear.

(ii) y(n) = x2(n)


Solution:
y1 (n) = x12 (n)
y 2 (n) = x 22 (n)
Applying input such that,
x(n) = a1x1(n)+a2x2(n)
The response will be,
y3(n) = [a1x1(n)+a2x2(n)]2
and again,
y4(n) = a1y1(n)+a2y2(n)
= a1 x12 (n) + a 2 y 22 (n)
∴ y 3 (n) ≠ y 4 (n) The system is nonlinear.

Shift invariance:-
A system is shift invariant, if the input output relationship doesnot vary with shift. In other words for a
shift invariant system shift in the input signal results in corresponding shift in output. Mathematically,
x ( n) 
→ y (n)
Which means that y(n) is the response for x(n). If x(n) is shifted by n0, then output y(n) will also be
shifted by same shift n0 i.e
x(n − n0 ) 
→ y (n − n0 )
Where n0 is an integer.

If the system doesnot satisfy above expression, then the system is called shift variant system.

The system shifting both linearly and time invariant properties are popularly known as liner time
invariant system or simply LTI systems.

Numerical:
Check whether the system are shift invariant or not.
(i) y (n) = x 2 (n)
Solution:
Let us shift in input by n0, then the output will be,

Downloaded from www.jayaram.com.np/ -8


Downloaded from www.jayaram.com.np

y1 (n) = x 2 (n − n0 )
∴ y1 (n) = y (n − n0 )
Hence the system is shift invariant system.

(ii) y(n) = x(mn)


Let us shift in input by n0 then, response will be,
y1(n) = x(mn – n0)
and the shift in output by n0 will yields.
y (n − n0 ) = x[mn − mn0 ]
∴ The system is shift variant.

Causality:-
A system is causal of the response does not begin before the input function is applied. This means that
of input is applied at n= n0 , then for causal system output will depend on values of input x(n) for n ≤ n0 .
Mathematically,
y (n0 ) = T [ x(n), n ≤ n0 ] ……………..(i)
The response of causal system to an input doesnot depend on future values of that input but depends
only on present or past values of input.
On the other hands, of the response of the system to an input depends on future values of the input,
the system is noncausal. A non causal system doesnot satisfy equation (i).
Causal system are physically realizable whereas non causal system cannot be implemented practically.
There is no system possible practically which can produce its output before input is applied.
The equation,
y (n) = x(n − 1) describes the causal system and
y (n) = x(n) − x(n + 1) describe the non causal system.

Memory less system:-


A system is referred to as memory less if the o/p y(n) at every value of n depends only on the i/p x(n)
at the same value of n.

Date: 2066/05/25
* Response of LTI system to Arbitrary input convolution solution:-
Consider any arbitrary discrete time signal x[n] as shown in fig:

n
-1 0 1 2 3

A discrete time sequence signal be represented by a sequence of individual impulses as shown in figure:

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 9


Downloaded from www.jayaram.com.np

x(0)δ(n) x(1)δ(n-1)

1 2 3
-1
0 0 1
-2 0 -1 1 2

We can write,
X(n) = …………+x(-1)δ(n+1) +x(0) δ(n) +x(1) δ(n-1) +x(2) δ(n-2) + ………..

= ∑ x(k )δ (n − k )
k = −∞
..........(i ) (convolution sum)

Suppose h(n) is the o/p of LTI system when δ(n) is i/p. Therfore, the o/p for i/p x(-1) δ(n+1) is x(-1)
h(n+1). Then the o/p y(n) for the i/p x(n) given in equation (i) will be,

y ( n) = ∑ x(k )h(n − k )
k = −∞
..........(ii )

Symbolically,
y(n) = x(n)* h(n) ………(iii)
y(n) = h(n)*x(n) ……….(iv)

Numericals:
* The impulse response of invalid time response is: h(n) = {1, 2, 1, -1} x(n) = {1,2,3, }
Solution:
The response of the LTI system is ,

y(n) = ∑ x(k )h(n − k )
k = −∞
For n = 0 ,

y(0) = ∑ x(k )h(−k )
k = −∞

Downloaded from www.jayaram.com.np/ -10


Downloaded from www.jayaram.com.np

3 3

2 2 2

k k
3 0 1 2 3

1 1

-2
k
3

-1
1

∑ x(k )h(−k )
k =0

= x(0)h(0) + x(1)h(−1)
= 2+2 = 4
2 2

k
0 1

For n = -1

y(-1) = ∑ x(k )h(−1 − k )
k = −∞
2
1
1 1
n(-1-k) x(k)n(-1-k)

-3 -2 -1 0

-2
For n = -2

Y(-2) = ∑ x(k )h(−2 − k )
k = −∞

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 11


Downloaded from www.jayaram.com.np

Again testing for +ve side:

For n= 1

Y(1) = ∑ x(k )h(1 − k )
k = −∞
= 1+4+3 = 8
2 4

1 1 1 3

x(k)(1-k)
-1
k k
0 1 2 0

-1
For n = 2

Y(n) = ∑ x(k )h(2 − k )
k = −∞
= -1+2+6+1 = 8
3
6
2
1
1
2

0 0
k k
1 2 3 1 2 3
x(k)h(1-k)
-1 -1

For n = 6 = 0
Y(n) = { …….0, 1, 4, 8, 8, 3,-2, -1, 0 …….)

Figure:

* Determine the o/p y(n) of relaxed linear time invariant system with impulse response:
h(n) = an u(n) , |u| < 1
When the i/p is unit step sequence ie;
x(n) = u(n)

Solution:-

y(n) = ∑ x( k ) h( n − k )
k = −∞
For n = 0 ,

y(0) = ∑ x ( k ) h( − k )
k = −∞

Downloaded from www.jayaram.com.np/ -12


Downloaded from www.jayaram.com.np

1 1 1 1 1
a
a2
1

k k
0 1 2 3 0 1 2 3
1
a
a2
h(-k)
a3
k
-3 -2 -1 0

For n =1:


y(1) = ∑ x(k )h(1 − k )
n = −∞
=1+a

1 1
a a
a2 x(k)h(1-k)
h(1-k)
a2
k k
-1 0 1 2 0

For n = 2:

∞ a (1 − r n )
y(2) = ∑ x ( n ) h( 2 − n )
k = −∞
= 1+a+a 2 S=
1− r
For n > 0
1
y(n) = 1+a2 + …….+an
a 1− an
=
a2
x(k)h(2-k)
1− a

k
0 1 2

For n < 0
y(n) = 0
1 − a n +1
y(∞) = lim n → ∞ y(n) = lim n → ∞
1− a
1
=
1− a

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 13


Downloaded from www.jayaram.com.np

y(n)
1
1-a
1+a+a 2
1 1+a

k
0 1 2

* Interconnection of LTI system:-


h1(n) h2(n) y(n)

h1(n)*h2(n) y(n)

When two LTI systems with impulse response h1(n) and h2(n) are in cascade form the overall impulse
response for the cascaded 2 impulse system will be,
h(n) = h1(n) * h2(n) ………(i)

* The parallel combinations of LTI systems and equivalent system is shown below:

h1(n)

x(n) y(n)
h2(n)

h1(n)+h2(n) y(n)

Determine the impulse response for the cascade of two LTI systems having impulse responses.
h1(n) = (1/2)n u(n)
h2(n) = (1/u)n u(n)

Solution:-
The overall impulse response is
h(u) = h1(n)* h2(n)

= ∑ h (k )h (n − k )
k = −∞
1 2

1 1
1/2 h1(k) 1/4 h2(k)
1/4 1/6

k k

Downloaded from www.jayaram.com.np/ -14


Downloaded from www.jayaram.com.np

h2(-k) h(n-k)
1 1
1/4 1/4
n >0
1/6 1/6
k k

∑ (1 / 2) (1 / 4)k n−k
=
k =0
n

∑ (1 / 2) (1 / 4)
−k
= (1/4)n k

k =0

= (1/4) n
∑ (2) k

 2 n +1 − 1 
= (1/4)n  
 2 −1 
= (1/4)n (2n+1-1)
= (1/2)n [ 2 – (1/2)n] , n ≥ 0

Note:- If we have ‘L’ LTI system is cascade with impulse responses h1(n) and h2(n) ……….hL(n) , the
impulse response of equivalent LTI system is
h(n) = h1(n) * h2(n)*h3(n) ……..*hL(n)

Discrete system response to discrete input:-


For a discrete-time system, consider as input sequence x(n) = ejwn, for -∞ <n< ∞ the output of LTI
system with impulse response h(n) is,

y(n) = ∑ h( k ) x ( n − k )
k = −∞

= ∑ h ( k )e
k = −∞
jw ( n − k )


= e jwn ∑ h ( k )e
k = −∞
− jwk

If we define,

H|ejw| = ∑ h( k ) e
k = −∞
− jwk

Then, y(n) = H|ejw| ejwn

H|ejw| describes the change in complex amplitude of complex exponential as a function of frequency w.
H(ejw) is called frequency response of the system.
In general H(ejw) is complex and can be expressed in terms of its real and imaginary parts as:
H (ejw) = HR (ejw)+j HI (ejw)
Or , In terms of magnitude and phase as,

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 15


Downloaded from www.jayaram.com.np

H(ejw) = |H(ejw)|ej∠H(ejw)
Let,
x(n) = Acos(won +ø)
= A/2 ejwon.ejø +A/2 e-jwon. e-jø
The response to x1(n) = A/2 ejø ejwon is,
y1(n) = H(ejw) A/2 ejø ejwon
The response to x2(n) = A/2e-jø e-jwon is ,
y2(n) = H(e-jw) A/2 e-jø. e- jwon
Thus, total response is ,
y(n) = A/2 [H(ejwo)e-jø. ejwon +H(e-jwo)e-jø . e-jwon]
= A |H(e-jwo)| cos(won+ø+θ).
Where, θ = ∠ H(ejwo)

Date: 2066/05/31

Stability: We defined arbitrary relaxed system as BIBO stable. If an only if o/p sequence y(n) is
bounded for every bounded i/p x(n).

If x(n) is bounded their exist a constant Mx such that,


x ( n) ≤ M x < ∞
Similarly if o/p is bounded their exists a constant My such that
y (n) ≤ M y < ∞ for all n,
Now given such a bounded input sequence x(n) to LTI system with convolution formula.

y ( n) = ∑ h( k ) x( n − k )
k = −∞

≤ ∑ h( k ) x( n − k )
k = −∞

≤ ∑ h( k ) x( n − k )
k = −∞

≤ Mx ∑ h( k )
k = −∞
From this expression we observe that the system is bounded if the impulse response of the system
satisfied condition,

Sn = ∑ h( k ) < ∞
k = −∞
That is linear time invariant system is stable if its impulse response is absolutely summable.

# Determine the range of value of the parameter a for LTI system with impulse response.
h(n) = an u(n) is stable.
Solution,

Downloaded from www.jayaram.com.np/ -16


Downloaded from www.jayaram.com.np


Sn = ∑ h( k ) < ∞
k = −∞
∞ ∞
= ∑ h( k ) = ∑ a k
k =0 k =0

= 1 + a + a + a 3 + .............
2

1
= Provided that a < 1
a− a
Therefore the sytem is stable if a < 1 otherwise it is unstable.

# Determien range of value of a,b for which LTI system with impulse response.
h ( n) = a n n ≥ 0
= bn n < 0 is stable.
∞ −1 ∞
Sn = ∑ h( k ) = ∑ b
k = −∞ k = −∞
k + ∑ ak
k =0

The first sum coverage for a < 1 . The second sum can be manipulated as,
−1 ∞
1
∑b =∑
k
k
k = −∞ k =1 b
1 1 1
= + 2 + 3 + ..............
b b b
1 
= 1 + 1 + 1 + .......... 
b b
2
b
3 
 
= 1 + β + β + β + ...........
2 3

= β (1 / 1 − β ) Provided that , β < 1 or b >1

Hence the system is stable is both a < 1 or b >1

Date: 2066/07/23

# Determine whether the given system is BIBO stable or not.


y (n) = 1/3 [ x(n) +x(n-1) +x (n-2)]

Solution:-
Assume that, BIBO =
|x(n)| < Mn < ∞ for all n. Bounded input
bounded output.
Then | y(n)| = 1/3 [ x(n) +x(n-1) +x (n-2)]
≤ 1/3 [ |x(n)| +|x(n-1)| +|x (n-2)|]
≤ 1/3 [ Mx + Mx + Mx ]
≤ Mx

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 17


Downloaded from www.jayaram.com.np

Since, Mx is finite value , |y(n)| also finite. Hence the system is BIBO stable.

# # Determine whether the given system is BIBO stable or not.


Y(n) = rnx(n) where r>1.

Solution:
Assume
y ( n) = r n x ( n )
= r n x(n)
With r >1, the multiplying factor rn diverges for increasing n and he=nce o/p not bounded. Hence the
system is BIBO unstable.

Nyquist Sampling theorem:-


A signal whose spectrum is band limited to B Hz (G(w) = 0 for |w| > 2πB ) can be reconstructed
exactly form its samples taken uniformly at the rate R > 2BHz (sample/sec) . In other words, minimum
sampling frequency fs = 2Bhz.
Consider a signal g(t) whose spectrum is band limited to Bhz. Sampling g(t) at the rate of fs hz can be
accomplished by multiplying g(t) by impulse δTs (t) consisting of unit impulses repeating periodically
every Ts second. Where, Ts = 1/fs

Figure;

Trigonometric fourier series of impulse train,


δ Ts (t ) = [1 + cos ws t + 2 cos 2 ws t + 2 cos 3ws t + .............]
1
Ts Where, Ws = 2π/Ts
g (t ) = g (t ) δ Ts (t )

=
1
[g (t ) + 2 g (t ) cos ws t + 2 g (t ) cos 2ws t + 2 g (t ) cos 3ws t + ......]
Ts

Using modulation property,

2g(t) coswst ↔ (F.T) G(w-ws)+G(w+ws)

G ( w) =
1
[G (w) + G( w − ws ) + G (w + ws ) + .......]
Ts

1
=
Ts
∑ G (w − nw )
n = −∞
s

If we want to reconstruct g(t) from g(t) bar we should be able to recovered G(w) form G (w) . This is
possible if there is no overlap between successive cycle of G (w) . Figure (e) shows that this requires fs
greater then 2B.

Downloaded from www.jayaram.com.np/ -18


Downloaded from www.jayaram.com.np

From figure we see that g(t) can be recovered form sample g (t ) by passing sampled signal through
ideal low pass filter with bandwidth B hz.

Date:2066/7/26
Sampling of analog signals:

There are many ways to sample analog signal. We limit our discussion to periodic or uniform sampling
which is he types of sampling used most often in topic in practice . This is described by the relation.
X(n) = xa(nT), - ∞ < n < ∞

Where x(n) is discrete-time signal obtained by talking samples of analog signal xn(t) every T second.
T = sampling period or sample interval.
Fs = 1/T = damping frequency or sampling rate (sample/sec or Hz)
t = nT = n/Fs

In general the smapling of continuous time sinusoidal signal


x a (t ) = A cos(2πf 0 t + θ )
1
With sampling rate f s = results discrete time signal.
T
x(n) = A cos(2πft + θ )
f
Where, f = 0 = Relative frequency of sinusoid.
fs

Q. Consider the analog signal xa(t) = 3cos100πt


a) Determine the minimum sapling rate require to avoid aliasing.
b) Suppose that the signal is sampled at the rate Fs= 200 hz What is the discrete time signal obtained
after sampling.
c) Suppose that the signal is sample at the rate Fs= 75 hz what is the discrete time signal obtained after
sampling.
d) What is the frequency 0< f< Fs/2 of a sinusoids that yields samples identical to those obtained in part
c.

Solution:-
Xk(t) = 3cos100 πt
2 πf0 = 100 π
F0 = 50 hz
b) Mininum sampling rate = 100 hz
c) Fs= 200 hz
d) Fs = 75 hz
X(n) = 3cos(100 π n/fs) = 3cos(100 π n/75) = 3cos(4 πn3)
= 3cos2 π(2/3)n
=3cos2 π(1 -1/3)n
= 3cos2 π(1/3)n
e) Fs = 75 hz , f= 1/3
f = F0/Fs , F0 = f Fs = 25 hz
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 19
Downloaded from www.jayaram.com.np

y(t) = 3cos50 πt

Q. Consider the analog signal at xa(t) = 3cos50 πt + 10sin300 πt-cos100 πt. What is the Nequest rate
for this signal.
Solution: -
Frequency present in the signal,
F1 = 25hz, F2 = 150 hz , F3 = 50 hz
Fmax = 150 hz
Nyquest rate = 2Fmax = 300 hz.

Q. Consider the analog signal at xa(t) = 3cos 2000πt+5sin6000 πt+10cos2000 πt.


a) What is the Nyquest rate for the signal.
b) Assume now that we sample the signal using sampling rate Fs = 5000 samples per second. What is
the discrete time signal obtained after sapling.
Solution:
a) F1 = 1khz F2 = 3khz F3 = 6khz
Nyquest rate = 12 khz
b) Fs = 5000 hz = 5khz
x(n) = 3cos(2000 π n/Fs) + 5sin(6000 π n/Fs)+10cos(12000 π n/Fs)
= 3cos(2 πn/5) +5sin(6 πn/5) + 10cos(12 πn/5)
= 3cos(2 πn/5)+ 5sin2 π(3/5)n+10cos2 π(6/5)n
=3cos(2 πn/5)+ 5sin2 π(1−2/5)n+10cos2 π(1+1/5)n
=3cos(2 πn/5)- 5sin2 π(2/5)n+10cos2 π(1/5)n
=13cos(2πn/5)-5sin2π(2/5)n

Date: 2066/07/26

Chapter:- 2
Discrete Fourier transform:-

Frequency domain sampling: Discrete Fourier transform. (DFT)


Let us consider aperiodic discrete-time signal x(n) with Fourier transform

X ( w) = ∑ x ( n )e
n = −∞
− jwn
……….(i)

Suppose that we sample X(w) periodically in frequency at a spacing of δ(w) radian between the
successive samples. Since X(w) is periodic with period 2π only samples in the fundamental frequency
range are necessary. We take N equidistant sample in the interval 0 <= w <=2π . With sample spacing
δw = 2π/N

0 kω 2π
ω
δω
Fig: Freq. domain sampling.

Downloaded from www.jayaram.com.np/ -20


Downloaded from www.jayaram.com.np

If we evaluate, equation (i) we get,


W = 2π/N. K, k = 0 to N-1
 2πk  ∞
 = ∑ x ( n) e
− j 2πkn / N
X
 N  n = −∞
Summing in equation (2) can be subdivided into infinite number of summations where each sum
contains N terms Thus,

 2πk  N −1 2 N −1 3 N −1
 = ...... + ∑ x(n)e + ∑ x(n)e − j 2πkn / N + ∑ x(n)e − j 2πkn / N + .......
− j 2πkn / N
X
 N  n=0 n= N n=2 N

∞ lN + N −1
= ∑ ∑ x ( n) e
l = −∞ n = ln
− j 2πkn / N

If we change the index in the inner summation form n to n-ln and integrating the order of summation we
obtained,
 2πk  N −1  N −1  − j 2πkn / N
X  = ∑ ∑ x(n − nl ) e ………..(3)
 N  n =0  n =0 
The signal

Xp(n) = ∑ x(n − nl ) ……..(4)
l = −∞
Obtained by period representation of x(n) every N samples is clearly period with fundamental period N.

Since xp(n) is period extension of x(n) given by equation (4) it is clear that x(n) can be recovered
from xp(n) if there is no alising in the time domain that is x(n) is limited to less than the period N of
xp(n)

x(n)
1

n
L

xp(n)

N >L

n
L N

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 21


Downloaded from www.jayaram.com.np

xp(n)

N <L

n
L −1
In summary a final duration sequence x(n) of a length L as fourier transform X ( w) = ∑ x(n)e − jwn
n=0
for 0 <= w <= 2π …………….(5)
When we sample X(w) at equal space frequency wk = 2πK/N , k = 0,1, 2 ……N-1
Where, N ≥ L,
The resultant sample are,
 2πK  N −1
 = ∑ x ( n )e
− j 2πkn / N
X (k ) = X  …………. (6)
 N  n =0
Where, k = 0, 1, ………N-1

The relation in equation (6) is a formula for transforming sequence x(n) of length L <= N into a
sequence of frequency samples {X(k)} of length L. Since the frequency samples are obtained by
evaluating the fourier transform X(w) at a set of N equally spaced discrete frequencies. The relation in
equation (6) is called discrete fourier transform (DFT) of x(n).

Date:- 2066/7/27

xp(n) can be written as,


N −1
xp(n)= ∑a e
k =0
k
j 2πkn / N
n = 0, 1, ………N-1 ….(7)

With Fourier coefficient,


N −1
ak = 1/N ∑x
k =0
p (n)e − j 2πkn / N k = 0, 1, ……..N-1 ……….(8)

Form equation (3) and (8)


 2πk 
ak = 1/N   k = 0, 1, …..N-1 …….(9)
 
Therefore ,
N −1
 2πk  j 2πkn / N
xp(n) = 1/N ∑ X  e n = 0, 1, ……..N-1 …….(10)
k =0  N 
This relation allows us to recover the sequence x(n) from frequency sample.
N −1
x(n) = 1/N ∑ X ( k )e
k =0
j 2πkn / N
n = 0, 1 …….N-1 …….(11)

This is called inverse DFT (IDFT) (

DFT as linear transformation:-

Downloaded from www.jayaram.com.np/ -22


Downloaded from www.jayaram.com.np

The formula for DFT and IDFT is given by

X (k ) = ∑ x(n) wNkn , k = 0, 1 …….N-1 ……..(1)


N −1
1
x ( n) =
N
∑ X (k ) w
k =0
− kn
N n = 0, 1, …….N-1 ……..(2)

Where WN = e-j2π/N ……….(3)


Let us define N-point vector xN of signal sequence x(n) , n = 0, 1, ……N-1 and N-point vector Xn of
frequency samples and N*n matrix WN as

1 1 1 1 
 x ( 0)   X ( 0)  1 W 1 2 N −1 
xN=  x(1)  =  X (1)  WN =  N WN WN 
XN
 . W N2 W N4 W N2( N −1) 
 x(n − 1)  X ( N − 1)  N −1 
1 W N W N2( N −1) W N( N −1)( N −1) 

With there definition N-point DFT may be expressed in matrix


XN = WN xN ……..(4)
Where, WN = matrix of liner transformation.
Equation (4) can be inverted by per multiplying both side by WN-1. Thus we can obtained xN = wN-1XN
…..(5)
Which is expression for IDFT
xN = 1/N WNx XN ……..(6)
Where, WN* = complex conjugate of matrix WN
WN-1 = WN*/N ……..(7)

Q. Compute DFT of 4-point sequence x(n) = { 0, 1, 2, 3}


Solution:-
N −1
X (k ) = ∑ x(n)e − j 2πkn / N
n=0

3
X (k ) = ∑ x(n)e − jπkn / 2
n=0
3
X (0) = ∑ x(n)e 0 = x(0) + x(1) + x(2) + x(3) = 6
n =0
3
X (1) = ∑ x(n)e − jπn / 2 = x(0) + x(1)e − jπ / 2 + x(2)e − jπ + x(3)e − j 3π / 2 = 6
n=0
X(2) = -2
X(3) = -2.4

By matrix method,

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 23


Downloaded from www.jayaram.com.np

1 1 1 1 
1 − j − 1 j 
W4 =  
1 − 1 1 − 1 
 
1 j − 1 − j 

0   X ( 0) 
1   X (1) 
xN =   X4 =  
2  X ( 2) 
   
3   X (3) 

X4 =W4 * x4
1 1 1 1  0 
1 − j − 1 j  1 
=  *  
1 − 1 1 − 1  2
   
1 j − 1 − j  3 
0 + 1 + 2 + 3  6 
0 − j − 2 + 3 j   − 2 + 2 j 
 = 
= 0 − 1 + 2 − 3   − 2 
   
0 + j − 2 − 3 j   − 2 − 2 j 

Q. Compute IDFT for the frequency component X(k) = { 60, 0, -4, 0}

Solution:-
xN =( WN*/N ) XN x4 =( W4*/4) X4
60  1 1 1 1 
0  1 − j − 1 j 
X4 =   W4 =  
− 4 1 − 1 1 − 1 
   
0  1 j − 1 − j 

x4 =( W4*/4) X4
1 1 1 1  60 
1 − j −1 j  0 
=¼ 
1 − 1 1 − 1  − 4
  
1 j − 1 − j  0 

Downloaded from www.jayaram.com.np/ -24


Downloaded from www.jayaram.com.np

60 − 4  56  14


60 + 4 64 16
=¼   = ¼   = 
60 − 4  56  14
     
60 + 4 64 16

Properties of DFT:-
The notation used to denote N-point DFT pair x(n) and X(k) as x(n)  DFT X(k)
1) Periodicity:
If x(n)  DFT X(k)
Where, x(n+N) = x(n) for all n.
X(k+N) = X(k) for all k.

Proof:

x(n+N) = 1/N ∑ X (k )e j 2πk ( n + N ) / N


N −1
= 1/N ∑ X (k )e j 2πkn / N e j 2πk
K =0
= x(n)

N −1
X(k+N) = ∑ n( k ) e
n =0
j 2πk ( k + N ) / N

N −1
= ∑ X ( k )e
n =0
j 2πkn / N
e j 2πn

=X(k)

2) Linearity: -
If x1(n)  DFT X1(k) and
x2(n)  DFT X2(k) Then, for any real or complex valued constants a1 and a2
x(n) = a1x1(n) +a2x2(n)  DFT X(k) = a1X1(k)+a2X2(k)
Proof:-
N −1
a1x1(n) +a2x2(n)  DFT ∑ a x ( n) + a
n =0
1 1 2 x 2 (n) e − j 2πkn / N
N −1 N −1
= a1 ∑ x1 (n)e − j 2πkn / N + a 2 ∑ x 2 (n) e − j 2πkn / N
n=0 n=0
= a1X1(k) +a2X2(k)

Date:2066/08/01

Circular Symmetries of sequence:

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 25


Downloaded from www.jayaram.com.np

N-point DFT of finite duration sequence x(n) of length L ≤ N is equivalent to N-point DFT of
periodic sequence x p (n) of period N which is obtained by periodically extending x(n) i.e

x p ( n) = ∑ x(n − lN )
l = −∞

x p ( n) = x( n − k ) = ∑ x(n − k − lN )
l = −∞
Finite duration sequence,
x(n) = xp(n) 0<= n<=N-1
= 0 otherwise

Is related to original sequence by x(n) by circular shift. This relationship is shown graphically as
follows.

This relationship is shown in figure


x(n)

n
0 1 2 3

n
-4 -3 -2 -1 0 1 2 3 4 5 6 7

xp(n-2)

n
-6 -5 -4 -3 -2 -1 2 3 4 5
4
x’(n)
2
1
3

n
0 1 2 3

Downloaded from www.jayaram.com.np/ -26


Downloaded from www.jayaram.com.np

x(1)=2 x’(1)=4

x(2)=3 x(n) x(0)=0 x’(2)=1 x(n) x’(0)=3

x(3)=4 x’(3)=2

In general the circular shift of the sequence is represented as index modulo N. i.e x(n) = x((n-k))N
For example,
K = 2, N = 4
That implies,
x’(0) = x((-2))4
x’(1) = x((-1))4
x’(2) = x((0))4
x’(3) = x((1))4
Hence x’(n) is shifted circularly by 2 units in time. where the counter clock wise direction is selected as
the +ve direction. Thus we conclude that circular shift of N- point sequence is equivalent to linear shift
of its period extension and vise versa.

Symmetry properties of DFT:-


Let us assume that N-point sequence x(n) and its DFT are both complex valued. Then the sequence can
be respresented as
x(n) = xR(n)+jxI(n) 0 <= n<=N-1 ………..(1)
X’(k) = XR(k)+jXI(k) 0<=k<=N-1 …… …..(2)
N −1
X(k) = = ∑ x(n)e − j 2πn / N k = 0, 1, ………N-1
n =0
N −1
= ∑ ( x R (n) + jx I (n) )(cos 2πkn / N − j sin 2πkn / N )
n =0
N −1 N −1
= ∑ ( x R (n) cos 2πkn / N + x I (n) sin 2πkn / N ) − j ∑ ( x R (n) sin 2πkn / N − x I (n) cos 2πkn / N )
n =0 n=0
= XR(k)+jXI(k)

N −1
XR(k) = = ∑ ( x R (n) cos 2πkn / N + x I (n) sin 2πkn / N ) ……..(3)
n =0
N −1
XI(k) = ∑ ( x R (n) sin 2πkn / N − x I (n) cos 2πkn / N ) ………(4)
n =0

Similary,

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 27


Downloaded from www.jayaram.com.np

N −1
xR(n) = 1/N ∑(X
k =0
R (k ) cos 2πkn / N − X I (k ) sin 2πkn / N ) ………(5)
N −1
xI(n) = 1/N ∑ ( X R (k ) sin 2πkn / N + X I (k ) cos 2πkn / N ) ……….(6)
k =0

1) Real valued signal:-

If x(n) is real,
X(N-k) = X*(k) = X(-k)
Proof:-
N −1
X(N-k) = ∑ x ( n )e
n =0
− j 2π ( N − k ) n / N

N −1
= ∑ x(n)e − j 2πn / N e − j 2πn
n =0
=X(-k) = X*(k)

2) Real and even sequence:-


x(n) = x(N-n)
Than, XI(0) = , DFT reduces to
N −1
X(k) = ∑ x(n) cos 2πkn / N
n =0
0<= k<=N-1

IDFT Reduces to ,
N −1
x(n) = 1/N ∑ X (k ) cos 2πkn / N
k =0
0<=n<=N-1

3) Real and odd sequence:-


If x(n) = x(N-n) 0<=n<=N-1
Than, XR(k) = 0, DFT reduces to ,
N −1
X(k) = -j ∑ x(n) sin 2πkn / N , 0 <=k<= N-1
n =0
IDFT reduces to,
N −1
x(n) = j 1/N ∑ X (k ) sin 2πkn / N
k =0
0 <= n<= N-1

4) Purely Imaginary sequence:-


x(n) = jxI(n)
N −1
XR(k) = ∑x
n =0
I (n) sin 2πkn / N
N −1
XI(k) = ∑x
n =0
I (n) cos 2πkn / N

If xI(n) is odd, then XI(k) = 0 and hence X(k) is purely real.


If xI(n) is even then, XR(k) = 0 and hence X(k) is purely imaginary.

Downloaded from www.jayaram.com.np/ -28


Downloaded from www.jayaram.com.np

Multiplication of two DFTs and circular convolution:-


Support we have two finite duriaotn sequences of length N, x1(n), x2(n). Their respective DFTs are,
N −1
X1(k) = ∑ x ( n )e
n =0
1
− j 2πkn / N
k = 0, 1, ……N-1 ……..(1)
N −1
X2(k) = ∑x
n =0
2 (n)e − j 2πkn / N k = 0, 1, …….N-1 …….(2)

If we multiply two DFTs together the result in DFT say X3(k) of a sequence x3(n) of length N. Let us
determine the relationship between x3(n) and the sequence x1(n) and x2(n) .
We have X3(k) = X1(k)X2(k)
N −1
x3(n) = 1/N ∑X
k =0
3 (k )e j 2πkn / m
N −1
x3(n) = 1/N ∑X
k =0
1 (k ) X 2 (k )e j 2πkn / m
N −1 N −1 N −1
 − j 2πkn / n   − j 2πkl / N  − j 2πkn / N

= 1/N ∑ 1
k =0  n=0
x ( n ) e  ∑ x 2 (l )e
  l =0
e

N −1 N −1 N −1
 
= 1/N ∑ x1 (n)∑ x 2 (l ) ∑ e − j 2πk ( m − n −l ) / N 
n =0 l =0  k =0 
Now,
N −1

∑a
k =0
k
=N a =1

1− aN
= , a ≠1
a−a

Where, a = ej2π(m-n-l)/N
N −1

∑a
k =0
k
=N − l = m − n + pN = ((m − n)) N p is int eger

= 0 , otherwise
Hence,
N −1
x3(m) = 1/N ∑ x ( n) x
n =0
1 2 ((m − n)) N .N m = 0, 1, …..N-1
N −1
x3(m) = ∑ x ( n) x
n =0
1 2 ((m − n)) N

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 29


Downloaded from www.jayaram.com.np

The expression has the form of convolution sum. The convolution sum involves index ((m-n))N is called
circular convolution. Thus we conclude that multiplication of DFT of two sequences is equivalent to the
circular convolution of two sequences in time domain.

Q. perform the circular convolution of the following two sequences.


x1(n) = {2, 1, 2, 1}
x2(n) = { 1, 2, 3, 4}

Solution,
N −1
x3(m) = ∑ x ( n) x
n =0
1 2 ((m − n)) N

N = 4,
3
x3(m) = ∑ x ( n) x
n =0
1 2 ((m − n)) 4
3
x3(0) = ∑ x ( n) x
n =0
1 2 ((−n)) 4 = 14
x1(1)=1 x2(1)=2

x1(2)=2 x1(n) x1(0)=2 x2(n) x2(0)=1

x1(3)=1 x2(3)=4

4
4
x1(n)x2((-n))4=14

6 2
3 x2(-n) 1

2
2
3
x3(1) = ∑ x ( n) x
n =0
1 2 ((1 − n)) 4 = 16
1
1
x1(n)x2((1-n))4=16

8 4
4 x2((1-n))4 2

3
3
3
x3(2) = ∑ x ( n) x
n =0
1 2 ((2 − n)) 4 = 14

Downloaded from www.jayaram.com.np/ -30


Downloaded from www.jayaram.com.np

2
2
x1(n)x2((2-n)) 4=14

2 6
1 x2((2-n))4 3

4
4
3
x3(3) = ∑ x ( n) x
n =0
1 2 ((3 − n)) 4 = 16
3
3
x1(n)x2((3-n)) 4=16

4 8
2 x2((3-n))4 4

1
1

x3(n) = { 14, 16, 14, 16}

Solution by DFT and IDFT method:

1 1 1 1   2  6 
1 −j −1 j  1  0 
X1 =  * =
1 −1 1 − 1  2 2
     
1 j −1 − j  1  0 
1 1 1 1  1  10 
1 −j −1 j  2 − 2 − 2 j 
   
X2 =  =
1 −1 1 − 1  3  − 2 
    
1 j −1 − j  4 − 2 − 2 j 
60 
0 
X3 =  
− 4
 
0 

IDFT:
x3 = (W4*/4 )* X3

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 31


Downloaded from www.jayaram.com.np

1 1 1 1  60 
1 − j − 1 j  0 
=¼   
1 − 1 1 − 1  − 4
  
1 j − 1 − j  0 

Parseval’s theorem:-
For complex valued sequence x(n) and y(n)
x(n)  DFT  X(k)
y(n)  DFT  Y(k)
Then,
N −1
1 N −1

n =0
x ( n ) y * ( n ) = ∑ X (k )Y * (k )
N k =0
Proof:-

N −1

∑ x(n) y * (n) = r
n =0
xy
(0) Circular cross correlation sequence.

N −1
1
r xy (l ) =
N
∑R
k =0
xy (k )e j 2πkl / N

N −1
1
r xy (l ) =
N
∑ X (k )Y * (k )e
k =0
j 2 πkl / N

1 N −1
r xy (0) = ∑ X (k )Y * (k )
N k =0
In Special case, y(n) = x(n)
N −1 N −1
1 N −1
∑ x ( n ) y * ( n ) = ∑ x ( n) = ∑ X ( k )
22

n =0 n =0 N n =0
Which expresses the energy is finite duration sequence x(n) in term of frequency component {X(k)}

Date: 2066/08/04
Fast Fourier Transform (FFT):-
N −1
X (k ) = ∑ x(n)e j 2πk / N
n=0
The complex multiplication in direct computation of DFT is N2 and by FFT complex multiplication in
N/2 log2N. When number of points is equal to 4, the complex multiplication in direction computation of
DFT is 16 and for FFT its value is 4. Hence the increment factor is 4.

Downloaded from www.jayaram.com.np/ -32


Downloaded from www.jayaram.com.np

Radix-2 FFT algorithm:-


N −1
If x(n) be the discrete time sequence then its DFT is given by X (k ) = ∑ x(n) w Nkn k = 0, 1,….N-1
n =0
Divide N-point data sequence into two N/2 data sequence f1(n) and f2(n) corresponding to the even
number and odd number samples of x(n) respectively.
f1(n) = x(2n)
f2(n) = x(2n+1) n = 0, 1, ……N/2-1

Thus f1(n) and f1(n) are obtained by decimating x(n) by a factor of 2 and hence the resulting FFT
algorithm is called decimation in time algorithm.

N −1 N −1
X (k ) = ∑ x(n) wNkn +
n even
∑ x ( n) w
n odd
kn
N

N / 2 −1 N / 2 −1
X (k ) = ∑ x(2m) wNk −2n +
m=0
∑ x(2m + 1)w
m=0
k ( 2 m +1)
N

But
(
W N2 = e − j 2π n / 2 )2
= e − j 2π /( n / 2) = W N / 2
N / 2 −1 N / 2 −1
X (k ) = ∑
m=0
f 1 (m) w Nkm/ 2 + W Nk ∑f
m =0
2 (m) wNkm/ 2
k
X(k) = F1(k) + W F2 (k ) n
Where F1(k) and F2(k) are N/2 point DFT of sequences f1(m) and f2(m) respectively.

F 1(0)
x(0) X(0)
F 1(1)
x(2) X(1)
N/2 point F1(2)
x(4) DFT X(2)
F1(3)
x(6) X(3)

F1(0)
x(1) X(4)
F1(1)
x(3) N/2 point X(5)
DFT F 1(2)
x(5) X(6)
F 1(3)
x(7) X(7)

Having performed that DIT once, we can repeat the processor for each of sequence f1(n) and f2(n) .
Thus f1(n) would result in two N/4 point sequence.
v11(n) = f1(2n)
v12(n) = f1(2n+1) , n = 0, 1,……N/4-1
And f2(n) would result.
v21(n) = f2(2n)
v22(n) = f2(2n+1) , n = 0, 1, …….N/4 -1
Then

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 33


Downloaded from www.jayaram.com.np

F1(k) = v11(k)+ wNk / 2 v12 (k )

x(0) X(0)
W N0 W N0 W N0
x(1) X(1)
W N4 W N2 W N1
X(2)
W N0 W N4 W N2
x(3) X(3)
W N4 W N6 W N3
x(4) X(4)
W N0 W N0 W N4
x(5) X(5)
W N4 W N2 W N5
x(6) X(6)
W N0 W N4 W N6
x(7) X(7)
W N4 W N6 W N7
Fig: 8-point DIT FFT algorithm

Xm+1(p) X m(p) Xm+1(p)


X m(p)

Xm(q) Xm+1(q) Xm(q) Xm+1(q)


W Nr+N/2 W Nr -1
Fig: Basic butterfly computation in DIT FFT
algorithm.
Xm+1(p) = Xm(p)+WNr Xm(q)
Xm+1(q) = Xm(p)+WNr+N/2 Xm(q)
= Xm(p) - WNr Xm(q) [WNN/2 = -1]

# Compute 8 point DFT for the sequence x(n) = { 1,2, 3, 4,5 ,6 } . Using DITFFT algorithm or DIF
FFT algorithm.
x(0) X(0)

x(1) X(1)
W N0
x(2) X(2)
W N0
x(3) X(3)
W N2 W N0
x(4) X(4)
-1 W N0
x(5) X(5)
-1 W N1 W N0
x(6) X(6)
-1 W N2 W N0
x(7 ) X(7)
-1 W N3 W N0

Downloaded from www.jayaram.com.np/ -34


Downloaded from www.jayaram.com.np

Date:2066/08/11

Q. Compute 4-point DFT for the sequence x(n) = { 14, 16,14, 16} using FFT algorithm.

28 28
x(0)=14 X(0)=60

0 0
x(2)=14 X(1)=0
W N0=1
32
x(1)=16 X(2)=-4

6 X(3)=0
x(3)=16
W N0 =1 W N1

Q. Compute 4 point DFT for the sequence x(n) = { 14, 16, 14, 16 } using FFT algorithm.
28
x(0) X(0)=60
32
x(2) X(1)=0
WN0
x(1) X(2)=-4
-1 W40 =1

x(3) X(3)=0
-1 W41 WN0

Date: 2066/08/11

Chapter: - 3

Z-transform:-
The z-transform of a discrete-time signal x(n) is defined as the power series.

X ( z) = ∑ x ( n) z
n = −∞
−n
………..(1)

When z is complex variable.

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 35


Downloaded from www.jayaram.com.np

The inverse procedure( i.e obtaining x(n) from X(z) ) is called inverse z-transform . z-tranasform of a
singal x(n) is denoted by
X(z) = Z{x(n)} …….(2)
Where as the relationship between x(n) and X(z) is indicated by
x(n)  z  X(z) ……..(3)

ROC (Region of convergence):


ROC of X(z) is the set of all values of z for which X(z) attins a finite values.

# Determine z-transform of following finite duration signals.


x1 (n) = { 1,2, 5, 7, 0, 1}

X ( z) = ∑ x ( n) z
n = −∞
−n

= 1+2z-1+5z-2+7z-3+z-5
ROC: entire z-plane except z = 0 .

(2) x2(n) = {2,4, 5, 7, 0, 1}



X2(z) = X ( z ) = ∑x
n = −∞
2 (n) z − n = 2 z + 4 z 2 + 5 + 7 z −1 + z −3

ROC: Entire z-plane. Except z = 0 and z = ∞

(3) x3(n) = δ(n)



X3(n) = ∑ x ( n) z
n = −∞
3
−n

[
= δ (n) z − n n = 0 ]
=1
ROC: Entire z-plane.

(4) x4(n) = δ(n-u) k > 0



X ( z) = ∑x 4 ( n) z − n = 2 z + 4 z
X4(z) = n = −∞

[δ (n − k ) z ]
−k
−n z
n=k
ROC: Entire z-plane except z = 0

(5) x5(n) = δ(n+k) k>0



X5(n) = X ( z ) = ∑ x ( n) z
n = −∞
5
−n

[
= δ (n − k ) z −n
]
n=k
−k
= z
ROC: Entire z plane except z = 0.

ROC relationship to casusality:-

Downloaded from www.jayaram.com.np/ -36


Downloaded from www.jayaram.com.np

Let us express complex z-variable in polar form as.


z = rejθ ……..(1)
Where r = |z| θ = angle z . Then X(z) can be expressed as,

X(z)|z= rejθ = X ( z ) = ∑ x( n) r
n = −∞
−n
e − jθn ……………….(2)

In the ROC of X(z) . X (z ) < ∞


But,

X ( z) = ∑ x ( n) r
n = −∞
−n
e − jθn

≤ ∑ x ( n)r
n = −∞
−n
……………..(3)

Hence X (z ) is finite of the sequence x(n)r − n is absolutely summable.

The problem of finding ROC for x(z) is equivalent to determining the range of values of r for which the
sequence x(n) r-n is absolutely sum able.
−1 ∞
X ( z) ≤ ∑
n = −∞
x ( n)r − n + ∑ x ( n) r − n
n=0
∞ ∞
x( n)
X ( z ) ≤ ∑ x( −n) r n + ∑ …………….(4)
n =1 n =0 rn

If x(z) converges in some region of complex plain both summation in equation (4) must be finite in that
region.
If the first sum in equation (4) converges their must exists values of r small enough such that the
product sequence x(-n) rn , 1 <= n < ∞ is absolutely summable. Therefore ROC for the first sum
consists of all points in a circle of some radius r1 where r1 < ∞ as illustrated in the figure.
Im(z)

z-plane

Re(z)

Date: 2066/08/15

Now if the 2nd term in equation (4) converges there must exists values of r large enough such that
x ( n)
product sequence n , …….. hence ROC for second sum in equation (4) consists of all points outside a
r
circle of radius r >r2 as shown in fig.

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 37


Downloaded from www.jayaram.com.np

Im(z)

r
Re(z)

Since the convergence of X(z) requires that both sums in equation (4) be finite it follows that ROC of
X(z) is generally specified as the annual region in the z plane r2 <r<r1 which is common region where
both sums are finite. Which is shown in figure.
Im (z)

r2 r1
Re(z)

If r2 >r1 there is no common region of convergence for the two sums and hence X(z) does not exist.
Im(z)

r2 r1
Re(z)

Numerical:

# Determine z-transform of the signal.


X(n) = αn u(n) = αn , n => 0
=0 , n<0

Solution:

Downloaded from www.jayaram.com.np/ -38


Downloaded from www.jayaram.com.np


X(z) = ∑ x( n) z
n = −∞
−n


= ∑α
n = −∞
n
z −n

= ∑ (αz
n = −∞
−1 − n
) = 1 + (αz −1 ) + (αz −1 ) 2 + ......

1
= for αz −1 < 1
1 − αz −1

ROC: |z| > |α |


Im(z)

x(n)

r
|α|

Re(z)

# Determine z-transform of the signal.


X(n) = - αn u(-n-1) = -αn , n <= -1
=0 , n>0
Solution:-

X(z) = ∑ x( n) z
n = −∞
−n

∑ (− α )z
−1
n −n
=
n = −∞

( )

= − ∑ α −l z l
l =1

( ) [ ]

= − ∑ α −l z = − (α −1 z ) + (α −1 z ) 2 + .........
l

l =1

 α −1 z 
= -   for α −1 z < 1
−1 
1− α z 
1
= ROC : z < | α |
1 − α −1 z

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 39


Downloaded from www.jayaram.com.np

x(n) Im(z)

z-plane
-3 -2 -1 |r|

Re(z)

# Determine z-transform of the signal.


X(n) = αn u(n)+ bn u(-n-1)
Solution:


X(z) = ∑ x( n) z
n = −∞
−n

−1 ∞
= ∑ b n z −n + ∑ α n z − n
n = −∞ n=0
∞ ∞
= ∑ (b −1 z ) l + ∑ (αz −1 ) n
l =1 n=0
The first power series converges if |b-1z| < 1 i.e |z| < |b| and second power series converges if |αz-1| < 1
i,e |z| > |α|

Case I: |b| < |α |


Im(z)

z-plane

Re(z)

Case II: |b| > |α |

Downloaded from www.jayaram.com.np/ -40


Downloaded from www.jayaram.com.np

Im(z)

z-plane

|α |
Re(z)

1 1
X ( z) = − +
1 − bz −1
1 − αz −1
b −α
=
α + b − z − αbz −1
ROC: |α | <|z| < |b|

Date: 2066/08/24

(1) linearity :
If , x1(n)  z  X1(z)
, x2(n)  z  X2(z)

Then x(n) = a1x1(n)+ a2x2(n) = a1X1(z)+a1X2(z)


Proof:

X(z) = ∑ x( n) z
n = −∞
−n


= ∑ ( a x ( n) + a
n = −∞
1 1 2 x 2 (n)) z − n
∞ ∞
= a1 ∑ x1 (n) z − n + a 2 ∑x 2 ( n) z − n
n = −∞ n = −∞
= a1X1(z)+a1X2(z)

# Determine z-transform and ROC of the signal


x[n] = [ 3(2n)-4(3n)]
Proof:
Let, x1(n) = 2nu(n)
x2(n) = 3nu(n)
Then,
x(n) = 3x1(n) -4x2(n)
Accordign to linearity property.

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 41


Downloaded from www.jayaram.com.np

X(z) = 3X1(z)-4X2(z)
1
X1(z) = Z {x1(n)} = ROC: |z| > 2
1 − 2 z −1
1
X2(z) = Z {x2(n)} = ROC: |z| > 3
1 − 3 z −1
The intersection of ROC of X1(z) and X1(z) is |z| > 3.
Now
3 4
X(z) = −1
− |z| > 3
1 − 2z 1 − 3 z −1

# Determine z-transform of the signals:


(a) x(n) = (coswon) u(n)
(b) x(n) = (sinwon) u(n)

Solution:
x(n) = (coswon) u(n)
( )
= 1 / 2 e jw0 n + e − jw0 n u (n)
1 1 
=  e jw0 n u (n) + e − jw0 n u (n) 
2 2 
Using linearity property.
1 1
X(z) = Z {e jw0 n u (n)} + Z {e − jw0 n u (n)}
2 2
1 1
Z {e jw0 n u (n)} = = ROC: |z| > 1
1− e zjw0 n −1
1 − 2 z −1
1 1
Z {e − jw0 n u (n)} = − jw0 n −1
= ROC: |z| > 1
1− e z 1 − 2 z −1
1 1 1 1
X(z) = . jw0 n −1
+ . − jw0 n −1
2 1− e z 2 1− e z
−1
1 − z Cosw0
= ROC: |z| > 1
1 − 2 z −1 cos w0 + z − 2
1 jw0 n − jw0 n
(b) x(n) = (e e )u (n)
2j
1 − z −1 Sinw0
X(z) = ROC: |z| > 1
1 − 2 z −1 cos w0 + z − 2

(2) Time Shifting:-


If x(n)  z  X(z)
Then , x(n-k)  z  z-k X(z)
Proof:

x(n-k)  z  ∑ x( n − k ) z
n = −∞
−n

Put n-k = m

Downloaded from www.jayaram.com.np/ -42


Downloaded from www.jayaram.com.np


= ∑ x ( m) z
m = −∞
−( m + k )


= z −k ∑ x ( m) z
m = −∞
−( m )

= z-k X(z)

# By applying the time-shifting property determine z-transform of x2(n) and x3(n) form z-transform of
x1(n) given as,
5
x1(n) = { 1,2, 5,7, 0, 1} , x2(n) = {1,2, ↑ , 7, 0, 1}
x3(n) = {0,0,1,2,5,7,0,1}
Solution:
X2(n) = x1(n+2), x3(n) = x1(n-2)
Now,
X2(z) = z2X1(n)
X1(z) = 1+2z-1+5z-1+7z-3+z-5
X2(z) = z2+2z+5+7z-1 +z-3

ROC: Entire z-plane except z = 0 and z = ∞


X3(z) = z-2X1(z)
= z-2+2z-3+5z-4+7z-5+z-7
Roc: entire z-plane except z = 0.

# Determine the z-transform of the signal .


1 0 ≤ n ≤ N −1
x ( n) = 
0 otherwise
Solution:
N −1
X(z) = ∑ 1. z
n =0
−n

−1
= 1+ z + z −2 + z −3 ......... + z − ( N −1) = N if z = 1
1 − z −N
= if z ≠ 1
1 − z −1

Alternative method:-
X(n) = u(n) – u(n-N)
Using linearity and time shifting property.
X(z) = Z{u(n)} –Z{u(n-N)}
1 z −N
= −
1 − z −1 1 − z −1
1− z −N
= ROC: |z| > 1
1 − z −1
Next method
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 43
Downloaded from www.jayaram.com.np

u(n)

u(n-N)

0 N-1 N 0 N
Date:2066/08/25

(3) Scaling in z-domain:-


If x(n) z  X(z) ROC, r1 <|z| <r2
Then a-1x(n)  z X(a-1z) ROC: |a|r1 <|z| <|a|r2
For any real constant a real or complex.
∞ ∞
Z [a n x(n)] = ∑ a n x ( n) z − n =
n = −∞
∑ x(n)(a
n = −∞
−n
z ) − n = X (a −1 z )

ROC : r1<|a-1z| <r2


a r1 < z < a r2

# Determine z-transform of the signals.


(a) x(n) = an(coswon)u(n)
(b) x(n) = an(sinwon)u(n)

Solution:
x(n) = an(coswon)u(n)
x1(n) = coswon u(n)
1 − z −1 cos w0
X1(z) = Z [cos w0 n u (n)] = ROC: |z| >1
1 − 2 z −1 cos w0 + z −1
Then,
X(n) = anx1(n)
1 − az −1 cos w0
X(z) = Z [a n x1 (n)] = X 1 (a −1 z ) = ROC: |z| >|a|
1 − 2az −1 cos w0 + a 2 z −1

(b) x(n) = an(sinwon)u(n)


az −1 sin w0
X(z) = = ROC: |z| >|a|
1 − 2az −1 cos w0 + a 2 z −1

(4) Time reversal:


If x(n) z  X(z) ROC, r1 <|z| <r2
Then x(-n)  z X(z-1) ROC: 1/r2 <|z| <1/r1

Proof:

Downloaded from www.jayaram.com.np/ -44


Downloaded from www.jayaram.com.np


Z [{x(− n)}] = ∑ x( − n) z
n = −∞
−n

Put , l = -n

= ∑ x(l ) z
l = −∞
l


= ∑ x(l )( z
l = −∞
−1 −l
)

= X(z-1)

ROC of X(z-1) is r1 <|z| <r2 or, 1/r2 <|z| <1/r1


Note that ROC of x(n) is the inverse of that for x(-n)

# Determine the z-transform of the signal.


x(n) = u(-n)
Solution:
1
u(n)  z  |z| > 1
1 − z −1
Using time reversal property.
1
u(-n)  z  |z| < 1
1− z

(5) Differentiation in z- transform

If x(n)  z  X(z)
dX ( z )
Then n x(n)  z  -z
dz
Proof:-

X ( z) = ∑ x ( n) z
n = −∞
−n

By differentiation,
dX ( z ) −∞
= ∑ x(n)(− n) z − n−1
dz n =∞

−∞
= − z −1 ∑ {nx(n) z − n
n =∞
−1
= − z Z {nx(n) }
dX ( z )
Z {nx(n)} = − z Note that both transform have same ROC.
dz

# Determine z-trnasform of the signal.


x(n) = nanu(n)
Proof:
x1(n) = anu(n)
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 45
Downloaded from www.jayaram.com.np

1
x1(n) = ROC; |z| >|a|
a − az −1

x(n) = n x1(n)
dX 1 ( z )
X(z) = Z{n x1(n)} =
dz
−1
= −z −1 2
az − 2
(1 − az )
az −1
= ROC: |z| >|a|
(1 − az −1 ) 2

# Determine the signal x(n) whose z-transform is given by


X(z) = log(1+az-1), |z| >|a|

Solution:
dX ( z ) 1
= −1
. − az − 2
dz (1 + az )
dX ( z ) az −1
−z = .
dz (1 + az −1 )
 1 
= az −1  −1 
1 − (− a ) z 
Taking inverse z-transform.
n x(n) = a(-a)n-1 u(n-1)
x(n) = (-1)n-1 . an/n u(n-1)

Date: 2066/08/26

If x1(n) z  X1(z)
x2(n)  z X2(z)

Then
X(n) = x1(n).x2(n) z  X(z) = X1(z) X2(z)
The ROC of X(z) is at least the intersection of the for X1(z) and X2(z).
Proof:
The convolution of x1(n) and x2(n) is defined as

x ( n) = ∑ x (k ) x
k = −∞
1 2 (n − k )

z-transform of x(n) as,



X ( n) = ∑ x( n) z
n = −∞
−1

Downloaded from www.jayaram.com.np/ -46


Downloaded from www.jayaram.com.np

∞ ∞
 
X ( n) = ∑  ∑ x (k ) x
n = −∞ k = −∞
1 2 (n − k ) z −n 

∞ ∞
X ( n) = ∑
k = −∞
x1 (k ) ∑ x 2 (n − k ) z − n
n = −∞

X (n) = ∑ x (k ) z
k = −∞
1
−n
x2 ( z )

X (n) = X 2 ( z ) ∑ x1 (k ) z − n
k = −∞
= X2(z)X1(z)

# Compute convolution x(n) of the signals


X(n) = { 1,-2, 1}
1 0 ≤ n ≤ 5
x 2 (n) = 
0 otherwise

Inverse z-transform.


X ( z) = ∑ x(k ) z
k = −∞
−k
………….(i)

Multplyign both sides of (i) by zn-1 and integrate both sides over a closed contour within the ROC of
X(z) which enclosed the origin .
Now,

n −1
∫ X ( z ) z dz = ∫ ∑ x( k ) z n −1− k
dz.........(2)
C k = −∞
Where C denotes closed counter in the ROC of X(z) .
We can interchanged the order of integration and summation on right hand side of (2) .

n −1
∫ X ( z ) z dz = ∑ x(k ) ∫ z
k = −∞
n −1− k
dz.........(3)
C
From Cauchy integral theorem ,

Figure:
1 1 k = n
∫ z n −1− k dz = 
2πj C 0 k ≠ n
Then,

∫ X ( z) z
n −1
dz = 2πjx(n)
1
X ( z ) z n −1 dz ……..(4)
2πj C∫
x ( n) =

7) Multiplication of two sequences:-

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 47


Downloaded from www.jayaram.com.np

If x1(n) z  X1(z)
x2(n)  z X2(z)
Then
1 z
x(n)  z x1(z)x2(z)  zX(z) = ∫ X 1 (u ) X 2  v −1 dv
2πj C v
Where C is sthe closed counter that encloses the origin and lies within the ROC of common to both
X1(v) and X2(1/v)


X ( z) = ∑ x ( n) z
n = −∞
−n


X ( z) = ∑ x ( n) x
n = −∞
1 2 (n) z − n

Where,
1
x1 (n) = ∫ X 1 (v)v n −1 dv
2πj C
*  z  −1
*
1
2πj C∫
x1 (n) = X 1 (v) X 2  v dv
 v 

−n
1  ∞  z   −1
∑ 2
2πj C∫
X ( z) = X 1 ( v ) x ( n )   v dv
 n = −∞  v  

8) Parseval’s theorem:-

If x1(n) and x2(n) are complex valued sequence, then,


1
∑ x ( n) x
n = −∞
1 2 * (n) =
2πj C∫
X 1 (v) X 2* (1 / v * )v −1 dv

X ( z ) = ∑ cn z −n

X(n) = cn for all n.


Where X(z) is rational, the expansion can be performed by long division.

# Determine inverse z-transform of


1
X ( z) =
1 − 0 .5 z + 0 .5 z − 2
−1

When
(a) ROC: |z| > 1
(b) ROC : |z| <0.5

Downloaded from www.jayaram.com.np/ -48


Downloaded from www.jayaram.com.np

Solution:
(a) ROC: |z| >1 , x(n) is causal signal.
-1 -2 -1 -2
1-0.5z +0.5z ) 1 (1-0.5z -0.25z
-1 -2
1-0.5z +0.5z
-1 -2
0.5z -0.5z
-1 -2 -3
0.5z -0.25z +0.25z
-2 -3
-0.25z -0.5z
-2 -3 -4
-0.25z +0.5z -0.125z
-3 -4
0.375z +0.125z
-3 -4 -5
-0.375z +0.18175z +0.18175z
-4 -5
-0.0625z +1.8175z

X(z) = {1+0.5z-1-0.25z-2-0.375z-3 ……..}


x(n) = { 1, 0.5, -0.25, -3.75, ……..}

(b) ROC : |z| <0.5 x(n) is anticausal signal.


-2 -1 2 3 4
0.5z -0.5z +1) 1 (2 z + 2z - 2z
2
1-z+2z
2
z - 2z
2 3
z - z + 2z
2 3
z - 2z
2 3 4
- z + z - 2z
3 4
-3z + 2z
3 4 5
-3z + 3z - 6z
4 5
-z + 6z

X ( z ) = 2 z 2 + 2 z 3 − 2 z 4 − 6 z 5 ……..
= …………. 6 z 5 − 2 z 4 + 2 z 3 + 2 z 2 + 0 + 0
∴ x(n) = {........ − 6,−2, 2 , 0, 0}

Initial value theorem:


X(0) = lim z → ∞ X(z)

Final value theorem:-


Lim n→ ∞ x(n) = lim z→1 (z-1) X(z)

# The impulse response of relaxed LTI system is h(n) = α n u (n) α < 1 . Determine the step response
of the system where n tends to infinity.
Solution:-
y(n) = x(n)*h(n)
x(n) = u(n)
h(n) = α n u (n)
Y(z) = X(z) H(z)
 1  1 
X(z) =  −1   −1 
 1 − z   1 − αz 
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 49
Downloaded from www.jayaram.com.np

Now,
Lim n → ∞ y(n) = lim z →1 (z-1)Y(z)
z2
= lim z tends to 1 (z-1)
( z − 1)( z − α )
1
=
1−α

System function (transfer function) of LTI System:-


The o/p of LTI system to an input sequence x(n) can be obtained by comparing the convolution of x(n)
with unit sample of the system. i.e y(n) = x(n)*h(n)
We can express this relationship in z-domain as
Y(z) = X(z) H(z)
When, Y(z) = z-transform of y(n)
X(z) = z-transform of x(n)
H(z) = z-transform of h(n)
Y ( z)
Now, H(z) =
X ( z)

H ( z) = ∑ h ( n) z
n = −∞
−n

H(z) represent the z-domain characteristics of the system where as h(n) is corresponding time domain
characteristics of the system. The transform H(z) is called the system function or transfer function.

General form of liner constant coefficient difference equation:-


The system is described by liner constant coefficient difference form.
N M
y (n) = −∑ a k y (n − k ) + ∑ bk x(n − k ) ……….(1)
k =1 k =0
Taking z transform on both sides,
N M
Y ( z ) = − ∑ a k z − k Y ( z ) + ∑ bk z − k X ( z )
k =1 k =0

 N
 M
Y ( z )1 + ∑ a k z − k  = ∑ bk z − k X ( z )
 k =1  k =0
M

Y ( z)
∑b z k
−k

H ( z) = = k =0
N
……….(2)
X ( z)
1 + ∑ ak z −k

k =1
Therefore a LTI system described by constant coefficient difference equation has a rational system
function from this general form we obtained two important special forms:
M
1. if ak = 0 , for 1 <= k<= N . Equation (2) reduces to H ( z ) = ∑ bk z − k (all zero system) such a
k =0
system has finite duration impulse response and it is called FIR system or moving average
(MA) system.

Downloaded from www.jayaram.com.np/ -50


Downloaded from www.jayaram.com.np

2. On the other hand if bk = 0 , for 1 <= k<= n the system function reduces to
b0
H ( z) = N
…….(4) (all pole system) Due the presence of poles the impulse
1 + ∑ ak z −k

k =1
response of such a system is infinite in duration and hence it is IIR system.

# Determine the system function and unit sample response of the system describe by the difference
equation y(n) = ½ y(n-1) +2x(n).
Solution:
Taking z-transform on both sides,
Y ( z ) = 1 / 2Y ( z ) + 2 X ( z )
(1 − 1 / 2 z −1 )Y ( z ) = 2 X ( z )
Y ( z) 2
H ( z) = =
X ( z ) 1 − 1 / 2 z −1
By inversion,
h(n) = 2 (1/2)n u(n)

Date: 2066/09/16

Response of pole zero system with Non-zero initial condition:-


The difference equation,
N M
y (n) = −∑ a k y (n − k ) + ∑ bk x(n − k ) ……………………………(i)
k =1 k =0
Suppose that the signal x(n) is applied to the pole zero system at n = 0 . Thus the signal x(n) is assume to
be a causal. The effects of all previous input signal to the system are reflected in the initial condition y(-
1), y(-2) ……..y(-N). Since the input x(n) is causal and since we are interested in terminating the o/p
signal y(n) for n ≥ 0 we can use one sided z-transform which allows us to deal with initial condition.
Now,
N
 k
 m
Y + ( z ) = −∑ a k z −1 Y + ( z ) + ∑ y (− n) z − n  + ∑ bk z − k X + ( z ) ………..(2)
k =1  n =1  k =0
+
Since x(n) is causal, We can set X ( z ) = X ( z )
M N k

∑ bk z −k ∑ a k z − k ∑ y ( − n) z − n
Y + (z) = k =0
N
.X ( z) − k =0 n =1
N
1 + ∑ a k z −k 1 + ∑ a k z −k
k =1 k =1

N (z)
= H ( z) X (z) + o …………..(3)
A( z )
Where,
N k
N 0 ( z ) = −∑ a k z − k ∑ y (n) z n ………….(4)
k =1 n =1

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 51


Downloaded from www.jayaram.com.np

From (3) the o/p of the system can be sub divided into two parts. The 1st part is zero state response of the
system defined in z-domain as Yzs ( z ) = H ( z ) X ( z ) …….. (5).
The second component corresponding to o/p resulting form initial condition. This o/p is zero input
N ( z)
response of the system which is defined in z-domain as Yzi ( z ) = 0 …………(6)
A( z )
Since the total response is the sum of the two o/p component which can be expressed in time domain by
determining inverse z-transform of Yzs ( z ) = Yzi ( z ) . Seperately and adding the result.
y(n) = yzs(n) + yzi(n) ………..(7)

# Determine the unit step response of the system described by the difference equation y(n) = 0.9y(n-1) –
0.81 y(n-1) + x(n). Under the following initial condition.
(a) y(-1) = y(-2) = 0.
(b) y(-1) = y(-2) = 1 .

Taking one-side z-trnasfrom.


[ ] [ ]
Y + ( z ) = 0.9 z −1 Y + ( z ) + y (−1) z − 0.8 z −2 Y + ( z ) + y (−1) z + y (−2) z −2 + X + ( z )
For y(-1) = y(-2) = 0
Y + ( z ) = 0.9 z −1Y + ( z ) − 0.81z −2Y + ( z ) + X + ( z )
Y + ( z) 1
=
x ( z ) 1 − 0.9 z − 0.81z − 2
+ −1

Yzs+ ( z ) z2 z2
= 2 =
z ( z − 0.9 z + 0.8 z )( z − 1) ( z − 0.9e jπ / 3 )( z − 1)
z2 k1 k1* k
jπ / 3 − jπ / 3
= jπ / 3
+ − jπ / 3
+ 2
( z − 0 .9 e
2
)( z − 0.9e )( z − 1) ( z − 0.9e ) ( z − 0 .9 e ) z −1

k1 = 1.098e − j 5.53
o

k * = 1.098e j 5.53 , k2 = 1.1


o

1.098e − j 5.53 1.098e j 5.53 1 .1


Yzs+ ( z ) = jπ / 3 −1
+ − jπ / 3 −1
+
(1 − 0.9e z ) (1 − 0.9e z ) 1 − z −1
By inversion,

[ ]
y zs (n) = 1.098e − j 5.53 (0.9e jπ / 3 ) n + 1.098e j 5.53 (0.9e − jπ / 3 ) n + 1.1 + y (n)
[
= 1.1 + 1.098(0.9) n cos(nπ / 3 − 5.53) u (n) ]
(b) y(-1) = y(-2) = 1.
N ( z)
Yzi ( z ) = o
A( z )
N k
N o ( z ) = ∑ a k z − k ∑ y (n) z − n
k =1 n =1

Downloaded from www.jayaram.com.np/ -52


Downloaded from www.jayaram.com.np

2 k
N o ( z ) = −∑ a k z − k ∑ y (− n) z − n
1 n =1

[ −1 −2
= a1 z y (−1) z + a 2 z ( y (−1) z + y (−2) z 2 ) ]
[
N 0 ( z ) = − − 0.9 × 1 + 0.81z −1
]
+ 0.81 × 1 = 0.09 – 0.81z-1

0.09 − 0.81z −1
Yzi ( z ) =
1 − 0.9 z −1 + 0.81z − 2
Y ( z ) = Yzs ( z ) + Yzi ( z )
1.099 0.568 + j 0.445 0.568 − j 0.445
= + +
1 − z −1 1 − 0.9e jπ / 3 z −1 1 − 0.9e jπ / 3 z −1
[
y (n) = 1.099 + 1.44(0.9) n cos(nπ / 3 + 38) u (n) ]

Date: 2066/09/20

# Determine well known fibanacci sequence of integer numbers is obtained by computing each term as
the sum of two previous ones, the first few terms of the sequences are

1, 1, 2, 3, 5, 8 ……………..
Determine a close form expression for the nth term of Fibonacci series.
Solution:-
Let y(n) be the nth term. Then,
Y(n) = y(n-1) + y(n-2) ………(i)
With initial condition ,
y(0) = y(-1)+y(-2) = 1
y(1) = y(0)+y(-1) = 1
y(-1) = 1-1 = 0, y(-2) = 1 .
Taking one sided z-tranzsform on both sides of (i).
Y + ( z ) = z −1Y + ( z ) + y (−1) + z −2Y + ( z ) + Y ( z ) + y (−1) z −1
Y + ( z ) = z −1Y + ( z ) + z −2Y + ( z ) + 1
1 z2
Y + ( z) = =
1 − z −1 − z − 2 z 2 − z − 1
Y + ( z) z 1+ 5  1 1− 5  1
= 2 =  . +  .
z z − z − 1  2 5   1 + 5   − 2 5  1− 5 
z −  
 z −  

 2   2 
1+ 5  1 1− 5  1
Y + ( z ) =  +
 −  .

 2 5  1 −  1 + 5  z −1  2 5  1 −  1 − 5  z −1
 2   2 
   
Taking inverse z-transformation.
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 53
Downloaded from www.jayaram.com.np

 1 + 5  1 + 5  n  1 − 5  1 − 5  n 
y (n) =    −   u ( n)
 2 5  2   2 5  2  
 

# Determine step response of the system y(n) = α y(n-1) + x(n) -1 < α < 1
When initial condition is y(-1) = 1.
Solution:
Taking one sided z-transform,
[ ]
Y + ( z ) = α z −1Y + ( z ) + y (−1) + X + ( z )

X + ( z ) = Z [u (n)] =
1
1 − z −1
1
Or , Y + ( z ) = αz −1Y + ( z ) + α +
1 − z −1
1
Or, Y + ( z )(1 − αz −1 ) = α +
1 − z −1
α 1
Y + ( z) = +
1 − αz −1
(1 − z )(1 − αz −1 )
−1

α  1  1   1  1 
Y + ( z) = +  −1 
−  −1 
1 − αz  1 − α  1 − z   1 − α  1 − αz 
−1

Taking inversion,
 1   1  n
y (n) = αα n u (n).1 u (n) −  α u (n)
1−α  1− α 
α n +1 (1 − α ) + 1 − α n +1 
= 
 1−α 
1 − α n+ 2 
y ( n) =  u ( n)
 1−α 
# Determine the response of the system y(n) = 5/6. y(n-1) – 1/6 y(n-2) + x(n) to the input signal
1
x(n) = δ (n) − δ (n − 1)
3
Solution:
Taking z-transform in both sides.
5 1
Y ( z ) = z −1Y ( z ) − z − 2Y ( z ) + X ( z )
6 6
1
X ( z ) = 1 − z −1
3
5 1  1 
Y ( z ) = z −1 − z − 2Y ( z ) + 1 − z −1 
6 6  3 
 5 1   1 
= 1 − z −1 + z − 2 Y ( z ) = 1 − z −1 
 6 6   3 

Downloaded from www.jayaram.com.np/ -54


Downloaded from www.jayaram.com.np

 1 −1 
1 − z 
Y ( z) =  3 
 5 −1 1 − 2 
1 − z + z 
 6 6 
1
Y ( z) =
1
1 − z −1
2
Taking inverse z-transform,
n
1
y ( n) =   u ( n )
2
Causality and stability:-
A causal LTF system is one where unit sample response u(n) satisfies the condition h(n) = 0, for n
< 0. We have also shown that ROC of z-transform of a causal sequence is exterior of a circle.

A necessary and sufficient condition for a LTI system to be BIBO stable is ∑ h(n) < ∞ . In turn this
n = −∞
condition implies that H(z) must contain the unit circle within it’s ROC.
Indeed, Since

H ( z) = ∑ h ( n) z
n = −∞
−n


H ( z) ≤ ∑ h( n ) z
n = −∞
−n

When evaluating on the unit circle i.e z = 1



H ( z) ≤ ∑ h ( n)
n = −∞

Hence if the system is BIBO, the unit circle is contained in the ROC of H(z).

# A LTI system is characterized by the system function.

3 − 4 z −1
H ( z) =
1 − 3.5 z −1 + 1.5 z − 2
Specify the ROC of H(z) and determine h(n) for the following condition.
(a) The system is stable.
(b) The system is causal.
(c) The system is anticausal.

Solution:-
1 2
H ( z) = +
1 1 − 3 z −1
1 − z −1
2
The system has poles at z = ½ and z = 3.

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 55


Downloaded from www.jayaram.com.np

(a) Since the system is stable, its ROC must include the unit circle and hence it is ½ < |z| <3.
Consequently h(n) is non-causal.
n
1
h(n) =   u (n) − 2.(3) n u (−n − 1) ( The system is unstable).
2
n
1
(b) Since the system is causal , its ROC is |z| >3. In this case h(n) =   u (n) + 2(3) n u (n) ( The
2
system is unstable).
(c) Since the system is anticausal it’s ROC is |z| <1/2 . In this case,
n
1
h(n) =   u (− n − 1) + 2.(3) n u (− n − 1) . (The system is unstable).
2

Date: 2066/09/22

Transient and steady state response:

# Determine the transient and steady state response of the system characterized by the difference
 nπ 
equation y(n) = 0.5y(n-1) +x(n). When the input signal is x(n) = 10cos  u (n) . The system is
 4 
initially at a rest (i.e it is relaxed ).

Solution:
Taking z-transform,
Y ( z ) = 0.5 z −1Y ( z ) + X ( z )
Y ( z) 1
=
X ( z ) 1 − 0.5 z −1
1 − z −1 cos wo
Z (cos wo n u (n)) =
1 − 2 z −1 cos wo + z − 2
 −1 π  101 − 1 z −1 
 1 − z cos 
X ( z ) = 10  4 =  2 

1 − 2 z −1 cos π + z − 2  1 − 2 z + z
−1 − 2
( )
 4 
 1 −1 
1 − z 
Y ( z) =
1  2 
−1
(1 − 0.5 z )
.10
(
1 − 2 z + z −2
−1
)
1
10(1 − z −1 )
= 2
jπ / 4
−1
(1 − 0.5 z )(1 − e z −1 )(1 − e − jπ / 4 z −1 )
63 6.78e − j 2.870 6.78e j 28.7
= + +
1 − 0.5 z −1 1 − e jπ / 4 z −1 1 − e − jπ / 4 z −1

Downloaded from www.jayaram.com.np/ -56


Downloaded from www.jayaram.com.np

The natural or transient response is


y nr (n) = 6.3(0.5) n u (n) and forced or steady response is
[ ]
y fr (n) = 6.78e j 28.7 e jnπ / 4 + 6.78e j 28.7 e − jnπ / 4 u (n)
 π 
= 13.56 cos n − 28.7 u (n)
 4 
Pole-zero diagram:-
1 − z −1 − 2 z −2
H ( z) =
1 − 1.75 z −1 + 1.4 z − 2 − 0.375 z −3
z 3 − z 2 − 2z
= 3
z − 1.75 z 2 + 1.25 z − 0.375
z ( z − 2)( z + 1)
=
( z − 0.75)( z − 0.5 − j 0.5)( z − 0.5 + j 0.5)

Im(z)

j0.5

-1 0.75 1 2 Re(z)

-j0.5

Fig: pole-zero diagram

Zeroes at z = 0, 2, -1
Poles at z = 0.75, 0.5 ± j 0.5

# A filter is characterized by following poles and zeroes on z-plane.

Zeroes at Poles at
Radius Angle Radius Angle
0.4 π rad 0.5 0 rad
0.9 1.0376 0.892 2.5158 rad
Shows z-plane plot and plot magnitude response (not to scale ).
Solution:-
Zeroes are,
z = 0 .4 e j π = − 0 .4
z = 0.9e j1.0376 = 0.45 + j 0.77
Poles are:
z = 0.5e j 0 = 0.5
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 57
Downloaded from www.jayaram.com.np

z = 0.892e 2.5158 = −0.728 + j 0.522

Im(z)

j0.77
j0.522

-0.722 -0.4 0.45 0.5 Re(z)

Fig: z-plane plot

( z + 0.4)( z − 0.45 − j 0.77)


H ( z) =
( z − 0.5)( z + 0.77 − j 0.522)
Put, z = e jwT ,
(e jwT + 0.4)(e jwT − 0.45 − j 0.77)
H ( z ) = jwT
(e − 0.5)(e jwT + 0.77 − j 0.522)
H (e jwT ) H (e jwT )
WT = 0 WT =3π / 4 =3.438
jwT
H (e ) H (e jwT )
WT =π / 4 = 0.319 WT =π =1.11

H(ejwt )

0.478

0 π/4 π/2 3π/ 4 π ωΤ

Fig: magnitude response

Notch filter:

Downloaded from www.jayaram.com.np/ -58


Downloaded from www.jayaram.com.np

It is a filter that contain one or more deep notches or ideally perfect nulls in its frequency response
characteristics. Notch filter are useful in many application where specific frequency component must be
illuminates for example, instrumentation in recording system requires that power line frequency of 50
Hz and its harmonics be illuminated.

H(ejwt )

0 ω0 ω1 ωΤ
(null)

To create a null in frequency response of filter at frequency w0 we simply introduce a pair of complex
conjugate zero on the unit circle. z1, 2 = e ± jwo
System function is given by ,
H ( z ) = b0 (1 − e jw0 z −1 )(1 − e jw0 z −1 )(1 − e jw0 z −1 )

Date: 2066/09/23

Response to complex exponential signal: Frequency response function:-



The input-output relationship for LTI system is u (t ) = ∑ h(k ) x(n − k ) …………..(i)
k = −∞
To develop a frequency domain characteristics of the system.
Let us excite the system with complex exponentials.
x(n) = Ae jwn − ∞ < n < ∞ ………….(2)
Where, A is amplitude and w is orbitrary frequency confined to the frequency interval [− π , π ]
Now,

∑ h(k )[Ae ]

jw ( n − k )
y ( n) =
k = −∞

 ∞ 
=  ∑ h(k ) Ae − jwk  e jwn ………………..(3)
k = −∞ 

H ( w) = ∑ h ( k )e
k = −∞
− jwk
……………….(4)

The function H(w) exists if the system is BIBO stable, that is


∑ h(n) < ∞
n = −∞
………………….(5)

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 59


Downloaded from www.jayaram.com.np

The response of the system to complex exponential is given by ,


y (n) = AH ( w)e jwn ………….(6)
We note that the response is also in the form of complex exponential with the same frequency as the
input but altered by multiplicative factor H(w). The multiplicative factor is called eigen value of the
system in this case a complex exponential of the form (2) is an eigen function of LTI system and H(w)
evaluated at frequency of input signal is corresponding eign value.

n
1
# Determine the o/p sequence of the system with impulse response h(n) =   u (n) When the input is
2
jπn / 2
complex exponential sequence x(n) = Ae u ( n) −∞ < n < ∞.
Solution:-
1
H ( z) =
1.
1 − z −1
2
1
H ( w) =
1
1 − e − jw
2
π
At w = ,
2
π  1 2
H  = π
= e − j 26.6
2 1 −j 5
1− e 2
2
And therefore the o/p is
π
 2 − j 26.6  jn 2
y (n) = A e e
 5 
n
2 j (π − 26.6 )
y ( n) = Ae 2 , −∞ < n < ∞
5

n
1
# Determine the response of the system with impulse response h(n) =   u (n) to the input signal
2
π
x(n) = 10 − 5 sin n + 2 cos πn −∞ < n < ∞
2
Solution:-
1
H ( z) =
1
1 − z −1
2
1
H ( z) =
1
1 − e − jw
2
The first term in a input signal is a fixed signal component corresponding to w = 0. Thus,

Downloaded from www.jayaram.com.np/ -60


Downloaded from www.jayaram.com.np

1
H (0) = =2
1
1−
2
π
The second term in x(n) has frequency . Thus ,
2
π  1 2
H  = π
= e − j 26.6
2 1 −j 5
1− e 2
2
2
Finally the third term in x(n) has a frequency w = π . Thus H (π ) = .
3
Hence the response of the system to x(n) is,
10 π  40
y (n) = 20 − sin  n − 26.6  + cos πn, −∞ < n < ∞
5 2  3

# A LTI system is described by following difference equation y (n) = ay (n − 1) + bx(n)


0 < a < 1.
(a) Determine the magnitude and phase of frequency response H(w) of the system.
(b) Choose the parameter ‘b’ so that the maximum value of H (w) and phase of H(w) for a= 0.9.
π  π
(c) Determine the o/p of the system to signal for x(n) = 5 + 12 sin n − 20 cos πn +  .
2  4

Date: 2066/09/25
Chapter:- 5

Discrete filter structure:-


Cascade form structure:-
H ( z ) = Π kk =1 H k ( z )
Where k is integer part of (N+1)/2

bko + bk1 z −1 + bk 2 z −1
H k (k ) =
1 + a k 1 z −1 + a k 2 z − 2

x2(n) x3(n) xk(n)


H1(z) H2(z) Hk(z)
y1(n) y2(n) y(n)

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 61


Downloaded from www.jayaram.com.np

yk(n)=xk+1(n)
xk(n)
+ +

z -1

-a k1 bk1
+ +

z -1
-a k2 bk2

Parallel form structure:


N
Ak
H ( z) = c + ∑ −1
k =1 1 − p k z
C

H1(z) +

x(n)
H2(z) +

Hk(z) +
y(n)

# Determine the cascade parallel realization for the system described by the system function
 1  2 
(
101 − z −1 1 − z −1  1 − 2 z −1 )
H ( z) =  2  3 
 3 −1  1 −1    1 1  −1    1 1  −1 
1 − z 1 − z  1 +  + j  z  1 −  − j  z 
 4  8   2 2  2 2 

Cascade form:-

Downloaded from www.jayaram.com.np/ -62


Downloaded from www.jayaram.com.np

2 −1 2
1− z 1 − z −1
H1 z = 3 = 3
 3 −1   1 −1  1 − 7 z −1 + 3 z − 2
1 − z   1 − z 
 4  8  8 32

1 − z  (1 + 2 z )
 1 −1  −1

H 2 ( z) =  2 
 1 1  −1    1 1  −1 
1 −  2 + j 2  z  1 −  2 − j 2  z 
      
3
1 + z −1 − z − 2
= 2
1
1 − z −1 + z − 2
2
H ( z ) = 10 H 1 ( z ) H 2 ( z )
The cascade relationship is
x(n) 1 10
+ + + +
y(n)
z-1 z-1

1
7/8 -2/3 1 -3/2
+ + +

z-1 z-1

-3/32 -1/2 -1

Parallel form:-

 1  2
10 z −   z −  ( z + 2 )z
H ( z) =  2  3
 3  1 1 1    1 1 
 z −   z −   z −  + j    z −  − j 
 4  8  2 2    2 2 
 1  2
10 z −   z −  ( z + 2 )
H ( z)
=  2  3
z  3  1 1 1    1 1 
 z −   z −   z −  + j    z −  − j 
 4  8  2 2    2 2 
k1 k2 k3 k 3*
= + + +
z−
3
z−
1 1 1 1 1
z − + j  z − − j 
4 8 2 2 2 2
k1 = 2.93, k 2 = −17.68 , k3 = 12.25 − j14.57, k 3* = 12.25 + j14.57
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 63
Downloaded from www.jayaram.com.np

2.93 − 17.68 12.25 + j14.57 12.25 + j14.57


H ( z) = + + +
1 − z −1 1 − z −1 1 −  +
3 1 1 1 1 1
j  z −1 1 −  − j  z −1
4 8 2 2 2 2

z-1 z-1 z-1 z-1

h(2) h(m-1)
h(1)

+ + + + +
yk(n)

Cascade form structure:-

H ( z ) = Π kk =1 H k ( z )
H k ( z ) = bko + bk1 z −1 + bk 2 z −2 k = 1, 2 ..........k

H1(z) H2(z) H k(z)


x(n) = x1(n) y(n)

z-1 z-1
xk(n)

bk1 bk2
bk0

+ +
yk(n)

Lattice form structure:


Fir filter with system function
H m ( z ) = Am ( z ) m = 0,1 ...........m − 1

m
Am ( z ) = 1 + ∑ α m (k ) z − k m ≥1
k =1

Ao (m) = 1
hm ( z ) = 1, hm (k ) = α m (k ), k = 1,2..............m
m
→ deg ree of polynomial.

Downloaded from www.jayaram.com.np/ -64


Downloaded from www.jayaram.com.np

m
y ( n) = x ( n) + ∑ α m ( k ) x ( n − k )
k =1

z-1 z-1 z-1


x(n)

1 αm(1) αm(2)

+ + + +
y(n)

Figure: Direct form realization.


For m = 1.
y (n) = x(n) + α 1 (1) x(n − 1)
1st order lattice filter.
fo(n) f1(n)=y(n)
+

x(n)
go(n) g1(n)
z-1 +
go(n-1)

f 0 ( n ) = x ( n)
g 0 ( n) = x( n)
f 1 (n) = f 0 (n) + k1 g 0 (n − 1)
y (n) = x(n) + k1 x(n − 1)

g1 (n) = k1 f 0 (n) + g 0 (n − 1)
= k1 x(n) + x(n − 1)

k1 = reflection coefficient
k1 = α 1 (1)
f1(n) f2(n)=y(n)
fo(n)
+ +

k1 k2

x(n) k1 k2
go(n)
z-1 + z-1 +
go(n-1) g1(n) g1(n-1) g2(n)

y (n) = x(n) + α 2 (1) x(n − 1) + α 2 (2) x(n − 2)


f 2 (n) = f 1 (n) + k 2 g1 (n − 1)
= x(m + k1 (1 + k 2 ) x(n − 1) + k 2 x(n − 1)
= α 2 (2) = k 2 , α 2 (1) = k1 (1 + k 2 )
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 65
Downloaded from www.jayaram.com.np

Conversion of lattice coefficient to direct form filter coefficients:-

Direct form filter coefficient {α m (k )} can be obtained form lattice coefficients {k i } using the relations.
A0 ( z ) = B0 ( z ) = 1
Am ( z ) = Am −1 ( z ) + k m z −1 Bm −1 ( z ) m = 1, 2, ..............m − 1
Bm ( z ) = z − m Am ( z −1 ) m = 1, 2, .....................m − 1
Bm (z ) → Reverse polynomial of Am (z ).

1 1 1
# A given 3-stage lattice filter with coefficient k1 = , k 2 = , k 3 = . Determine FIR filter
4 2 3
coefficient for direct form structure.
A1 ( z ) = A0 ( z ) + k1 z −1 B0 ( z )
1
= 1 + z −1
4
1
α 1 (0) = 1, α 1 (1) = , Corresponding to single stage lattice filter.
4
 1  1
β1 ( z ) = z −1 A1 ( z −1 ) = z −1 1 + z  = + z −1
 4  4
A2 ( z ) = A1 ( z ) + k 2 z β1 ( z )
−1

3 1
= 1 + z −1 + z − 2
8 2
3 1
α 2 (0) = 1, α 2 (1) = , α 2 (2) = Corresponding to 2nd order lattice form.
8 2
1 3 −1
β 2 ( z ) = + z + z −2
2 8
A3 ( z ) = A2 ( z ) + k 3 z −1 β 2 ( z )
13 −1 5 − 2 1 −3
= 1+ z + z + z
24 8 3

13 5 1
α 3 (0) = 1, α 3 (1) = , α 3 ( z) = , α 3 (3) =
24 8 3

Date: 2066/09/27

Conversion of direct form FIR filter coefficient to lattice coefficient:


A ( z ) + k m Bm ( z )
Am+1 ( z ) = m m = m − 1,......... − 1
1 + k m2
k m = α m = α m (m)

Downloaded from www.jayaram.com.np/ -66


Downloaded from www.jayaram.com.np

# Determine lattice Coefficient Corresponding to FIR filter with system function.


13 −1 5 −2 1 −3 13 −3
H ( z ) = A3 ( z ) = 1 + z + z + z + z + z −3
24 8 3 24
Solution:
1 1 5 13 − 2
k1 = α 1 (3) = , B3 ( z ) = + z −1 + z + z −3
3 3 8 24

A3 ( Z ) − k3 B3 ( z ) 3 1
A2 ( z ) = = 1 + z −1 + z −2
1 − k32
8 2
1 1 3
K 2 = α 1 ( 2) = , B2 ( z ) = + z −1 + z − 2
2 2 8
A ( z ) − K 2 B2 ( z ) 1
A1 ( z ) = 2 = 1 + z −1
1 − k22
4
1
k1 = α 1 (1) =
4

Lattice and lattice ladder structure for IIR system:-


Let us begin with all-pole system with system function.
1 1
H ( z0 = = ……….. (1)
N
∆m( z )
1 + ∑ a m (k ) z −k

k =1
Difference equation for this system is
N
y (k ) = ∑ a m (k ) y (n − k ) + x(k ) ……………. (2)
k =1
When N = 1.
x(n) fO(n)
+ y(n)
f1(n)
-
K

+ z-1
g1(n) g1(n-1) go(n)

x(n) = f1(n)
fo(n) = f1(n) – k1go(n-1)
g1(n) = k1f0(n)+go(n-1)
y(n) = fo(n)
= f1(n)+k1go(n-1)
y(n) = x(n) –k1y(n-1)
y1(n) = k1y(1)+y(n-1)

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 67


Downloaded from www.jayaram.com.np

x(n) fO(n) fO(n)


+ + y(n)
f2(n)
- k2 -
k1

k2 k1

+ z-1 + z-1
g2(n) g1(n-1) g1(n) g0(n-1) go(n)
Fig: Two stage lattice structure

fo(n) = x(n)
f1(n) =f2(n) – k2g1(n-1)
g2(n) = k2f1(n)-k1g2(n-1)
fo(n) = f1(n) – k1g0(n-1)
g1(n) = k1fo(n) +go(n-1)
y(n) = fo(n) = go(n)
= f2(n) – k2g1(n-1) – k1go(n-1)
= - k1 (1+k2) y(n-1) – k2 y(n-2) + x(n)

∑C m (k ) z − k
Cm ( z)
H ( z) = k =0
N
=
Am ( z )
1 + ∑ a N (k ) z − k
k =0
Ladder Co-efficient,
v m = C m (m) m = 0, 1, 2, 3, ………M
C m−1 ( z ) = c n ( Z ) − v m / Bm ( z )
x(n) fO(n) fO(n)
+ + y(n)
f2(n)
- -
k2 k1

k2 k1

+ z-1 + z-1
g2(n) g1(n-1) g1(n) g0(n-1) go(n)
v1 vo
v2

+ +

# Obtain the lattice ladder structure.


1 + 3 z −1 + 3 z −2 + z −3
H ( z) =
1 − 0.9 z −1 + 0.64 z − 2 − 0.576 z −3
C ( z)
= 3
A3 ( z )
Solution:
Lattice coefficient:-

Downloaded from www.jayaram.com.np/ -68


Downloaded from www.jayaram.com.np

A3 ( z ) = 1 − 0.3 z −1 + 0.64 z −2 − 0.576 z −3


k3 = α 3 (3) = −0.576
B3 ( z ) = −0.576 + 0.64 z −1 − 0.9 z −2 + z −3
A ( z ) − k3 B3 ( z )
A2 ( z ) = 3 = 1 − 0.795 z −1 + 0.1819 z − 2
1 − k32
k 2 = α 2 ( z ) = 0.1819
B2 ( z ) = 0.1819
A ( z ) − k 2 B2 ( z )
B2 ( z ) = 2 = 1 − 0.6726 z −1
1 − k 22
k1 = α1 (1) = −0.6726

Ladder coefficient:-
C3 ( z ) = 1 + 3 z −1 + 3 z −2 + z −3
v3 = C3 (3) = 1
C2 ( z ) = C3 ( z ) − v3 B3 ( z )
= 1.576 + 2.36 z −1 + 3.9 z −2
C1 ( z ) = C2 ( z ) − v2 B2 ( z )
= 0.866 + 5.46 z −1
v1 = 5.46
C0 ( z ) = C1 ( z ) − v1 B1 ( z )
= 4.538
v0 = C0 (0) = 4.538
+ + +

k3=-0.576 k2=-0.1819 k1=-0.6782

k3= 0.576 k2=0.1819 k1=0.6782

+ z-1 + z-1 + z-1

v2=3.9 v1=5.46 v0=4.538


v3=1
+ + +

Fig: Lattice ladder structure.

Date: 2066/09/30

Analysis of sensitivity to quantization of filter coefficient:-

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 69


Downloaded from www.jayaram.com.np

Let us consider a general FIR filter with system ,


m

∑b z k
−k

H ( z) = k =0
N
………………….(1)
1 + ∑ ak z −k

k =1
With quantized coefficient coefficient the system function.
m

∑b z k
−k

H ( z) = k =0
N
1 + ∑ ak z −k
k =1

Where quantized coefficient {bk } can be released to the unquatized coefficients {ak } & {bk } by the
relation,
ak = ak + ∆ak , k = 1, 2 , 3 .................N ---------(3)

bk = bk + ∆bk , k = 1, 2 , 3 .................m --------- (4)


Where {∆ak } represents the quantization errors.

The denominator of H(z) may be expressed to the form ,


N
D ( z ) = 1 + ∑ ak z −k = Π kN=1 (1 − pk z −1 ) ………….(4)
k =1

Where, { pk } are the poles of H(z)


Similarly we can express the denominator of H (z ) as,
D ( z ) = Π kN=1 (1 − pk z −1 ) …………….(5)
Where, pk = pk + ∆pk , k = 1 , 2 .........N
And ∆pk is the error or perturtation resulting form the quantization of filter coefficients.
We shall relate the perturtation errors in the {ak } .
The perturtation error ∆pi can be expressed as,
N
δpi
∆pi = ∑ …………. (6)
k =1 δa k

δpi δ∆( z ) / δak


= ……………. (7)
δak (δD( z ) / δz )z = p i

The total perturtatio error,


N
piN −k
∆pi = −∑ N ∆qk ……………. (8)
k =1 Π l =1, l ≠ i ( pi − p r )

The error can be minimized by maximizing the lengths pi − pl . This can be accomplished by realizing
the high order filter with either single pole or double pole filter sections.

Downloaded from www.jayaram.com.np/ -70


Downloaded from www.jayaram.com.np

Limit cycle oscillation in recursive system:-


In the realization of digital filter either in digital hardware or software on a digital computer, the
quantization inherent in the finite precision arithmetic operation render the system non linear. In
recursive system the non linearities due to finite precision arithmetic operation often cause periodic
oscillation to occur in o/p even when the input sequence is zero or some non zero constant value. Such
oscillation in recursive system are called limit cycle and are directly attributable to round off errors in
multiplication and overflow error in addition.

Scaling to prevent overflow:-


In order to limit the amount of non linear distortion it is important to scale the input signal and unit
sample response between the input and any internal summing mode in the system such that overflow
becomes a rare event.
For fixed point arithmetic let us first consider the extra condition that overflow is not permitted at any
node of the system. Let yk (n) denote the response of the system at kth node when input sequence is x(n)
and unit sample response between the node and the input in hk (z ) .
∞ ∞
y k ( n) = ∑ h ( m) x ( n − m) ≤ ∑ h ( m ) x ( n − m )
m = −∞
k
m = −∞
k …………… (1)

Suppose that x(n) is upper bounded by Ak.


Then,

yk (n) ≤ Ak ∑ h ( m)
m = −∞
k for all n ………………(2)

Now, if the dynamic range of the computer is limited to (-1, 1) the condition,
yk (n) < 1 …………… (3)
Can be satisfied by requiring that the input x(n) can be such that,
1
Ax < ∞ ………………… (4)
∑ hk (m)
m = −∞

For all possible nodes in the system. The condition in (4) is both necessary and sufficient to prevent
coefficient.
For FIR filter, (4) become,
1
Ax < m −1 …………..(5)
∑ hk (m)
m =0
Another approach to scaling is to scale the input so that,
∞ 2 ∞

∑ yk ( n) ≤ C 2 ∑ x ( n) = C 2 E x ……….. (6)
2

n = −∞ n = −∞
From parsavals theorem,
π
1
∞ 2

∑ = ∫
2
y ( n ) H ( w) X ( w)
2π −π
k
n = −∞

1
≤ Ex ∫ H ( w)
2
dw ………….. (7)

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 71


Downloaded from www.jayaram.com.np

From (6) and (7)

π
1
C Ex ≤ Ex ∫π H ( w)
2 2
dw
2π −
π
1
C2 ≤ ∫π H (w)
2
dw ……………. (8)
2π −

Read the following topics your self:-


• Representation of Number.
 Fixed point representation.
 Floating point representation.
• Rounding and truncation error.

Chapter: 6

Design of IIR filter form analog filters:-

Impulse invariance method:


M
Ai
H a (s) = ∑
i =1 s − p i

Taking inverse laplace transform


M
ha (t ) = ∑ Ai e pit u a (t )
i =1
Put t = nT
M
ha (nT ) = ∑ Ai e pi nT u a (nT )
i =1


H ( z ) = ∑ h( n ) z − n
n =0

 M

= ∑ ∑ Ai e pi nT u a (nT )z −1
n = 0  i =1 
( )
M ∞
= ∑∑ Ai e piT z −1 u a (nT )
n

i =1 n = 0
M
1
= = ∑ Ai
i =1 1 − e piT z −1
Hence,
1 1

s − pi 1 − e piT z −1

Downloaded from www.jayaram.com.np/ -72


Downloaded from www.jayaram.com.np

s + 0 .1
Q. Convert the analog filter with the system function H a ( s ) = into a digital IIR by means
(s + 0.1)2 + 9
of impulse invariance method.
Solution:
s + 0 .1 s + 0 .1
H a (s) = =
(s + 0.1) + 9 (s + 0.1 + j3)(s + 0.1 − j 3)
2

k1 k1*
= +
( s + 0 .1 + j 3 ) ( s + 0 .1 − j 3 )
1 1
k1 = , k1* =
2 2
1 1
H a (s) = 2 + 2
( s + 0 .1 + j 3 ) ( s + 0 .1 − j 3 )
Then using impulse invariance method,
1 1
H ( z) = 2 2
(− 0.1− j 3 )T −1 + (− 0.1− j 3 )T −1
1+ e z 1− e z
1 − (e −0.1T
cos 3T )z −1
=
1 − (ze − 0.1T
cos 3T )z −1 + e −0.2T z −1

IIR filter design by bilinear transformation:


IIR filter deign using impulse invariance and approximation of derivative method have a
sever limitation in that they are approximate only for low pass filter and limited calls of bandpass filter.
In this we describe a mapping from s-plane to z-plane called bilinear transformation that overcomes
the limitation of other two design method describe previously.
Let us consider the analog filter with system function.
b
H ( s) = ………….. (1)
s+a
Y (s) b
=
X ( s) s + a
Or, sY ( s ) + aY ( s ) = bX ( s )
Taking inverse laplace transform, we get,
du (t )
+ ay (t ) = bx(t )
dt
Taking integration on both sides.
nT nT
du (t )
∫ dt dt + a ∫
m −T
y (t ) dt = ∫ x(t )dt
nT −T

Using Trapezoidal rule,


nT

∫ g (t )dt = T / 2[g (nT ) + g (nT − T )]


nT −T
Then,
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 73
Downloaded from www.jayaram.com.np

y (nT ) − y (nT − T ) + aT / 2[ y (nT ) + y (nT − T )] = bT / 2[x(nT ) + x(nT − T ) )]


Taking z-transform on both sides,
[ ] [ ]
Y ( z ) − z −1`Y ( z ) + aT / 2 Y ( z ) + z −1Y ( z ) = bT / 2 X ( z ) + z −1 X ( z )
Y ( z)
=
(
bT / 2 1 + z −1)
(
X ( z ) 1 − z −1 + aT / 2 1 + z −1 )
b
H ( z) =
2  1 − z −1 
 +a
T  1 + z −1 
2  1 − z −1 
Hence, s =  
T  1 + z −1 
It gives the mapping form s-plane to z-plane. This is called bilinear transformation.
To investigate the characteristics of bilinear transformation let,
z = re jw
s = σ + jΩ
2  z −1
Now , s =  
T  z + 1
 re jw − 1 
=  jw 
 re + 1 
2  r 2 − 1 + j 2r sin w 
=  2 
T  r + 2r cos w + 1 
Comparing with,
s = σ + jΩ
2 r 2 −1 
σ =  2 
T  r + 2r cos w + 1 
2 2r sin w 
Ω=  2 
T  r + 2r cos w + 1 

If r <1, then σ < 0 and if r >1, then, σ > 0 consequently, the LHP is S maps into inside a unit circle in
z-plane and RHP in s maps into outside a unit circle.
When, r = 1, σ = 0 ,
2  2 sin w 
Ω=  
T  2 + 2 cos w 
Ω = tan (w 2 )
2
T
 ΩT 
w = 2 tan −1  
 2 

Downloaded from www.jayaram.com.np/ -74


Downloaded from www.jayaram.com.np

-1
ω = 2tan (ΩT/2)

π/2

0 2 4 ΩT

− π /2

−π

Fig: mapping between frequency variables w and Ω resulting from bilinear transformation.

s + 0 .1
# Convert the analog filter with system H a ( s ) = into digital IIR filter by means of
(s + 0.1)2 + 16
bilinear transformation the digital is to have resonant frequency of wr = π / 2 .
Solution:
The resonant frequency of analog filter is Ω r = 4 . & resonant frequency of digital filter is
2
Ω r = tan wr / 2
T
2 π
4 = tan
T 4
1
∴T =
2
 1 − z −1   1 − z −1 
Now , s = 2 / T 
 
−1 
= 4 
−1 
 1 + z   1 + z 
 1 − z −1 
4  + 0 .1
−1 
Using bilinear, the system function of digital filter becomes H ( z ) = 1+ z 
2
  1 − z −1  
4  + 0.1 + 16
−1 
 1+ z  
0.125 + 0.006 z −1 − 0.118 z −2
=
1 + 0.0006 z −1 + 0.95 z −1
0.125 + 0.006 z −1 − 0.118 z −2
H ( z) =
1 + 0.95 z − 2

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 75


Downloaded from www.jayaram.com.np

Q. Design a single pole low pass digital filter factor with 3 dB bandwidth of 0.2 π using the bilinear
Ωc
transformation apply to the analog filter H ( s ) = . Where, Ω c is a 3dB bandwidth analog filter.
s + Ωc
Solution:
wc = 0.2π ,
For analog filter.
2
Ω c = tan wc / 2
T
= tan (0.1Ω( ))
2
T
0.65
=
T
Analog filter has system function
0.65 T
H ( s) =
s + 0 .6 T
2  1 − z −1 
Now, s =  
T  1 + z −1 
Then,
0.65 T
H ( z) =
2  1 − z −1  0.65T
 +
T  1 + z −1  T
0,65(1 + z −1 )
=
2.65 − 1.35 z −1
0.245(1 + z −1 )
H ( z) =
1 − 0.509 z −1

Matched z-transformation:-
Another method for converting analog filter into equivalent digital filter is to map the poles and zeroes
of H(s) directly into poles and zero in z-plane.
Suppose the transfer function of analog filter is expressed in the factored formed.
Π kM=1 ( s − z k )
H ( s) = N
Π k =1 ( s − p k )
Where, {z k } and {p k } are zeroes and poles of the analog filter.
Then system function for digital filter is
Π M (1 − e zk T z −1 )
H ( s ) = Nk =1
Π k =1 (1 − e pkT z −1 )
Thus each factor of the form (s-a) in H(s) is mapped into the factor (1 − e aT z −1 ) . This mapping is called
matched z-transformation.

Downloaded from www.jayaram.com.np/ -76


Downloaded from www.jayaram.com.np

s + 0 .1
# Convert the analog filter with system function H a ( s ) = into digital IIR filter by matched
( s + 0.1) 2 + 9
z-transformation method.

H a (s) =
s + 0 .1 (s + 0.1)
( )
=
( s + 0.1) − 3 j )
2 2
( s + 0.1 + 3 j )( s + 0.1 − j 3)
Using matched z-transformation method.

H ( z) =
(1 − e −0.1T
z −1 )
(1 − e ( −0.1−3 j )T
z −1
)(
1 − e ( −0.1+ j 3)T z −1 )
−1
(1 − e z ) 0.1T
= − 0.1T − j 3T
(1 − e e z −1 )(1 − e −0.1T e j 3T z −1 )

Date: 2066/10/7
Butter worth filter:
1
We have, Tn ( jw) =
2

1 + ε 2ω 2 n
When ε 2 = 1
1
Tn ( jw) =
2

1 + ω 2n
This function is known as Butterworth response. From this equation we observe some interesting
properties of Butterworth response,
(1) The Butterworth filter is an all –pole filter. It has zero at infinity (ω → ∞ ) .
(2) Tn ( j 0) = 1 for all n.
1
(3) Tn ( j1) = = 0.707 for all n. corresponding to 3 dB.
2
(4) For large ω , Tn ( jω ) exhibits n-pole roll-off.
Tn(j ω)

n=1
n=2
n=3
ω

Fig: Maximally flat response.

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 77


Downloaded from www.jayaram.com.np

Butterwoth filter:-
α (ω ) = −20 log T ( jw) dB
Low pass filter specifications,
Passband frequency = Ω p
Stopband frequency = Ω s
Passband attenuation = α p
Stopband attenuation = α s
Order of filter,
 100.1α s − 1 
log 0.1α p 
 10 − 1 
n=
2 log(Ω s Ω p )
3-dB cutoff frequency,
Ωp
Ωc =
( )
1
0.1α p
10 −1 2n

Chebyshev filter:
We have chebyshev magnitude response,
1
Tn ( jw) =
2
……………… (1)
1 + ε Cn (ω )
2 2

Cn (ω ) = cos(n cos −1 ω ) for ω ≤ 1


= cosh(n cosh −1 ω ) for ω > 1 ………………… (2)
With equation (2), the transfer function magnitude in (1) is determined for all values of ω . The function
is plotted for n = 6.

n odd begin here

n even begin here

Fig: Sixth order chebyshev TF magnitude

(1) Cn (0) = 0 for odd and Cn (0) = 1 for n even.


Tn ( j 0) = 1 for n odd.
1
Tn ( j 0) = for n even.
1+ ε 2

Downloaded from www.jayaram.com.np/ -78


Downloaded from www.jayaram.com.np

(2) At ω = 1 , Cn (1) = 1
1
Tn ( j 0) = for all n.
1+ ε 2
0.1α s
−1  10 −1 
cosh  0.1α p 
 10 − 1 
n=
cosh −1 (Ω s Ω p )
- equal ripple filter.
- High attenuation in stop band and steeper roll-off near the cut-off frequency.

* For Ω p = 1, Ω s = 3.33 and α p = 0.3dB α s = 22dB Which filter is best.


Solution,
For butterworth filter n = 5. for chebyshev filter n = 3.
Greater efficiency of chebyshev filter compared with Butterworth filter.

Frequency transformation:-
If we wish to design a high pass or bandpass or bandstop filter it is a simple method to take a low pass
prototype filter (butterwoth , chebyshev) perform a frequency transformation.
One possibility is to perform the frequency transformation in analog domain and then to convert
analog filter into corresponding digital filter by a mapping of s-plane into z-plane and alternative
approach is first to convert the analog low pass filter into digital low pass filter into a desired digital
filter by a digital transformation.
In general, these two approaches yields different results except for bilinear transformation in which
case the resulting filter designs are identical.

Frequency transformation in analog domain:-


Type of transformation Transformation Band edge freq. of new filter.
Low pass Ω Ω p'
S→ ps
Ω p'
High pass Ω p Ω p' Ω p'
S→
s
Band pass s 2 + Ω L Ωu Ω L , Ωu
S → Ωp
s (Ωu − Ω L )
Band stop s (Ω − Ω L ) Ω L , Ωu
S → Ωp 2 u
s + Ω L Ωu

Ωp
Q. Transform the single pole low pass butterworth filter with the system function H ( s ) = into
s + Ωp
band pass filter with upper and lower band edge frequency Ωu and Ω L respectively.

Solution:

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 79


Downloaded from www.jayaram.com.np

s 2 + Ω L Ωu
S = Ωp
s (Ωu − Ω L )
Ωp
H (s) =
s + Ω L Ωu
2
Ωp + Ωp
s (Ω u − Ω L )
s (Ωu − Ω L )
= 2
s + (Ωu − Ω L )s + Ω L Ωu

Frequency transformation in digital domain (spectra transform):


Conversion of prototype digital low pass filter into either band pass, band stop, high pass,
or another low pass digital filter.

Need of spectral transformation:-


Impulse invariance method and mapping of derivative are inappropriate to use in designing
high pass and many band pass filter due to a aliasing problem.
Consequently one could not employ an analog frequency transformation followed by
conversion of the result into digital domain by use of this two mapping instead it is much better to
perform the mapping analog low pass filter into digital low pass filter by either of these mapping and
then to perform frequency transformation in digital domain.
The problem of aliasing is avoided.

Type of transformation Transformation parameter


Low pass z −1 − a ω 'p = band edge frequency of new filter
z −1 →
1 − az −1  ω p − ω 'p[ 
sin  
 2 

a=
 ω p + ω 'p 
sin  
 2 

High pass z −1 + a  ω p + ω 'p[ 
z −1 → − cos  
1 + az −1
 2 

a=−
 ω p − ω p 
'

cos  

 2 

Band pass z −2 − a1 z −1 + a 2 ω L = Lower band edge frequency
z −1 → −
a 2 z − 2 − a1 z −1 + 1 ω u = Upper band edge frequency
2αk
a1 =
k +1
k −1
a2 =
k +1

Downloaded from www.jayaram.com.np/ -80


Downloaded from www.jayaram.com.np

 ω + ω L' 
cos  u 
 2 
a=−
 ω − ω L' 
cos  u 
 2 
 ω + ω L' 
k = cot  u . tan (ω p / 2 )
 2 
Band stop z −2 − a1 z −1 + a 2 2α 1− k
z −1 → a1 = − , a2 =
a 2 z − 2 − a1 z −1 + 1 k +1 1+ k
 ω + ω L 
'
cos  u 

 2 
a=
 ω − ω L 
'
cos  u 
 2 
 ω − ω L' 
k = tan  u . tan (ω p / 2 )
 2 

# Design a low pass butterworth filter to meet the following specifications:-


Passband gain = 0.89
Passband frequency = 30 hz.
Attenuation = 0.20
Stopband edge = 75 Hz.

Solution:
Ω p = 2π × 30 = 188.4 rad / sec
Ω s = 2π × 75 = 471.2 rad / sec
α p = −20 log(0.89) = 1.01dB
α s = −20 log(0.20) = 13,98dB

 100.1α s − 1 
log 0.1α p 
 10 − 1 
n= = 2.466 ≈ 3
2 log(Ω p / Ω s )
3 –dB cut off frequency,

Ω c = 0.1α pp = 23.55 rad / sec
( 10 )
−1
From table for N = 3, and Ω c =1, we have
1
H ( s) =
( )
s + 1) /( s 2 + s + 1

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 81


Downloaded from www.jayaram.com.np

This function is normalized for Ω c =1. However Ω c = 235.55, we need to denormalized H(s) by
Ω c =235.55 rad/sec.
1
=
H ( s)
s = s / ΩL (
(s / Ωc + 1) s / Ωc2 + s / Ωc + 1
2
)
Where, Ω c = 235.55 rad/sec.

# Design a low pass FIR filter with specification ω p = 0.2π , ωs = 0.65π , α p = 0.4dB , α s = 1.5dB . Use
bilinear transformation method.
Solution:
α p = tan (ω p / 2) = tan (0.2π / 2) = 0.649(T = 1) )
2 2
T T
Ω s = tan (ωs / 2 ) = 3.263
2
T
Order of filter,
 100.1α s − 1 
log 0.1α p 
 10 − 1 
n= = 1.783 ≈ 2
2 log(Ω p / Ω s )
3 –dB cut off frequency,
Ωp
Ωc = = 1.164
( )
1
0.1α p
10 −1 2n

From table for n = 2 and Ωc = 1 , we have


1
H ( s) = 2
s + 1.4145 + 1
Now denormalizing with Ω c = 1.164
1
H ( s) =
s = s / Ωc s / Ω + 1.41s / Ω c + 1
2 2

Ω 2c
=
s 2 + 1.414 sΩ c + Ω 2c

=
s + 1 . 414 s Ω c + Ω 2c
2

Now using bilinear transformation,


2  z −1  z −1
s=   = 2 , (T = 1)
T  z +1  z +1
1.354
H ( z) = 2
  z − 1    z − 1 
2 z + 1  + 1.6452 z + 1  + 1.3548
     

Downloaded from www.jayaram.com.np/ -82


Downloaded from www.jayaram.com.np

0 .2
Q. Convert a given H p ( s ) = of band edge frequency Ω p = 0.2 into a high pass filter H n ( s )
s + 0 .2
with pass band edge frequency Ω'p = 0.5
Solution:
Ω p Ω 'p 0.2 × 0.5 0.1
S→ = =
s s s
Ω Ω 
'
0 .2 0.25
H n ( s ) = H p  p p  = =
 s  0.1 / s + 0.2 0.25 + 0.1
s
H n (s) =
s + 0 .5
Q. Use bilinear transformation to obtained digital low pass filter to approximate H (s ) = 2
1
.
s + 2s + 1
Assume cut off frequency of 100 Hz and sampling frequency of 1 khz.
Solution:
2π × 100
ωc = (Normalizing with f s )
1000
= 0.2π rad/sec
Ω c = tan (ωc / 2 ) = 0.65 (T = 1)
2
T
Now, denormalizing H(s) with Ω c = 0.65 we get,
1
H L ( s) = H ( s) =
s = s / Ωc
 s 
2

  + 2 (s / 0.65) + 1
 0.65 
0.4225
= 2
s + 0.919 s + 0.4225
2  z −1  z −1
Now we substitute, s =   = 2  (T = 1)
T  z + 1  z + 1
0.4225
H ( s) = 2
  z − 1    z − 1 
2 z + 1  + 0.919 2 z + 1  + 0.4225
     
Q. Using bilinear transformation design a butterwoth filter which satisfy the following condition.
0.8 ≤ H (e jw ) ≤ 1 0 ≤ ω ≤ 0.25
H (e jw ) ≤ 0.2 0 .6 ≤ ω ≤ π
Solution:

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 83


Downloaded from www.jayaram.com.np

Tn(j ω)

Transition band
1

Stop band
0.8
Pass band
0.2
ω
ωs = 0.2π ωs = 0.6π

α p = −20 log(0.8) = 0.93dB


α s = −20 log(0.2) = 13.97 dB
ω p = 0.2π , ωs = 0.6π

tan (ω p / 2 ) = 0.65
2
αp =
T
α s = tan (ωs / 2) = 0.75
2
T
 100.1α s − 1 
log 0.1α p 
 10 − 1 
n=
2 log(Ω p / Ω s )
Ωp
Ωc = = 0.75
(10 )
1
0.1α p
−1
2n

From table, for n = 2 and Ωc = 1


1
H ( s) = 2
s + 1.414 s + 1
Now, denormalizing with Ω c = 0.75
1
H ( s) =
s = s / Ω c (s / 0.75) + 1.414( s / 0.75) + 1
2

0.56
= 2
s + 1.065 + 0.56
Using bilinear transformation,
2  z −1
s=   (r = 1) )
T  z +1
0.56
H ( s) = 2
  z − 1    z − 1 
2 z + 1  + 1.06 2 z + 1  + 0.56
     

Downloaded from www.jayaram.com.np/ -84


Downloaded from www.jayaram.com.np

0.245(1 + z −1 )
Q. Convert low pass butterworth filter with system function H ( s ) = into bandpass filter
1 − 0.509 z −1
with upper and lower cut off frequency ωu and ωc respectively. The low pass filter has 3 dB bandwidth
ω p = 0.2π . (ωu = 3π / 5, ωL = 2π / 5)
Solution:
 ω − ωL 
k = cot  u  tan(ω p / 2)
 2 
=1
ω + ωL 
cos  u
α=  2  = 0
ω − ωL 
cos  u
 2 
− 2α k
a1 = =0
k +1
k −1
a2 = =0
k +1
Now, z −1 → − z −2
TF becomes,
0.245(1 − z −2 )
H ( z) =
1 + 0.509 z − 2

Date: 2066/10/9

Chapter: 7

FIR filter design:-


FIR filter:- The digital filters can be classified either as finite duration unit impulse response (FIR)
filters or infinite duration unit impulse response (IIR) filters depending upon the form of unit impulse
response of the system. In FIR system the impulse response sequence is of finite duration.
For example the system with impulse response,
2 for n ≤ is FIR system
h( z ) = 
0 otherwise
FIR filters are generally implemented using structures with no feedback (i.e non recursive structure).
An FIR filters of length ‘N’ can be describe by the following difference equation.
y (n) = b0 x(n) + b1 x(n − 1) + ........bn −1 x(n − m + 1)
M −1
or , y (n) = ∑ b x(n − k )
k =0
k Where, bk is filter coefficient.

Symmetric and antisymmetric FIR filters:


The unit sample response of FIR filter is symmetric if it satisfies the following condition.
h(n) = h( M − 1 − n) , n = 0, 1, 2, ……… M-1.

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 85


Downloaded from www.jayaram.com.np

As in example let us consider the unit sample response given in figure for M = 6 sample.
h(n)

6 6
4
4

2 2

0 1 2 3 4 5 n

h(n) = h (5-n)
h(0) = h(5) =2
h(1) = h(4) = 4
h(2) = h(3) = 6

This is symmetric FIR filter.


The unit sample response of FIR filter is antisymmetic if it satisfies the following condition.
h(n) = -h (m-1-n) , n = 0, 1,……M-1
As an example let us consider the unit sample response shown in figure for M = 6 samples.
h(n)

6
4

0 1 2 3 4 5 n
-2

-4
-6

h(n) = -h(5-n)
h(0)=-h(5) =2
h(1)=-h(4)=4
h(2)=-h(3)=6
This is antisymmetric FIR filter.

Note: The condition for linearity phase FIR filters is h(n) = ± h( M − 1 − n)


 M −1 
− jω  
 2 
The phase of linear phase filter is e

# Show that the digital FIR filter with impulse response h(n).
h(n) = {2,4,6,6,4,2} is liner phase system. Is this antisymmetric?

Downloaded from www.jayaram.com.np/ -86


Downloaded from www.jayaram.com.np

Solution:
h ( n) = ± h( M − 1 − n)
Here, M = 6.
h(n) = ± h(5 − n)
Where,
h(0) = 2, h(1) = 4, h(2) = 6, h(3) = 6
h (4) = 4, h(5) = 2,
h(0) = h(5) = 2
h(1) = h(4) = 4
h(2) = h(3) = 6

Hence the system has linear phase and h(n) is not antisymmetric since h(n) = h(M-1-n)

# A digital filter has impulse response given by h(n) = { 1, 0, 0, 0, 0, 0, -1}. What is its system function.
Which class of linear phase filter does this system belong to ? Justify.
Solution:
System function,
6
H ( z ) = ∑ h( n ) z − n
n =0

= 1 − z −6
Linear phase FIR filter satisfies the conditions,
h ( n) = ± h( M − 1 − n)
Here, M= 7, h(n) = ± h(6-n)
h(0) = -h(6) = 1
h(1) = - h(5) = 0
h(2) = -h(4) = 0
h(3) = -h(3) = 0
Hence, this system belong to antisymmetric.

# A linear phase filter has a phase function e-j2w. What is the order of the filter.
Solution:
The phase of linear phase filter is given by,
 M −1 
− jω  
=e  2 

Comparing with e j 2 w
M −1
= 2⇒ M =5
2

Design of FIR filter using fourier series method:-


The frequency response Hd (ejw) of a system is periodic in 2π .We know that , periodic function can be
expressed as linear combination of complex exponentials. Therefore the desire frequency response of FIR filter
may be represented by fourier series.

H d (e jω ) = ∑ h ( n)e
n = −∞
d
− jω n
……………. (1)

Where, the fourier coefficients hd(n) are the impulse response sequence of the filter given by,
π
hd (n) = ∫ H d (e jω )e jωn dω …………… (2)
−π
Also, z-transform of the sequence is given by,
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 87
Downloaded from www.jayaram.com.np


H(z) = ∑ h (n) z
n = −∞
d
−n
…………… (3)

Equation (3) represents a non-causal digital filter of infinite duration to get an FIR filter transfer function the
series can be truncated by assigning.
 N −1
hd (n) for n ≤
h ( n) =  2 …………… (4)
0 otherwise
Then we have,
 N −1 
 
 2 
H ( z) = ∑ h( n ) z −1
……………..(5)
 N −1 
n =− 
 2 
 N −1 
 N − 1  −     N − 1  ( N −1 2 )
= h z
2 
+ h(1) z −1 + .........h(0) + ...... + h −   z
 2    2 
N −1

[ ]
2
H ( z ) = h ( 0) + ∑ h ( n ) z − n + h ( − n ) z n ………… (6)
n =1
For symmetrical impulse response symmetrical at n = 0.
h(-n) = h(n) ………… (7)
Therefore equation (6) becomes,
N −1

[ ]
2
H ( z ) = h(0) + ∑ h(n) z n + z − n ………….. (8)
n =1

 1
N− 
 2
This TF is not physically realizable. Realizability can be brought by multiplying the equation (8) by z .
N −1
Where, is delay in samples.
2
We have,
 1
− N −  H ( z )
H ' ( z) = z  2

N −1
 1  
[ ]
− N − 
 h ( 0) + h ( n ) z n + z − n  ………….. (9)
2
=z  2
 ∑
n =1

 

# Design ideal lowpass filter with following frequency response.


1 for − π / 2 ≤ ω ≤ π / 2
H d ( e jω ) = 
0 for π / 2 ≤ ω ≤ π
Determine the values of h(n) for N = 11. Find frequency response.
Solution:
1 π
hd (n) = ∫πH ( e j ωn ) e j ωn d ω

d

Downloaded from www.jayaram.com.np/ -88


Downloaded from www.jayaram.com.np

1 π /2
= ∫π 1.e jωn dω
2π − /2

Ηd(e ω)
j

−π/2 0 π/2

π
sin n
= 2 , −∞< n<∞

Now truncating hd(w) to 11 samples, we get,
 π
 sin n 2
h ( n) =  for n ≤ 5
 π n
0 otherwose

h(0) = ½
h(1) = h(-1) = 0.3183
h(2) = h(-2) = 0
h(3) = h(-3) = -0.106
h(4) = h(-4) = 0
h(5) = h(-5) = 0.06366

N −1

∑ h(n)[z ]
2
TF, H(z) = h(0) + n
+ z −n
n =1

[ ]
5
= 0 .5 + ∑ h ( n ) z n + z − n
n =1

(
= 0.5 + 0.3183( z1 + z −1 ) − 0.106( z 3 + z −3 ) + 0.06366 z 5 + z −5 )
TF, of realizable filter will be,
 1
− N + 
H ( z) = z
'  2
H ( z) = z −5 H ( z)
= 0.06366 − 0.106 z −2 + 0.318 z −4 + 0.5 z −5 + 0.318 z −6 − 0.106 z −8 + 0.06366 z −10
From above, the filter coefficients of causal filer are given as,
h(0) = h(10) = 0.06366
h(1) = h(9) = 0
h(2) = h(8) = -0.106
h(3) = h(7) = 0
h(4) = h(6) = 0.013183
h(5) = 0.5

Window techniques for designing FIR filters:


In this method we begin with the design frequency response specification Hd(w) and determine the
corresponding unit sample Hd(n) indeed Hd(n) is related to Hd(w) by the fourier transform relation.

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 89


Downloaded from www.jayaram.com.np


H d (ω ) = ∑ hd (n)e − jωn ………… (1)
n =0
Where,
1 π
hd (n) = ∫πH (ω )e jωn dω ………….. (2)

d

In general unit sample response H d (n) obtained form equation (2) is infinite in duration and must be truncked at
some point say at n = M-1, to yield FIR filter of length ‘L’. Truncation of H d (n) to a length M-1 is equivalent to
multiplying H d (n) rectangular window defined as,
1 n = 0,1,2..........M − 1
ω ( w) =  …………… (3)
0 otherwise
This unit sample response of FIR filter becomes ,
hd n = 0,1........M − 1
h(n) = hd (n)ω (n) =  ………. (4)
0 otherwise
It is instructive to consider the effect of window function on the desire frequency response H d (ω ) . The
multiplication of the window function ω (w) with hd (n) is equivalent to convolution of H d (ω ) with W (ω ) .
Where W (ω ) is the frequency domain representation of window function.
M −1
W (ω ) = ∑ W ( n) e
n =0
− jωn
…….. (5)

Thus the combination of Hd( ω ) with W (ω ) yields the frequency response of FIR filter.
1 π
H (ω ) = ∫πH (v)W (ω − v)dv

d

Fourier transform of rectangular window is ,


M −1
W (ω ) = ∑e
n =0
− j ωn

1 − e − jωM
=
1 − e − jω
sin (ωM 2)
= e − jω (M −1 / 2 )
sin (ω 2 )
The window function has a magnitude response,
sin(ωM 2
W (ω ) = −π ≤ω ≤π
sin (ω 2 )
And a piece wise linaer phase .
 M −1
Θ(ω ) = ω   When, sin(ωM / 2) ≥ 0
 2 
 M −1
= −ω   + π When, sin (ωM 2) <0
 2 

Date: 2066/10/11

Downloaded from www.jayaram.com.np/ -90


Downloaded from www.jayaram.com.np

Name of window Time domain sequence


ω (n), 0 ≤ n ≤ −1
Rectangular 1
Hamming 2πn
0.54-0.46cos
M −1
Hanning 1 2πn 
1 − cos 
2 M −1
Kaiser   M − 1 2  2
M − 1 
I 0 α   − n −  
  2   2  
  Where I is zero order Bessel function.
o
  M − 1 
I 0 α  
  2 

Rectangular
kaiser

1
Hamming
Hanning
0 M-1 n 0 M-1

Name of window Window function.


 M −1
ω (n), n ≤  
 2 
Hamming 2πn
0.54-0.46cos
M −1
Hanning 1 2πn 
1 + cos 
2 M −1

Gibbs phenomenon in FIR filter design:

M=31
Magnitude

M=61

0 frequency

Fig: frequency response of filter.

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 91


Downloaded from www.jayaram.com.np

We observe that relatively large oscillation or ripple occur near the band edge of filter the oscillation increases in
the frequency as N increases but they do not diminish in amplitude. Large oscillation are direct result of large side
lobes existing in frequency characteristics of W (ω ) of rectangular window. Fourier series representation of
H d (ω ) , multiplication of hd (ω ) with rectangular window is identical to trunked in fourier series representation
of desire filter characteristic H d (ω ) . The truncation of fourier series is known to introduce in frequency response
characteristic H (ω ) due to non uniform convergence of fourier series at discontinuity. The oscillatory behavior
near the band edge of the filer is called Gibbs phenomenon.
To alleviate the presence of large oscillation in both the pass band and stop band we should use a window
function that contains a taper and decay towards zero gradually instead of abruptly.

Design of FIR filter by Frequency sampling method:-


In the frequency sampling method of IIR filter design we specified the desire frequency response H d (ω ) at a
set of equally spaced frequency.

Namely ωk = (k + α ) ………. (1)
M
M −1
Where, k = 0, 1, …….. for M odd.
2
M
K = 0, 1 ………. − 1 for M even.
2
1
α = 0, or
2
And solve the unit sample respose n/w of the FIR filter from these equally spaced frequency specification. Now
the desire frequency response is
M −1
H(w) = ∑ h ( n) e
n=0
− jωn

Suppose that we specify the frequency response of the filter at the frequency given by equation (i).
 2π 
H (k + α ) = H  (k + α ) 
 M 

H (k + α ) = ∑ h(n)e − j 2π (k +α )n / M ……………… (2)

Where, k = 0, 1, ……. M-1


It is simple matter to invert (2) and express h(ω ) in terms of H ( k + α )
M −1
1
h ( n) =
M
∑ H (k + α )e
k =o
j 2π ( k + α ) n / M
……………. (3)

Where, n = 0, 1 …… M-1
This relationship in (3) allows us to compute the values of unit sample response h(n) from the specification of
frequency sample H ( k + α ) , k = 0, 1, …..M-1. Note that when α = 0 (2) reduces to discrete fourier transform
(DFT) of the sequence h(n) and the expression (3) reduces to IDFT.

# Design a low pass FIR filter with 11 coefficient for the following specification.
Passband frequency = 0.25 khz
Sampling frequency = 1 khz.
Use rectangular window, Hamming window and hanning window.
Solution:

Downloaded from www.jayaram.com.np/ -92


Downloaded from www.jayaram.com.np

2π × 0.5 π
f c = 0.25khz ωc = =
1 2
Η(ω)

−π −π/2 0 π/2 π

1 π / 2 j ωn
1.e dω
2π ∫−π / 2
hd (n) =
1 sin (nπ / 2 )
=
2 ( nπ / 2)

hd(0) = ½
hd(1) = hd(-1) = 0.3148
hd(2) = hd(-2) = 0
hd(3) = hd(-3) = -0.0162
hd(4) = hd(-4) = 0
hd(5) = hd(-5) = 0.06369

Rectangular window:-
w(n) = 1 −5≤ n ≤5
h(n) = hd(n) w(n)
h(0) = hd(0) w(n) = 0.5
h(1) = hd(-1) = 0.3184
h(2) = hd(-2) = 0
h(3) = hd(-3) = -0.1062
h(4) = hd(-4) = 0
h(5) = hd(-5) = 0.06369

Hamming window:
 2πn   M −1  M −1
Wham(n) = 0.54+0.46 cos   − ≤n≤ 
 M −1   2   2 
 2πn 
= 0.54+0.46cos   −5≤π ≤5
 10 
h(n) = hd (n)Wham (n)
Wham (0) = 1
Wham (1) = Wham (−1) = 0.9121
Wham (2) = Wham (−2) = 0.6828
Wham (3) = Wham (−3) = 0.3970
Wham (4) = Wham (−4) = 0.1679
Wham (5) = Wham (−5) = 0.08

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 93


Downloaded from www.jayaram.com.np

h(0) = hd (0)Wham (0) = 0.5


h(1) = h(−1) = 0.2904
h(2) = h(−2) = 0
h(3) = h(−3) = −0.04225
h ( 4) = h ( − 4) = 0
h(5) = h(−5) = 0.005095

H(z) …………..

Similarly Hanning window…………

Q. A low pass filter is required to be design with design frequency response which is expressed as follows, as we

e − j 2ω −π /2 ≤ ω ≤π /4
H d (e ) = 
0 for π / 4 ≤ ω ≤ π
Obtain the filter coefficient hd (n) if the window function is defined as,
1 0 ≤ n ≤ 4
W ( n) = 
0 otherwise

Q. Design a low pass filter having desire frequency response given as,
jω e − j 3ω 0 ≤ω ≤π /2
H d (e ) = 
0 π / ≤ω ≤π
Obtain filter coefficient h(n) for M = 7 using frequency sampling method.
Solution:

Wk = (k + α )
M
α =0
1 6
h(n) = ∑ e − j 32πk / 7 e j 2πkn / 7 n = 0, 1, ……. 6.
7 k =0
1 6
h(0) = ∑ e − j 6πk / 7 =
7 k =0

# Remez exchange algorithm (prokish book बाट आफै प ने)

Reference for chapter (8)


- TMS 320 Texas instrument (Sanjaya sharma)
- Bit serial arithmetic (Digital logic book)
- Serial adder.
- Distributed arithmetic and pipelined implementation.

Downloaded from www.jayaram.com.np/ -94

You might also like