Digital Signal Processing (DSP)
Digital Signal Processing (DSP)
np
Semester: II
Examination Scheme
Internal Assessment
Theory Practical*
20
25
Final
Theory
Practical**
80
-
Total
125
* Continuous
** Duration: 3 hours
Course objectives: To provide
1.
Discrete signals
5
1.1
Discrete signals unit impulse, unit step, ex ponential 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.
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 par tial fraction expansion.
3.4
Z transform properties delay advance, convol ution, Parsevals 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.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.
8.
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.
A/D
Converter
Digital
signal
processing
Digital
input signal
D/A
Converter
Analog
output signal
Digital
output signal
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
n=1
n -2 -1 1 2
= (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
* Exponential Sequence:n
The exponential signal is a sequence of the form x(n) = a 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
n
a< 1
a > 1,
E.g , a = 2
n
i.e (2) = 1,2, 4, 8 (Exponential
increasing) (See figure (ii))
-1 < a <0
Eg.: -1/2
n
i.e (-1/2) = 1, -1/2, , -1/8
(See fig (iii) )
a <-1
E.g a = -2
n
(-2) = 1, -2, 4, 8 (See figure(iv) )
Exponential sequence:When the parameter a is complex values , it can be expressed as:
j
a = re
Where r and are new parameters. Hence, we can express x(n) as:
n j
X(n) = r e
n
= r (cos n + jsin n)
Since, x(n) is now complex values, it can represented graphically by plotting the real part,
n
xe(n) = r cos 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) .
----- 2 -1
----- 0 0
0 1 2 3 4
0 1 4 1 0
3) Sequence representation:
X(n) = { 0 , 0, 1, 4, 1, 0, .} Infinite durat
ion .
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 x2 (n) a1 y1 (n) + a2 y2 (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
Since,
y3 (n) y4 (n) . The system is nonlinear.
2
y1 (n) = x1 (n)
2
y2 (n) = x2 (n)
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.bhawesh.com.np/ -8
y1 (n) = x (n n0 )
y1 (n) = y(n n0 )
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
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
x(1)(n-1)
-1
-2
1
0
-1
We can write,
X(n) = +x(-1)
x(k ) (n k )
k =
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,
..........(ii)
k =
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 =
3
2
1
k
-2
k
3
-1
x(k )h(k )
k =0
= x(0)h(0) + x(1)h(1)
=2+2=4
2
For n = -1
y(-1) =
x(k )h(1 k )
k =
2
1
1
1
n(-1-k)
-3
-2
-1
x(k)n(-1-k)
-2
For n = -2
Y(-2) =
x(k )h(2 k )
k =
x(k )h(1 k )
Y(1) =
= 1+4+3 = 8
k =
3
x(k)(1-k)
-1
0
-1
For n = 2
Y(n) =
x(k )h(2 k )
= -1+2+6+1 = 8
k =
k
1
-1
k
1
2
3
x(k)h(1-k)
-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:
n
h(n) = a 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 =
a
a2
1
1
a
a2
h(-k)
a3
-3
-2
-1
For n =1:
y(1) =
1
a
a
a2
x(k)h(1-k)
h(1-k)
a2
-101
k
0
For n = 2:
y(2) =
x(n)h(2 n) = 1+a+a
S = a(1 r
x(k)h(2-k)
n
= 1a
1a
1 r
For n > 0
2
y(n) = 1+a + .+a
k =
a2
For n < 0
y(n) = 0
y( ) = lim n y(n) = lim n 1 a
1a
1
= 1a
n+1
2
1+a+a
1+a
k
h2(n)
h1(n)*h2(n)
y(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.
n
h1(n) = (1/2) u(n)
n
h2(n) = (1/u) u(n)
Solution:The overall impulse response is
h(u) = h1(n)* h2(n)
h1 (k )h2 (n k )
k =
1/2
1/4
h1(k)
1/4
h2(k)
1/6
h(n-k)
1
1/4
1/4
n>0
1/6
1/6
k
= (1/ 2)
(1/ 4)nk
k =0
= (1/4)
= (1/4)
n
n
k =0
(2)k
2
n
= (1/4)
n+1
2 1
n n+1
= (1/4) (2 -1)
n
= (1/2) [ 2 (1/2) ] , n
Note:- If we have L LTI system is cascade with im pulse responses h1(n) and h2(n) .h L(n) ,
the
impulse response of equivalent LTI system is
h(n) = h1(n) * h2(n)*h3(n) ..*h
L(n)
Discrete system response to discrete input:jwn
For a discrete-time system, consider as input sequence x(n) = e , for - <n<
system with impulse response h(n) is,
y(n) =
h(k ) x(n k )
k =
h(k )e jw( nk )
k =
= e jwn
h(k )e
If we define,
jw
H|e | =
jwk
k =
h(k )e jwk
k =
jw jwn
H|e | describes the change in complex amplitude of complex exponential as a function of frequency
jw
w. H(e ) is called frequency response of the system.
jw
In general H(e ) is complex and can be expressed in terms of its real and imaginary parts
jw
jw
jw
as: H (e ) = HR (e )+j H I (e )
Or , In terms of magnitude and phase as,
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 15
jw
j H(ejw)
Let,
x(n) = Acos(won +)
= A/2 ejwon.ej +A/2 e-jwon. e-j The
j jwon
jw
is,
j jwon
H(e
jwo
)
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.
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.
n
h(n) = a u(n) is stable.
Solution,
Sn = h(k ) <
k =
h (k ) = ak
k =0
k =0
= 1 + a + a + a + .............
1
Provided that a < 1
=
aa
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.
n
h(n) = a
n0
=b
S =
n
n < 0 is stable.
h(k ) = bk + ak
k =
k =
k =0
The first sum coverage for a < 1 . The second sum can be manipulated as,
k =
k =1
1
k
b
= 1 + 1 + 13 + ..............
b2 b
b
=1 1+
b
1 + 1 + ..........
b 2 b3
= 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,
|x(n)| < Mn < for all n.
BIBO =
Bounded input
bounded output.
x(n)
n
With r >1, the multiplying factor r 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;
[g (t) + 2g (t) cos ws t + 2g (t) cos 2ws t + 2g(t) cos 3ws t + ......]
Ts
Using modulation property,
2g(t) coswst
G (w) =
=
1
T
(F.T) G(w-ws)+G(w+ws)
Ts
G(w nws )
s n=
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.bhawesh.com.np/ -18
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
xa (t) = A cos(2f 0 t + )
With sampling rate f s =
x(n) = A cos(2ft + )
Where, f =
f0
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
jwn
.(i)
n=
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
= x(n)e
N n=
Summing in equation (2) can be subdivided into infinite number of summations where each
sum contains N terms Thus,
X
2k
= ...... + x(n)e
N 1
j 2kn / N
n=0
2 N 1
j 2kn / N
+ x(n)e
n=N
3 N 1
j 2kn / N
+ x(n)e
+ .......
n=2 N
lN +N 1
x(n)e j 2kn / N
l =
n=ln
If we change the index in the inner summation form n to n-ln and integrating the order of summation we
obtained,
2k N 1 N 1
j 2kn / N
X
N
The signal
x(n nl) e
..(3)
n=0 n=0
Xp(n) =
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
xp(n)
N<L
n
In summary a final duration sequence x(n) of a length L as fourier transform X (w) = x(n)e
L1
jwn
n=0
= x(n)e
. (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)= ak e j 2kn / N
n = 0, 1, N-1 .(7)
k =0
k = 0, 1, ..N-1 .(9)
Therefore ,
N 1
xp(n) = 1/N X
2k
j 2kn / N
n = 0, 1, ..N-1 .(10)
N
This relation allows us to recover the sequence x(n) from frequency sample.
k =0
N 1
x(n) = 1/N X (k )e
j 2kn / N
n = 0, 1 .N-1 .(11)
k =0
, k = 0, 1 .N-1 ..(1)
1 N 1
x(n) = X (k )wNkn
n = 0, 1, .N-1 ..(2)
k =0
-j2 /N
Where WN = e
.(3)
Let us define N-point vector xN of signal sequence x(n) , n = 0, 1, N-1 and N-p oint vector Xn of
frequency samples and N*n matrix WN as
x(0)
x N=
X (0)
XN =
x(1)
X (1)
WN =
WN
2
. WN N
1W
x(n 1)
X (N
1)
N 1
WN
WN
WN
WN2( N 1)
X (k ) = x(n)e
j 2kn / N
n=0
3
X (k ) = x(n)e
jkn / 2
n=0
3
n=0
3
X (1) = x(n)e
j n / 2
n=0
= x(0) + x(1)e
j / 2
+ x(2)e j + x(3)e j 3 / 2 = 6
X(2) = -2
X(3) = -2.4
By matrix method,
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 23
1
1
j
X (0)
xN =
X4 =
2
(1)
(2)
3
X (3)
X4 =W4 * x4
1
1
1
1
0
1 j
1 j
1
=1
*
2
1 1
1
3
1j
1 j
0+1+2+3
6
0
j2+3j =
2+
1 + 2
0+j23j
2j
2j
x4 =( W4 /4) X4
1
1
11
1 j 1j
0
X4 =
W4
x4 =( W4 /4) X4
1
1
1
1 j 1
= 1
1 1
1
j
1 j
1j
160
j0
1 4
j 0
56
64
16
60
14
=
56
60 + 4
14
64
16
Properties of DFT:The notation used to denote N-point DFT pair x(n) and X(k) as x(n)
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.
DFT X(k)
Proof:
x(n+N) = 1/N X (k )e
N 1
= 1/N X (k )e
j 2k ( n+ N ) / N
j 2kn / N
j 2k
K =0
= x(n)
N 1
X(k+N) = n(k )e
j 2k ( k + N ) / N
n=0
N 1
X (k )e j 2kn / N e j 2n
n=0
=X(k)
2) Linearity: If x1(n)DFTX1(k)
and
x2(n)DFTX2(k)
Then, for any real or complex valued constants a1 and a2
x(n) = a1x1(n) +a2x2(n)DFTX(k) = a1X1(k)+a2X2(k)
Proof:N 1
= a1 x1 (n)e
j 2kn / N
n=0
N 1
j 2kn / N
n=0
+ a2 x2 (n) e j 2kn / N
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
x p (n) = x(n lN )
l =
-4 -3 -2 -1 0
3 4
xp(n-2)
-6
-5
-4
-3
-2
-1
4
x(n)
2
1
x(2)=3
x(n)
x(1)=4
x(0)=0
x(2)=1
x(3)=4
x(n)
x(0)=3
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
0 <= n<=N-1 ..(1)
x(n) = xR(n)+jxI(n)
X(k) = X R(k)+jXI(k)
0<=k<=N-1 ..(2)
N 1
X(k) = = x(n)e j 2n / N
k = 0, 1, N-1
n=0
N 1
n=0
N 1
N 1
n=0
n=0
( xR (n) cos 2kn / N + xI (n) sin 2kn / N ) j(xR (n) sin 2kn / N xI (n) cos 2kn / N )
= XR(k)+jXI(k)
N 1
Similary,
X(N-k) = x(n)e
j 2 ( N k ) n / N
n=0
N 1
= x(n)e j 2n / N e j 2n
n=0
=X(-k) = X*(k)
2) Real and even sequence:x(n) = x(N-n)
Than, XI(0) = , DFT reduces to
N 1
0<= k<=N-1
n=0
IDFT Reduces to ,
N 1
0<=n<=N-1
k =0
, 0 <=k<= N-1
n=0
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) = x1 (n)e
j 2kn / N
k = 0, 1, N-1 ..(1)
n=0
N 1
X2(k) = x2 (n)e
j 2kn / N
k = 0, 1, .N-1 .(2)
n=0
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
= 1/N
N 1
k =0 n=0
N 1
N 1
N 1
l =0
e j 2kn / N
l =0
k =0
Now,
N 1
a k
k =0
=N
a=1
N
= 1a , a1
aa
p is int eger
k =0
= 0 , otherwise
Hence,
N 1
x3(m) =
m = 0, 1, ..N-1
n=0
N 1
N = 4,
3
x1(1)=1
x1(2)=2
x2(1)=2
x (n)
x (0)=2
x (n)
x1(3)=1
x2(0)=1
x2(3)=4
4
4
x1(n)x2((-n))4=14
6
x2(-n)
2
2
3
1
1
x1(n)x2((1-n))4=16
8
x2((1-n))4
33
3
2
x2((2-n))4
4
3
3
3
x1(n)x2((3-n))4=16
4
x2((3-n))4
1
1
1
X1 =
1
X2 =
1
j
1
*
0
2
=
2
1 1 1
1
0
1 j
j
1 1
11 10
j
1j2 2 2 j
1
60
X3 =
1
1j
1 1 1 3
1 j 4
2
22j
0
IDFT:
*
x3 = (W4 /4 )* X3
1
1
160
j0
1 1
1 4
1 j 0
1j
Parsevals theorem:For complex valued sequence x(n) and
y(n) x(n) DFT X(k)
y(n) DFT Y(k)
Then,
N 1
N 1
x(n) y * (n) = 1 X (k )Y * (k )
N
n=0
k =0
Proof:N 1
n=0
r xy (l) =
1 N 1
N
Rxy (k )e j 2kl / N
k =0
N 1
r xy (l) = 1 X (k )Y * (k )e j 2kl / N
k =0
N 1
r xy (0) = 1 X (k )Y * (k )
N
k =0
N 1
x(n) y * (n) =
n=0
x (n)
n=0
1
N
N 1
X (k ) 2
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
n=0
j 2k / N
The complex multiplication in direct computation of DFT is N and by FFT complex multiplication in
N
N/2 log2 . 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.
N 1
If x(n) be the discrete time sequence then its DFT is given by X (k ) = x(n)wN
kn
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
X (k ) =
N 1
+ x(n)wN
kn
x(n)wN
kn
n even
n odd
N / 21
N / 21
m=0
m=0
But
WN2 = (e j 2 n / 2 ) = e j 2 /( n / 2) = WN / 2
2
N / 21
X (k ) = f1 (m)wN
N / 21
km
/2
m=0
X(k) = F1(k) +W
f 2 (m)wNkm/ 2
k
WN
m=0
k
n
F (k )
2
Where F1(k) and F2(k) are N/2 point DFT of sequences f1(m) and f2(m) respectively.
x(0)
F1(0)
X(0)
x(2)
F1(1)
X(1)
F1(2)
X(2)
F1(3)
X(3)
x(4)
N/2 point
DFT
x(6)
F1(0)
x(1)
x(3)
x(5)
x(7)
N/2 point
DFT
X(4)
F1(1)
X(5)
F1(2)
X(6)
F1(3)
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/41 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
/ 2 v12
(k )
x(0)
W
x(1)
W
W
W
W
W
x(5)
W
X(2)
2
N
6
W
X(3)
X(4)
X(1)
X(0)
4
N
x(4)
0
N
x(3)
X(5)
x(6)
X(6)
W0
W4
W6
W4
W6
W7
x(7)
X(7)
N
Xm+1(p)
Xm+1(q)
Xm(q)
Xm(p)
Xm+1(p)
Xm(q)
Xm+1(q)
r
WN -1
WNr+N/2
X(0)
x(1)
X(1)
x(2)
X(2)
0
N
x(3)
W0
x(4)
-1
X(3)
X(4)
0
N
x(5)
-1
-1
x(6)
2
N
X(5)
X(6)
0
N
x(7 )
X(7)
-1
W3
N
W0
N
Date:2066/08/11
Q. Compute 4-point DFT for the sequence x(n) = { 14, 16,14, 16} using FFT algorithm.
28
x(0)=14
x(2)=14
28
X(0)=60
X(1)=0
WN =1
32
x(1)=16
X(2)=-4
x(3)=16
WN
X(3)=0
WN
=1
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)
W 0
X(1)=0
x(1)
x(3)
-1
-1
W 0 =1
X(2)=-4
W1
X(3)=0
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
..(1)
n=
X ( z) = x(n) z
n =
-1
-2
-3
-5
X2(z) = X ( z) = x2 (n)z
= 2z + 4z 2 + 5 + 7z 1 + z 3
n=
X3(n) =
x3 (n) z n
n=
= (n)z n n=0
=1
ROC: Entire z-plane.
X (z) = x4 (n)z
X4(z) =
= 2z + 4z
n=
[ (n k )z n ]nz = k
k
n =
= (n k )z n n=k
= z k
ROC: Entire z plane except z = 0.
ROC relationship to casusality:Downloaded from www.bhawesh.com.np/ -36
= x(n)r
X(z)|z= rej = X ( z)
j n
.(2)
n=
X
(z) <
X ( z) =
x(n)r n e jn
n=
x(n)r n ..(3)
n=
The problem of finding ROC for x(z) is equivalent to determining the range of values of r for which the
-n
sequence x(n) r is absolutely sum able.
X ( z) x(n)r n + x(n)r n
n=
X ( z)
n=0
x(n)r
n +
n=1
n=0
x(n)
.(4)
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
n
product sequence x(-n) r , 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 2
nd
term in equation (4) converges there must exists values of r large enough such that
product sequence
x(n)
, .. hence ROC for second sum in equation (4) consi sts of all points outside a r
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.
n
n
X(n) = u(n) = , n => 0
=0 , n<0
Solution:
Downloaded from www.bhawesh.com.np/ -38
X(z) =
x(n)z n
n =
n z n
n=
= (z
= 1 + (z
) + (z
+ ......
n=
1
for z
= 1
<1
1 z 1
ROC: |z| > | |
Im(z)
x(n)
r
||
Re(z)
X(z) =
x(n)z n
n =
( n )z
n=
1
= ( l )z l
l =1
= ( l z )l = ( 1 z) + ( 1 z) 2 + .........
l =1
==
1 z
1
1
1
1 z
for z < 1
z
ROC : z <| |
x(n)
z-plane
|r|
-3 -2 -1
Re(z)
X(z) =
x(n)z n
n=
1
= b n z
n=
= (b
l =1
+ n z n
n=0
z) + (z
l
n=0
-1
-1
The first power series converges if |b z| < 1 i.e |z| < |b| and second power series converges if | z | < 1
i,e |z| > | |
Case I: |b| < | |
Im(z)
z-plane
Re(z)
z-plane
||
Re(z)
1
1
1
X ( z) = 1 bz + 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 =
= a1
x1 (n)z
+ a2
n=
x2 (n) z n
n=
= a1X1(z)+a1X2(z)
# Determine z-transform and ROC of the signal
n
n
x[n] = [ 3(2 )-4(3 )]
Proof:
n
Let, x1(n) = 2 u(n)
n
x2(n) = 3 u(n)
Then,
x(n) = 3x1(n) -4x2(n)
Accordign to linearity property.
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 41
X(z) = 3X1(z)-4X2(z)
1
ROC: |z| > 2
1
1 2z
1
X2(z) = Z {x2(n)} =
ROC: |z| > 3
1
1 3z
X1(z) = Z {x1(n)} =
Now
3
4
1
X(z) = 1 2z
1 3z
|z| > 3
jw n
X(z) =
Z{e
jw n
0 u(n)
u(n) +
2
2
Using linearity property.
jw0n
u(n)} +
jw0n
Z{e
u(n)}
2
1
1
1
Z{e 0 u(n)} = 1 e jw n z 1 = 1 2z
ROC: |z| > 1
jw0n
1
1
Z{e
u(n)} =
=
ROC: |z| > 1
1 e jw n z 1
1 2z 1
1
1
X(z) = 1 .
+1 .
jw n 1
2 1 e z
2 1 e jw0n z 1
1 z 1Cosw
0
= 1 2z 1 cos w + z 2 ROC: |z| > 1
jw n
jw n jw n
(b) x(n) = 1 (e 0 e 0 )u(n)
2j
1 z 1 Sinw
X(z) =
1 2z
x(n-k)z x(n k )z
n=
Put n-k = m
Downloaded from www.bhawesh.com.np/ -42
x(m)z ( m+k )
m=
=z
x(m) z ( m)
m=
-k
= z 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
X(z) = 1.z n
n=0
= 1 + z 1 + z 2 + z 3 ......... + z ( N 1) = N if z = 1
1zN
=
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 zN
1
1 z 1 1 z
1zN
=
=
1 z 1
Next method
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 43
N-1 N
Date:2066/08/25
(3) Scaling in z-domain:X(z) ROC, r1 <|z| <r2
If x(n) z
-1
-1
Then a x(n) z X(a z) ROC: |a|r1 <|z| <|a|r2 For
any real constant a real or complex.
n=
x(n)(a
z) n = X (a 1 z)
n=
-1
1z
1 2z
Then,
n
X(n) = a x1(n)
X(z) = Z[a
x1 (n)] = X 1 (a
z) =
cos w
0
cos w + z 1
1 az
cos w
0
1 2az
cos w0 + a 2 z 1
Proof:
Z[{x(n)}] = x(n)z
n=
Put , l = -n
= x(l) z
l =
= x(l)( z
l =
-1
= X(z )
-1
Differentiation in z- transform
If x(n)
X(z)
Then n x(n) z -z
Proof:-
dX (z)
X ( z) = x(n) z
dz
n=
By differentiation,
dX (z)
= x(n)(n)z
dz
n1
n=
= z
= z
{nx(n)z n
n =
Z{nx(n) }
Z{nx(n)} = z
dX ( z)
dz
x(n) = n x1(n)
X(z) = Z{n x1(n)} = dX 1 (z)
dz
1
=z
az 2
1 2
(1 az )
az 1
1
(1 az )
. az 2
(1 + az 1 )
dz
z dX (z) = az 1
.
1
(1 + az )
1
dz
= az 1
(a)z
Taking inverse z-transform.
n-1
n x(n) = a(-a) u(n-1)
n-1 n
x(n) = (-1) . a /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) = x1 (k )x2 (n k )
k =
X (n) = x(n)z
n=
X (n) =
x1 (k )x2 (n k )zn
n = k =
X (n) = x1 (k ) x2 (n k )z
k =
n=
X (n) = x1 (k ) z
k =
x2 (z)
X (n) = X 2 ( z) x1 (k ) z
k =
= X2(z)X1(z)
# Compute convolution x(n) of the
signals X(n) = { 1,-2, 1}
10n5
x2 (n) =
0
otherwise
Inverse z-transform.
X ( z) = x(k ) z
.(i)
k =
n-1
Multplyign both sides of (i) by z and integrate both sides over a closed contour within the ROC
of X(z) which enclosed the origin .
Now,
X (z) z
n1
dz = x(k )z
n1k
dz.........(2)
C k =
X ( z)z
n1
dz = x(k ) z
n1k
k =
dz.........(3)
C
1
z
2j C
Then,
X ( z) z
x(n) =
dz =
n1k
1
0
k=n
Figure:
kn
dz = 2jx(n)
n1
1
n1
C X (z)z dz ..(4)
2j
7) Multiplication of two sequences:- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 47
2j C
z
X (u) X
dv
1
2v
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 ( z) =
x(n) z n
n=
x1 (n) x2 (n)z n
n=
Where,
x1 (n) =
1
2j C
x1 (n) =
X 1 (v)v
2j C
1
X ( z) =
X
2j
n1
(v) X
z
*
dv
* 1
dv
v
(v)
z
x
n=
(n)
2
v 1dv
8) Parsevals theorem:If x1(n) and x2(n) are complex valued sequence, then,
x1 (n) x2 * (n) =
X 1 (v) X 2 (1/ v )v dv
2 j C
n=
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
X ( z) =
1+
1 0.5z 1
0.5z
When
(a) ROC: |z| > 1
(b) ROC : |z| <0.5
Solution:
(a) ROC: |z| >1 , x(n) is causal signal.
-1
-2
1-0.5z
-1
+0.5z ) 1
(1-0.5z
-1
-0.25z
-2
-2
1-0.5z +0.5z
-1
0.5z
-2
-0.5z
-1
-2
-3
-3
-2
-3
-0.25z -0.5z
-4
-4
0.375z +0.125z
-4
-3
-5
-0.0625z
-1
-2
-5
+1.8175z
-3
0.5z -0.5z
-1
+1) 1
2
1-z+2z
34
(2 z + 2z - 2z
z - 2z
z - z + 2z
2
z - 2z
- z + z - 2z
3
-3z + 2z
-3z + 3z - 6z
4
-z + 6z
X (z) = 2z + 2z 2z 6z ..
6z 5 2z 4 + 2z 3 + 2z 2 + 0 + 0
= .
x(n) = {........ 6,2, 2 , 0, 0}
X(z) =
1
1 z 1 1 z
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 49
y(n) = lim z
1 (z-1)Y(z)
2
z
(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=
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
k =1
k =0
Y (z) = ak z
k =1
N
Y (z) + bk z k X (z)
k =0
Y (z) 1 + ak z k =
bk z k X (z)
k =1
k =0
M
H ( z) = Y (z) =
X ( z)
bk z k
k =0
N
1 + ak z
.(2)
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:
1. if ak = 0 , for 1 <= k<= N . Equation (2) reduces to H ( z) = bk z
k =0
system has finite duration impulse response and it is called FIR system or moving
average (MA) system.
(1 1 / 2 z )Y ( z) = 2 X ( z)
2
H ( z) = Y ( z) =
1
X (z) 1 1/ 2 z
By inversion,
n
h(n) = 2 (1/2) u(n)
Date: 2066/09/16
Response of pole zero system with Non-zero initial condition:The difference equation,
N
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
Y (z) = ak z
+
Y (z) + y(n) z
+
k =1
+ bk z k X + ( z) ..(2)
n=1
k =0
1 + ak z k
k =1
k =1
= H ( z) X (z) + N o (z)
..(3)
A(z)
Where,
N
N 0 ( z) = ak z
k =1
y(n)z n
.(4)
n=1
From (3) the o/p of the system can be sub divided into two parts. The 1 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
response of the system which is defined in z-domain as Yzi ( z) =
N 0 ( z)
(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.9z 1 Y + ( z) + y(1) z 0.8z 2 Y + ( z) + y(1) z + y(2) z 2 + X + ( z)
For y(-1) = y(-2) = 0
1 +
2 +
( z 0.9e
j / 3
)( z 0.9e
k1
= 1.098e j 5.53
k*
= 1.098e j 5.53
j / 3
)(z 1) = ( z 0.9e
j / 3
) + ( z 0.9e
j / 3
) + z 1
, k2 = 1.1
j 5.53
1.1
1.098e j 5.53 + 1.098e
+
j / 3 1
1
j / 3 1
(1 0.9e
z ) (1 0.9e
z )1z
By inversion,
Yzs (z) =
yzs (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)
N o (z) = ak z
k =1
y(n) z n
n= 1
N o (z) = ak z
= a1 z
y(n)z
n=1
y(1) z + a2 z
( y(1) z + y(2) z )
-1
0.09 0.81z 1
1
+ 0.81z 2
1 0.9z
Y (z) = Yzs ( z) + Yzi ( z)
= 1.099 +0.568 + j0.445 +0.568 j0.445
1 z 1 1 0.9e j / 3 z 1 1 0.9e j / 3 z 1
zi
( z) =
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
2 = 2
1 z 1 z
z z 1
Y + (z)
z
5
1+
=
= 25
2
z
z z 1
Y + (z) =
1
1+
1 5
2 5
1
1 5
2
+
Y
(z)
1+ 5
2 5
+
1
1 + 5
2
5
.
2 5
1
1 5
1 51 5
u(n)
Y (z) = z
y(n-1) + x(n)
-1 < < 1
Y ( z) + y(1) + X (z)
1
+
X ( z) = Z [u(n)]=
1 z 1
1
Or , Y + (z) = z 1Y + ( z) + + 1 z 1
1
+
1
Or, Y (z)(1 z ) = + 1 1
z
+
Y ( z) =
+1
1
1
1
(1 z )(1 z )
1 z
1
1
Y + (z) =
+
1
1
1 z
1 1z
1
Taking inversion,
1
1 n
n
y(n) = u(n).1
n+1
=
1
u(n)
1
1 z
1
1
u(n)
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
x(n) = (n) 1 (n 1)
3
Solution:
Taking z-transform in both sides.
5
1 2
1
Y (z) = 6 z Y ( z) 6 z Y (z) + X (z)
1
X ( z) = 1 1 z 1
3
5 z 1 1 z 2Y ( z) +
Y (z) =
6
6
5
1 2
1
= 1
1 1
z
3
Y ( z) = 1
1
3
Y (z) =
5z
1
3
+1
6
6
1
Y (z) =
1 1 z 1
2
Taking inverse z-transform,
= 1 y(n)
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.
condition implies that H(z) must contain the unit circle within its
ROC. Indeed, Since
H ( z) = h(n) z
H ( z) h(n)z
n=
n=
H ( z) h(n)
n=
Hence if the system is BIBO, the unit circle is contained in the ROC of H(z).
Solution:1
2
H ( z) = 1 1 z 1 + 1 3z 1
2
The system has poles at z = and z = 3.
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 55
(b) Since the system is causal , its ROC is |z| >3. In this case h(n) =
2
system is unstable).
(c) Since the system is anticausal its ROC is |z| <1/2 . In this case,
1n
n
h(n) =
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
4
initially at a rest (i.e it is relaxed ).
Solution:
Taking z-transform,
Y (z) = 0.5z 1Y (z) + X ( z)
Y (z) =
1
1
X ( z) 1 0.5z
1 z 1 cos w
o
Z (cos wo n u(n)) =
+z
1 2z 1 cos w
1 z 1 cos
X ( z) = 10
1 2z
cos
10 1
+ z
(1
1
2
2z 1 + z 2 )
4
1
1
1
(1
1
z
1
2
2z + z
10(1 1 z 1 )
2
=
1
j / 4
z 1 )(1 e j / 4 z 1 )
(1 0.5z )(1 e
j 28.7
63
=
+ 6.78e j 2.870 + 6.78e
Y (z) = (1 0.5z
1 0.5z 1
) .10
1 e j / 4 z 1 1 e j / 4 z 1
Downloaded from www.bhawesh.com.np/ -56
j 28.7 jn / 4
y fr (n) 6.78e
= 13.56 cos n
j 28.7 jn / 4
6.78e
u(n)
28.7 u(n)
4
Pole-zero diagram:1 z 1 2z 2
H ( z) =
1
2
3
1 1.75z
+ 1.4z
0.375z
3
2
z z 2z
= 3
z 1.75z 2 + 1.25z 0.375
z(z 2)(z +1)
=
( z 0.75)( z 0.5 j0.5)(z 0.5 + j0.5)
Im(z)
j0.5
-1
0.75
Re(z)
-j0.5
2.5158
= 0.728 + j0.522
Im(z)
j0.77
j0.522
-0.722
0.45
-0.4
0.5
Re(z)
H (e
jwT
)
W
T =3 / 4 =3.438
WT =0
H (e
jwT
) WT = / 4=0.319
H (e
jwt
H(e
jwT
) WT = =1.11
0.478
/4
/2
3/4
Notch filter:
H(e
(null)
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 =
jwk
h(k ) Ae
jwn
..(3)
k =
.(4)
k =
h(n) <
.(5)
n=
n
u(n) When the input is
2
complex exponential sequence x(n) = Ae
Solution:1
H ( z) =
1 1. z 1
2
1
H (w) =
1 1 e jw
2
w= ,
At
2
1
2 j 26.6
=
H
e
=
1 j 2
5
2
1 e
2
And therefore the o/p is
2
jn
y(n) =
j 26.6 e
jn / 2
u(n)
<n<.
5
y(n) =
2
5
j ( n 26.6)
Ae
<n<
= 1
x(n) = 10 5sin
n + 2 cosn
2
2
<n<
Solution:H ( z) = 1
1 1 z 1
2
1
H ( z) =
1
1 2 e jw
The first term in a input signal is a fixed signal component corresponding to w = 0. Thus,
1
=2
1 1
2
. Thus ,
2
1
2
=
1 j
5
1 e 2
2
j 26.6
e
10
40
y(n) = 20
cosn,
n 26.6 +
sin
<n<
12 sin
Date: 2066/09/25
Chapter:- 5
Discrete filter structure:Cascade form structure:H ( z) =
k 1
H ( z)
k
b ko + b k1 z 1
1 + ak1 z
+ b z 1
k2
+ ak 2 z
2
x (n)
x (n)
H1(z)
y1(n)
H2(z)
y2(n)
xk(n)
Hk(z)
y(n)
xk(n)
+
z-1
b
-ak1
k1
z-1
-a
b
k2
k2
H1(z)
H2(z)
Hk(z)
x(n)
y(n)
# Determine the cascade parallel realization for the system described by the system function
1
2
1
z 1 (1 2z
10 1 z 1 1
2
3
H (z) =
3
1 1
1
1 1
1
1 1
z 1 1
1+
+j
Cascade form:-
H1 z =
z 1
1
H 2 (z) =
1
2
+j
2
1
z
z 1
32
(1 + 2z )
1
1 2 z 1
3
7 z 1 + 3
1
z
1 + 2 z 1 z 2
1
1 z 1 + z 2
2
H (z) = 10H1 (z)H 2 (z)
The cascade relationship is
x(n)
1
+
10
+
y(n)
z-1
z-1
1
7/8
-2/3
-3/2
z-1
z-1
-3/32
-1/2
-1
Parallel form:-
H (z) =
4
H (z) =
z
2
z
3
1
10 z
( z + 2)z
+j
8
10 z
3
4
= k1
1
8
+ k2 +
1
z
z
4
8
3
2
k3
1
+j
+j
2
2
2
z
1
2
( z + 2)
3
1
z
2
1
+
z
2
2
*
k3
1
1
j
2
2
2
k1 = 2.93, k2 = 17.68 , k3 = 12.25 j14.57,
k3* = 12.25 + j14.57
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 63
2
z-1
z-1
z-1
z-1
h(2)
h(1)
+
h(m-1)
+
yk(n)
ko
k = 1, 2
..........k
+ b z 1 + b z 2
k1
k2
H1(z)
H2(z)
Hk(z)
x(n) = x1(n)
y(n)
z-1
xk(n)
z-1
bk2
b1
k
bk0
+
+
yk(n)
m = 0,1 ...........m 1
Am ( z) = 1 + m (k ) z k
k =1
m1
Ao (m) = 1
hm ( z) = 1, hm (k ) = m (k ), k = 1,2..............m
m deg ree of polynomial.
z-1
z-1
z-1
x(n)
m
(2)
(1)
+
y(n)
fo(n)
x(n)
go(n)
g1(n)
z-1
go(n-1)
f 0 (n) = x(n)
g 0 (n) = x(n)
f1 (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)
fo(n)
f1(n)
k2
k
1
x(n)
k2
k
1
go(n)
z-1
go(n-1)
f2(n)=y(n)
+
g (n)
z-1
g1(n-1)
g2(n)
Conversion of lattice coefficient to direct form filter coefficients:Direct form filter coefficient { m (k )} can be obtained form lattice coefficients {ki } using the
relations. A0 (z) = B0 (z) = 1
1
1
A (z) = Am (z) + k z B (z)
m
B ( z) = z
A (z
m1
m = 1, 2, ..............m 1
m = 1, 2, .....................m 1
k
3
= 1 + 3 z 1 + 1 z 2
8
2
2 (0) = 1,
2 (1) = 3 ,
8
2 (z) = 1 + 3 z 1 + z 2
2
2 (2) = 1 Corresponding to 2
2
nd
A (z) = A (z) + k z 1 ( z)
3
=1+
3 (0) = 1,
13 z 1 + 5 z 2 + 1 z 3
24
8
3
3 (1) = 13 ,
24
3 ( z) = 5 , 3 (3) = 1
8
3
Date: 2066/09/27
z 1
4
Lattice and lattice ladder structure for IIR system:Let us begin with all-pole system with system function.
1
H (z0 =
= 1 .. (1)
N
1 + am (k )z
k =1
m(z)
When N = 1.
fO(n)
x(n)
+
f1(n)
y(n)
K
K
g (n)
1
g1(n-1)
z-1
g (n)
o
x(n) = f1(n)
fo(n) = f1(n) k 1go(n1) g1(n) = k1f0(n)+go(n1) y(n) = fo(n)
= f1(n)+k1go(n-1)
y(n) = x(n) k 1y(n-1)
y1(n) = k1y(1)+y(n-1)
fO(n)
+
f2(n)
fO(n)
+
-
k2
y(n)
k
1
k2
k1
+
g2(n)
z-1
g1(n-1)
g (n)
1
z-1
g (n-1)
0
g (n)
o
Cm (k )z k
H (z) = N
k =0
k =0
1 + aN (k )z
A (z)
Cm (z)
Ladder Co-efficient,
vm = Cm (m)
m = 0, 1, 2, 3, M
fO(n)
f2(n)
fO(n)
+
-
y(n)
k
2
+
g2(n)
g1(n-1)
z-1
+
g (n)
g (n-1)
z-1
g (n)
o
v1
v2
vo
+
+ 0.64z 2 0.576z 3
A3 ( z)
Solution:
Lattice coefficient:-
+ 0.64z 2
1
2
A ( z) = A3 (z) k3 B3 (z) = 1 0.795z + 0.1819z
2
1 k3
2
k2 = 2 (z) = 0.1819
B2 (z) = 0.1819
1
B ( z) = A2 ( z) k2 B2 (z) = 1 0.6726z
2
1 k2
2
k1 = 1 (1) = 0.6726
k
3=-0.576
3=1
k
1=0.6782
z-1
1=-0.6782
2=-0.1819
2=0.1819
3= 0.576
z-1
z-1
v
2=3.9
v
0=4.538
1=5.46
+
Date: 2066/09/30
Analysis of sensitivity to quantization of filter coefficient:- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 69
H (z) =
k =0
N
1 + ak z k
.(1)
k =1
k =0
N
H (z) =
1 + ak
k =1
z
k
Where quantized coefficient {bk } can be released to the unquatized coefficients {ak } & {bk } by the
relation,
a k = a k + ak ,
k = 1, 2 , 3 .................N
bk = bk + bk ,
k = 1, 2 , 3 .................m
---------(3)
--------- (4)
D( z) = 1 + ak z k = kN=1 (1 pk z
) .(4)
k =1
pi =
pi
. (6)
k =1
k
(z) / a
p N k
k =1
l =1,l i
(p p )
i
qk . (8)
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.
hk (m) x(n m)
yk (n) =
m=
hk (m) x(n m)
(1)
m=
A
k
yk (n)
hk (m) for all n (2)
m=
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
A <
x
(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
A <
..(5)
x
m1
hk (m)
m=0
yk (n)
n=
x(n)
= C 2 Ex .. (6)
n=
n=
yk (n)
1
2
H (w) X (w)
1
Ex 2 H (w)
dw .. (7)
C Ex Ex
H (w)
dw
H (w) 2
dw . (8)
Chapter: 6
Put t = nT
M
ha (nT ) = Ai e pi nT ua (nT )
i =1
H ( z) = h(n)z n
n=0
Ai e p
n= 0
M
nT
ua (nT ) z
i =1
= Ai (e piT z 1 )n ua (nT )
i =1 n=0
M
= = Ai
i =1
Hence,
1
1
p T 1
1e z
i
1e z
pT
i
s pi
k1
k1
= ( s + 0.1 + j3) + ( s + 0.1 j3)
*
k1 = 1 , k1 = 1
2
1
1
2
2
H a (s) =
+
( s + 0.1 +
( s + 0.1 j3)
j3)
Then using impulse invariance method,
1
1
2
2
H ( z) = 1 + e( 0.1 j 3)T z 1 + 1 e( 0.1 j 3)T z 1
1 (e0.1T cos 3T )z 1
= 1 (ze
0.1T
cos 3T )z
0.2T 1
+e
dt
Taking integration on both sides.
du(t) dt + a
nT
nT
y(t)dt =
dt
mT
Using Trapezoidal rule,
x(t)dt
nT T
nT
nT T
Then,
- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 73
bT / 2(1 + z
)
1
X (z) = 1 z + aT / 2(1 + z )
b
H (z) =
2 1 z 1
1 + a
T1+z
2 z 1
Hence, s =
1
1
T +z
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
jw
1
=
jw
+1
re
2 2 1 + j2r sin w
= r 2
T
+ 2r cos w +1
Comparing with,
s = + j
Y (z)
re
2
T
r
r
+ 2r cos w +1
2r sin
w
T r 2 + 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 zplane and RHP in s maps into outside a unit circle.
When, r = 1, = 0 ,
2
2 sin w
=
T 2 + 2 cos w
= 2 tan( w 2)
T
w = 2 1 T
tan
2
-1
=2tan (T/2)
/2
/2
Fig: mapping between frequency variables w and resulting from bilinear transformation.
# Convert the analog filter with system H a (s) =
s + 0.1
( 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
r =
4=
tan wr / 2
T
tan
T
T =
1
2
Now , s =
2/T
z
+z
1
1
=4
z 1
+z
1 z
4
1 +z
+z
1
+ 0.1
2
+ 16
1 + 0.1
H ( z) =
z 1
1 + 0.95z
Now, s =
1
1
T1 +z
Then,
0.65 T
2 z 1 0.65T
+
1
T1 +z
T
1
0,65(1 + z )
=
2.65 1.35z
H (z) =
H ( z) =
0.245(1 + z
1 0.509z
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.
M
k =1
H (s) =
(s z )
k
N= (s p )
k 1
Where, {zk } and {pk } are zeroes and poles of the analog
filter. Then system function for digital filter is
(1 e z )
H (s) = k =1 pk T1
N
k =1
z T 1
(1 e k z )
Thus each factor of the form (s-a) in H(s) is mapped into the factor (1 eaT z 1 ) . This mapping is
called matched z-transformation.
s + 0.1
into digital IIR filter by matched
(s + 0.1) 2 + 9
z-transformation method.
s + 0.1
H a (s) =
(s + 0.1)
(1 e
0.1T
z 1
When
1
1 + 2n
2
=1
1
2n
1+
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 h as zero at infinity ( ).
(2) Tn ( j0) = 1 for all n.
T ( jw)
n
Tn(j)
n=1
n=2
n=3
log
n=
10
0.1 p
2 log(s p )
3-dB cutoff frequency,
p
c =
1
(10 1)
Chebyshev filter:
0.1
2n
1 + Cn ()
(2) At = 1 ,
n=
cosh
10 0.1 p
cosh (s p )
equal ripple filter.
High attenuation in stop band and steeper roll-off near the cut-off frequency.
1
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.
p'
p'
High pass
Band pass
Band stop
p'
p'
s
s2 + L u
L , u
S p s ( u L )
s ( L ) ,
S p 2 u
L
u
s + Lu
p
Q. Transform the single pole low pass butterworth filter with the system function H (s) = s + p into
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
p
s(u L )
+p
= s(u L )
2
s + (u L )s + L u
2
parameter
'
p = band edge frequency of new filter
'
p
p[
sin
2
a=
'
p
+ p
sin
2
High pass
z 1
z 1
+a
1 + az
'
cos
p + p[
2
a=
'
p p
cos
2
Band pass
z 1 z 2 a1 z 1 + a2
a 2 z 2 a z 1 + 1
1
+
u
cos
a=
'
cos
k = cot
'
+ L
. tan( p / 2)
2
Band stop
z 1
a 1 z + a2
a1 =
,a2
2
1
k+1
a2 z a1 z +1
z
1
= k
1+k
'
+
u
cos
a=
cos
k = tan
'
'
. tan( p / 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
= 20 log(0.20) = 13,98dB
0.1
1
10
s
log
10 0.1 p 1
n = 2 log( p / s ) = 2.466 3
3 dB cut off frequency,
p
= 23.55 rad / sec
c =
(100.1 p 1)
From table for N = 3, and c =1, we have
Order of filter,
10
log
0.1
10
0.1 p
n = 2 log( p / s ) = 1.783 2
3 dB cut off frequency,
p
c =
= 1.164
1
2n
(100.1 1
From table for n = 2 and c = 1 , we have
1
2
H (s) = s + 1.4145 + 1
Now denormalizing with c = 1.164
p
1
H (s) s = s / c = s / + 1.41s / c + 1
2
2c
= s2 + 1.414s + 2
c
s + 1 .414 s
+2
T z +1
H (z) =
2
=2
z 1
z+1
z +1
2
, (T
= 1)
1.354
z 1
+ 1.645 2
z +1
+ 1.3548
0.2
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
s
H n (s) = H p
0.25
=
s
H n (s) =
s + 0.5
1
Q. Use bilinear transformation to obtained digital low pass filter to approximate H ( s) = s + 2 s + 1 .
Assume cut off frequency of 100 Hz and sampling frequency of 1 khz.
Solution:
c = 2 100 ( Normalizing with fs )
1000
= 0.2 rad/sec
= 2 tan( / 2) = 0.65 (T = 1)
2
1
s = s / c =
+ 2 (s / 0.65)+1
0.65
0.4225
2
+ 0.919s + 0.4225
=s
2 z 1
z 1
Now we substitute, s = T z + 1 = 2 z + 1
0.4225
H (s) =
z
z 1
1
2
+ 0.919 2
( T = 1)
+ 0.4225
z+
+1
1
z
Q. Using bilinear transformation design a butterwoth filter which satisfy the following condition.
0.8 H (e
jw
) 1
H (e jw ) 0.2
Solution:
0 0.25
0.6
Transition band
1
Stop band
0.8
Pass band
0.2
= 0.2
s
= 0.6
p = 20 log(0.8) = 0.93dB
s = 20 log(0.2) = 13.97dB
p = 0.2 , s = 0.6
p = 2 tan(p / 2)= 0.65
T
2 tan( / 2) = 0.75
s =
s
T
0.1
1
10
0.1 p
1
2 log( p / s )
p
log
n=
10
= 0.75
(10 1)
From table, for n = 2 and c = 1
1
2
H (s) = s +1.414s + 1
Now, denormalizing with c = 0.75
c
0.1
2n
1
H (s) s = s / c = ( s / 0.75) + 1.414(s / 0.75) +1
0.56
2
= s + 1.065 + 0.56
Using bilinear transformation,
2 z 1
(r = 1))
s=
T z +1
0.56
H (s) =
z 1
z 1
2
2
+ 1.06 2
+ 0.56
z +1
z+1
2
p = 0.2 . (u = 3 / 5, L = 2 / 5)
Solution:
L
k = cot
tan( p
/ 2)
2
=1
+
cos u
L
2
=0
=
cos u L
2
u
a=
a2 =
k +1
k 1
k +1
=0
=0
Now, z1 z2
TF becomes,
0.245(1 z2 )
H ( z) =
2
1 + 0.509z
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 d escribe by the following difference equation.
y(n) = b0 x(n) + b1x(n 1) + ........bn 1 x(n m +1)
M 1
0 1
h(n) = h (5-n)
h(0) = h(5) =2
h(1) = h(4) = 4
h(2) = h(3) = 6
6
4
2
0
5
-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)
j
M 1
2
# 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.bhawesh.com.np/ -86
H ( z) = h(n)z
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.
-j2w
# A linear phase filter has a phase function e . What is the order of the filter.
Solution:
The phase of linear phase filter is given by,
j
M 1
=e 2
j2w
Comparing with e
M 1
=2
M=5
2
j n
) = hd (n)e
. (1)
n =
Where, the fourier coefficients hd(n) are the impulse response sequence of the filter given by,
j j n
h (n) = H (e )e d (2)
d
d
Also, z-transform of the sequence is given by,
H(z) =
hd (n) z
(3)
n =
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.
h (n) for
h(n) =
N 1
2
(4)
otherwise
Then we have,
N 1
2
h(n)z
H (z) =
1 ..(5)
N 1
n =
N 1
2
=h
N 1
2
+ h(1)z
+ .........h(0) + ...... + h
N 1
2
( N 1 2 )
z
N 1
2
n
n
H ( z) = h(0) + h(n)z + h(n) z
n =1
(6)
H ( z) = h(0) + h(n)[zn + z
n =1
..
(8)
This TF is not physically realizable. Realizability can be brought by multiplying the equation (8) by
Where,
N 1
is delay in samples.
2
We have,
H '( z) = z
=z
1
H(z)
2
N
N 1
2
1
2
h(0)
+ h(n) z
n =1
+z
] .. (9)
H d (e j ) =
for / 2
0
Determine the values of h(n) for N = 11. Find frequency response.
Solution:
hd (n) = 2
jn
jn
H d (e )e d
/ 2
jn
/ 21.e
d
j
d(e )
sin n
=
/2
/2
, <n<
sin n
h(n) =
for n 5
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
n =1
+z
= 0.5 + 5 h(n) z n + z n
n =1
]
]
5
H ( z) = z 2 H (z) = z H ( z)
2
4
5
6
8
10
= 0.06366 0.106z
+ 0.318z
+ 0.5z + 0.318z 0.106z + 0.06366z
'
H d () = hd (n)e jn (1)
n =0
Where,
hd (n) =
1
2
H d ()e jn d .. (2)
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
n = 0,1........M 1
= h (n)(n) = d
0
d
h(n)
. (4)
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
jn
.. (5)
n =0
Thus the combination of Hd( ) with W () yields the frequency response of FIR filter.
H () =
H (v)W ( v)dv
d
W () = e
jn
n =0
1 e
= j
1 e
j M
= e j ( M 1 / 2 )
( 2)sin
sin M 2
( )
sin(M
2
W ( ) =
sin(
2)
() =
= M 1 +
sin(M / 2) 0
When,
When,
sin(M 2)<0
Date: 2066/10/11
(n), 0 n 1
Rectangular
Hamming
Hanning
2n
M 1
cos 2n
M 1
0.54-0.46cos
1
2
Kaiser
I0
M 1
I0
M 1
2
Where Io is zero order Bessel function.
M 1
2
Rectangular
kaiser
1
Hamming
Hanning
0
M-1
Name of window
Window function.
(n), n
Hamming
Hanning
M-1
M 1
2
2n
0.54-0.46cos
M 1
1
2n
1 + cos
M 1
frequency
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 = 2 (k + ) . (1)
M
Where, k = 0, 1, ..
K = 0, 1 .
= 0, or
M 1 for M odd.
2
M
1 for M even.
2
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
jn
n =0
Suppose that we specify the frequency response of the filter at the frequency given by equation (i).
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 + )
1 M 1
h(n) =
H (k + )e j 2 ( k + ) n / M . (3)
M
k =o
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:
c = 2 0.5 =
1
()
hd (n) = 2
/ 2
jn
/ 21.e
/2
/2
= 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
5n5
2n
= 0.54+0.46cos
M 1
2n
10
M 1
2
M 1
2
55
H d (e
j 2
/ 2 /4
for / 4
)=
Obtain the filter coefficient hd (n) if the window function is defined as,
W (n) =
1 0n4
0
otherwise
Q. Design a low pass filter having desire frequency response given as,
H d (e
j 3
)=
0/2
/
W k = 2 (k + )
M
=0
6
n = 0, 1, . 6.
k =0
h(0) = 1 e j 6k / 7 =
k =0