Professional Documents
Culture Documents
DSP Matlab & Two Marks
DSP Matlab & Two Marks
S Poornachandra
Principal Dhaanish Ahmed College of Engineering Chennai
B Sasikala
Assistant Professor Department of Electronics and Communication Engineering Cresent Engineering College Chennai
Published by the Tata McGraw Hill Education Private Limited, 7 West Patel Nagar, New Delhi 110 008. Digital Signal Processing, 3e Matlab Tutorial & Two Marks Questions and Answers Copyright 2010, by Vijay Nicole Imprints Private Limited. No part of this publication may be reproduced or distributed in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise or stored in a database or retrieval system without the prior written permission of the publishers and copyright holders. The program listings (if any) may be entered, stored and executed in a computer system, but they may not be reproduced for publication. This edition can be exported from India only by the publishers, Tata McGraw Hill Education Private Limited.
Information contained in this work has been obtained by publishers, from sources believed to be reliable. However, neither publishers nor copyright holders guarantee the accuracy or completeness of any information published herein, and neither publishers nor copyright holders shall be responsible for any errors, omissions, or damages arising out of use of this information. This work is published with the understanding that publishers and copyright holders are supplying information but are not attempting to render engineering or other professional services. If such services are required, the assistance of an appropriate professional should be sought.
Laser Typeset at: Vijay Nicole Imprints Private Limited, Chennai - 600 042
RQXCRRQFDRBRR
Contents
Contents
Preface Introduction to MATLAB Two Marks Questions and Answers Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9 Chapter 13 Introduction to Signals and Systems LTI Systems Fourier Series Fourier Transform Z-Transform Finite Impluse Response Filter Infinite Impluse Response Filter Analysis of Finite Word Length Effect State Variables TQA-1 TQA-25 TQA-44 TQA-49 TQA-80 TQA-91 TQA-95 TQA-103 TQA-106 v MAT-1
Contents
Preface
This tutorial is a supplement to the textbook Digital Signal Processing. The tutorial covers basics of MATLAB and its commands used in introductory signals and systems to advanced digital filter design. It is meant to serve as a quick way to learn MATLAB and a quick reference to the commands that are used in this textbook. The best way to learn MATLAB is to sit before computer with MATLAB and this tutorial material, and execute each program of this tutorial. This tutorial also includes two marks questions and answers for selected chapters of the book. S Poornachandra B Sasikala
vi
Introduction to MATLAB
Int.roduction to MATLAB
What is MATLAB?
MATLAB is a commercial "MATrix LABoratory" package ofmathwork, which operates as an interactive programming environment (www.mathworks.com). Matlab program and script files always have .m extension. The programming language is exceptionally straightforward since almost every data object is assumed to be an array. Graphical output is available to supplement numerical results.
FIe Edit _ DobUQ Desktop W>ldow H.~
iii!!. ,. (. :
D ~ : j, lilt
Ifli r1 'v'
"
Cu".nU'r."'",y.
C."'TLAB?
ld
W'Iot'$ New
:N~~!'~~'.:~~",,~~,
,Wbin 'C.:.J demo. l..:Jextern wihelp L..JJo 'Wjovo WJhelp L..Jnolebook W rtw 'W.,mulink
,_".,u~,~~~: TYPe~.~l~~;d~C!fi~d
Fie
Folder Folder Folder Folder Folder Folder Folder Folder Folder Folder
Aug29,20061 Aug 29, 2006 1 Aug 29, 2006 1 Aug 29, 2006 1 Aug 29, 20061 Aug Aug Aug Aug 29, 29, 29, 29, 2006 1 20061 2006 1 2006 2
.L~~"""
U::;.W.X~.ffi ..9!.~Ql:Y
clear ele
i;:-J c. --
4:,'1/()7
~':~;:~
f',t!
--,.
date
help
ele
type he J.jJ help.m help .. ;~-'/1/07 1.0 :~l Pl~ .....~
.... 2/1/07 10:)5 PM
Fig.
MAT2
MATLAB Environment
As you enter into the MATLAB environment, four default windows will be opened. They are Current Directory Command History-displays Work Space Command Window complete history of commands used
The above windows can be configured by clicking 'desktop' and 'default' for all windows or can also be customized by selecting the appropriate window.
, MAIL.A1l
File Edt
D ~.
Shortcuts ii',,!DIS5",6ii
'/lew
ilItt
Help
IS .,
[fJ V\lhllt':
'.~
[fI
How to Add
.._._ ..
..
...
.... _ _
fI
~ti1. ail m
Iii.
leyouts, ,
wndow
Allrebbed
Command History
To Qet ""carted,
:5Ielect HATLABHelp or ~
v v
help ,m help
l'l:"j 1 f'M .... \ ;;;.;~,.... 2/1/0"7
he 113
ctf.tl:,
lD:'.:iS
t;~
nt
date
2/.1/0'7
help
1.0:4')
pro!
J,li.'1t;l~
date
l/lYi' .\,):'11 PJ1 a 5; b 10:
Fig.
MATLAB Environment
Introduction
to MATLAB
MAT3
Current Directory
Displays all directories and files currently in use as shown in Fig. 3.
ShorIe.t.
Now
d"I;P"'.MU"'N!Ut1iU5'1Ll!iIifW4iti@.EE
~ dO ~
"'c
,
To get atarCed, :select HATLABHelp or Demo3 trom the Help menu.
" x
'[jJ8
~F11~TY~---iL~~-MO~fi~
AI Files
Llhyper_shnnkage_complete.asv ASV File Apr 19, 20001:09:3 11i[~;.p.;,:r,::~~.rI~_~~ii~=~ii~p.];':i~0.J 19, 20001101 M-file Apr ieee_1.fIg FIG-file Apr 19, 200012:49: ieee_2.fig FIG-file Apr 19, 200012:55: Drecursiveasv ASVF,le Apr19,20oo1:14:3 '[irecursivem M-file Apr19,20061151
"
)(
~l
JU:J.I PM
PM
.IU:J~)
help dau:~
date:
'~! \,.... ,7;/l/(l7 10:'10 PM ....t
help date
c1.;i.l.l;,,~
.I/O'?
10:41
yM --1,
a 5; b 10;
c a+J::l;
d s-b
...... , 1.....
vi
Fig.
MAT4
Workspace
Displays the input data, intermediate data and output data. The datas displayed in the workspace can be shared with any MATLAB files.
\ MA IIAll File Edit View Graphics DebuO -, Desktop
WildOlH
r':lr/.l1jI'XJ
Help
r;;t:
".
<
"r1 ~.
: Sleck:
Current Directory
X To get ~tarted,
.,"[CI83$
select
double
b
a
d
EO
5;
EBc
1b-l0;
tfJd
a-b
I' c d
I
a+b;
-5
Fig. 4
Workspace Environment
Command Window
You can see the MATLAB prompt (a double arrow) in the command window as you invoke MATLAB,
is called the command prompt. You have to type commands at the command prompt for MATLAB to execute. In command window you can type a command at command prompt, MATLAB executes the command you typed in, then prints out the result. Once again another command prompt appear and waits for you to enter another command.
Introduction
to MATLAB
MAT5
Click the mouse where the cursor is blinking, then type date and press the enter key. The MATLAB then returns the following:
) MAILAIl
I~ 110111'5<1
Help
",,wwmum.u~~
D ~.
IItiI
,)
(.
r:! : ~
Now
Current Drectory
C:'II'1ATLAB7
COlllUHJull WlIlduw
II
___
jFlle Type Folder Folder Folder Folder Folder Folder Folder Folder Folder Folder
La~ ~odlf_lI'd Aug 29, 20061/' AU9 29, 2006 1 AU9 29, 2006 1 Aug 29, 2006 1 Aug 29, 2006 1 Aug 29, 2006 1 AU9 29, 2006 1 Aug 29, 2006 1 Aug 29, 2006 2 Aug 29, 2006 2
To /Jet ~tarted,
:select
HATLABHelp or; ~
trom the
Help menu.
the
date
in dd-mmm-yyyy :!ormst.
an:s
date
Ol-Feb-2007
date
help
ele
type h,:~lp help .m help
1/(1'(' .\U:J-l
.I():3-~)
pr1
PM --',:
help
,~latf.'
>
date
Fig.
quit
or type
exit
MAT6
MATLAB Help?
Help on MATLAB toolboxes are available from the command prompt. Type help and press the enter key.
File
help
1'_ OesI<lop Window Help
) MAll All
Eelt Debug
r",
11')(:
D ~
ShortclJts
irlI;" ., '"'
to Add
'd : 1>
ClXrent Dlrec10ry
1tJ How
ill
Whet's New
[tJ cr"
:CJbin t.Jdemos
i:I ~ .~8
.
'.....
.
Folder Folder Folder Folder Folder Folder Folder Folder Folder Folder Folder Aug Aug Aug Aug Aug Aug Aug Aug Aug Aug Aug
.
29, 20061 29, 20061" 29, 20061: 29, 20061: 29, 2006 29, 2006 29, 2006 29, 2006 29, 2006 2:1 29, 2006 2:0 29, 2006 2:
help
H!LP
i"AU ..Fi~'~~=._''''_,_'''____
=:~JF~"TY~]L~~M;i,i~d==
topic:!
G~neral purpo!!e conrnand8. 0pl!!!rators and special characters. Progrartl't'ling language cowstruct!i. Elementarv matrice:!! anti matrix memipulation. Elementarv math function!!. Specialized math functions. !latrix function:!! - nume:rical linear algebra. Data anal V:!! and Four ier transform:!. is Interpolation and polynomials. Function function!! and ODE solvers. Sparse mstrices. Annotation and Plot Editing Two dimensional graph!!. Three dimen!lional graphs. Specialized graph:!!. Handle Graphics. Graphical user interface tools. Cnaracter string!l. Image and scientific data input/output. File input and output. Audio and Video !lupport. Time and date:!!. Data types and structures. Vl!!!rs1on control. COnrnelnds for creating and debugging coae. Help commands. Windows Operating SV!ltem Interface riles (COR/DOE) Examples and demon:!!tra.tions. Preference:!!.
1:. ..
::...:.Ie.tern :CJhelp
:.:Jj. ::...Jj...
:WJhelp ':...:.I otebook n ,Wrtw 'CJslrnulmk 'Wst.teflow .<
g,wr!!!nt"Pi{,~g.9r. \M:lrkspace
mat lab) general mat.lab\op~ mat lab\ lana mat lab\ elmat matltib\elfun mat lab\ epec::tun mat lab) matfun matla1:l\ datafun me-tlab) polyfun mat lab) funtun mat laP\ eparfun matl8b\:!3cribe matlab\qraph2d mat lab) qraph3 d mat lab\ ~pecqraph mat lab) graphic:!
matlab\uitool:!
mat letb\ strfun mat lab) image:9ci mat lab) iotun mat lab\ audiovideo mat,lab\timefun :mat lab\ cia-tat yp~l!S mat lab\ v~rctr 1 mat lab' coctetoo13
.-
--%
a - [1 2 3],
b-[456J'
C III
+ b
clear
clc
date
clc
help
L ..... 5f:E .J
Introduction
to MATLAB
MAT7
r-lrf.i1lrxJ
D I'
Shortcuts
y, llJ
<,
c. ,
!!J
W'let's
r:1
New
t,
C",rertOlroclory'
C'MATLAB7\work
How to Add
tiel
Contents search for'
TItle
~
x
Index plotl Search Demos,
Tile:
c "
Function
--
Roforonco
--~
----
- -
~~
'" -x
MATlAB ISoctio~ Curve Fitting Toolb.' Financial Time Sar Fived,Polnt Toolbo Model Predictive C RF Toolbov Wavelet Toolbox Simulink ReferencE MATLA8 Funcllon! MATLA8 Funcllon, MATLA8 Funclion! MATLA8 F unclion! MATLA8 F uncllon, MATLA8 Funcllon, Functions Mapping Toolbo, Neural Network Toc Neural Nelwork TO( Neural Network TOI Neural Nelwork To( Neural Network TOI Neural Network plOt (Y)
M"
plot ,plot plot 'plot plot 'plot ,plot plot3 ,plotbrowser plot edit :plotmatrix plottools ,plotyy plot (phylre.J plotm Iplotbr plotep 'plotes plotpc 'plotperf plotpv
I plot
Linear 20 plol
. )
Description
plots the columns of Y versus their index if Y is a real number. If Y is complex, plot (Y) is equj~alent to
plot (real
0 0 0)
(YI, imaq(Y))
plotted versus the rows or columns of the matrix, depending on whether the ~ector's raw or column dimension matches the matrix
0 0.1
a line specification that determines line type, marker symbol, and color of the plotted hnes You can mix Xn, Yn, L 1ne:Spe:c triples with Xn, Yn pairs: plOt (Xl, Yl, X2, Y2 , L1ne:Spe:c, X3, Y31 .
_-_
~_
"
Noto
See L ine3pec for a list of line style, marker, and color specifiers,
W1ndo<';'i
!l::nmn'end
Fig.
MATLAB Document
Help
MATLAB utilizes the following arithmetic operators: Multiplication Subtraction Transpose Addition Division Power operator Arithmetic operator
* + /, Svmbol /\
MATS
The addition, subtraction, multiplication, division and inverse division are illustrated in Fig. 8.
) MAIlAIJ
1.1ti111'5<1
Fil. CI ~
t Illii" .)
Add
CUronl
Dlrootory:
l C:~ATLAB7\w0rk
New
onIDldnd Window
,.
"II
".
._._. __
n __
_ __
__
'<"'<'\<H'"
iL::1
X 1<1
.
i
225 t""a/b
a-[123]; b-[4S6];
c-a+b
t -
q-a\b
I
./:1
0.1111
,J::
y~:! 1
.,~!
Introduction
to MATLAB
MAT9
f.Jrd'Wxj
Clebo.JQ
File Edit
Oesl<top W"dow
Help
[l ~ J
Shortcuts
lttol
IlL; ,
'III
'!1
Current DIrectory:
C . 'ATL~~~"':" .I~
[tJ
How to Add
X
. ~ I' 111 =i1 .
stock:;
5.-4;
b-3;
caAb
m;e
b EB c EB d
EB
"=Jt~=.:~==~=.:~=]d~:~:I.
3 64 [1 23,456;7 8 91 [1 47,258;3691
r)!mmiliiDinil-Wttllll\TldIillJ.lIllUIII
.1
le-
EB.
I d'
6'1 d- (1 2 3; 'I 5 6; 7 8 9J
3
6
Fig.
Arithmetic
Pre-defined function
abs
An Ie
cos sin ex
MAT10
1'_
11'>'1'
') ':"~ : _
rJ : 'f
CUrren Drectory.
(:~i~~~:~:~:~~'.
X
ShortciAs
1] How to Acid
.. Stlde:'
u~,w,w~~, __
.-3;
b-4;
C" (a+j *b)
,,_~j
Cia
3.0000
''l.00001
d-abl' (e)
e:-snqle (e)
0.9273
:
t-cos
(a)
t ele
0.-3;
-0.9900
t;J
g-exp (a)
20,0855
in
~.:,
,~".....
.1
.IMi .
"'1",,+,
",.
iNih!
__
w"
Matrix Representation
MATLAB is based on matrix and vector algebra. The scalars are also treated as I x I matrices. Vectors can be generated in two ways: Equally spaced elements Unequally spaced elements
I : 6;
creates a I x 6 vector with the elements 0, I, 2, 3, 4, 5, 6. The first digit in the command gives the initial Value to be generated, second digit represent the increment to be generated (in this example it is I) and the last digit represent the last value to be generated.
x=O :6;
This command also generates a vector of! x 6 with the elements 0, I, 2, 3, 4, 5, 6. In MATLAB, if the increment digit is not specified, then it is set to a default of I.
Introduction
to MATLAB
MAT11
Unequally spaced elements Unequally spaced vectors can be generated by entering the values directly with in square bracket with a space between two digits.
y=[137841];
Additional element can be added to the vector: y(7) = 9; yields the vector y = [I 3 784 I 9]; It is also possible to join two vectors: u = [2 5 II];
v=[yu];
then v=[13784192511]; The equally spaced and unequally spaced elements are generated in MATLAB environment as illustrated in Fig. II(a).
Fie D ~
Ecit
. ,X III
Shortc\A:s
How to Adcl
X
.. ~ =
(,:~lnmmd JNbtk\i'f
X
,~'''~.,,''''''''''''''_w'' __.".,__
Nome;
x -
0:1:6
I ,
tIlu
EEl v
EBw
EEl x
o
y y
5
0: 6
/BY
[1 3 e 1 9 15]
e b-1;
15
c- (i!t.+j
1tb)
w -
e
'",: 1.4 PM
15
v-[567]:
u Tv v)
0: 6
[1 3 e 1 9 15]
u -
w(7)-2
v-[567]: u [w v]
15
MAT12
Matrices are defined by entering the elements row by row: V=(137;841;925]; creates the matrix.
Special Matrices
Following are special matrices: Type of Matrix MATLABcodem); m = ones(n, m); m = eye(n); zeros(n, r 1;
[n n x m matrix, the 'n' represents the number of rows and 'm' represents the number of column. The special matrices are illustrated in Fig. ll(b).
File Edt DebuQ Desktop Window Help
D ~
Shortcuts
,K!lJio.
<;
'.
JIi '!1
~w
't
Current DIrectory;
lll. W"lat's
" X
ommand
Window
"" x
.~II'
EE
y1
=...
'iIi
'
Slack:>;
V-[l
v double double double
2 3;4 5 6;1 8 9]
j;eINt'";
EE y2 EE y3 3;4 (3) a .V. 8 (3) (3,4) 1 one!!2 a (3,3) a eye (4, 6;1 zero!! zero:il [XVl []V3 onel!l(4/3) one!l(4,3) 6; 3;4 5 9] 9J- 1 D v2 J2il!!!ro!l(3,4)4} a clc[1V2 clear V'
56;7891'''''':::]~o~:le
<3x4 double> <4x3 double> 1100;0 1 0;00 11
a Vl
Vi
y2 y3 Vl
!#I
a
1 V3
~)
Introduction
to MATLAB
MAT13
A value can be assigned to a particular element of a matrix using the command: v(l,3)=6; as illustrated in Fig. 12.
'MAIlAIl
1_11d'lfxl
Dobu'l Dosl<lop W"dow ii, Help
i
FU. Edt
CI ~
Shortcuts
1IliI" .) "
How to Add
iii rd
l'
Current Directory
III
tIi
ommalld
Vtlmdow
,.
m_
=ii.
'fill.'
Stock!iL,i
double double
Hl"~'"
EB I
[1 23105671
<3,4 double>
y3 oyo(3) J/lS/(17
?:~:4
AM .....\
clear
010 1-eve(3,4) 1(2,3) -6
k - [1 2 3 4: 1 1 1 1: 5 5 5 5]
So
1+k
MAT14
"..
fdit
DIbJg
Dnktop ~')
('j
WIndow
..,
Cl l
~ .~ ~
r:!l ,
t~
CurrentDnctory:
!C .. TLAB7'1work
0
b
a add b
[1 2 J 'I 5 6 7]:
[2
add"
II
2: 2: 2: 2: 2: 2); + b
,mulll
"b
,""
add"'o.+b
!Iub III - b
multla~b'
dlv II
Fig.
13
One-Dimension
Arithmetic
(Addition, Subtraction,
'MAll'"
Multiplication
b
b
- [1 2 3 4; 4 5 6 7; ? B 9 1]
add
add"
10
!Iub II. - b
-2
-)
-4 -7
-'I -6
-6 -8
-.
-7
-1
Wm l!:=J
"'B"
I;
)""M'
Fig.
14
Introduction
to MATLAB
MAT15
'MATlAIJ
l-lll.I'lrxl
Debug Desld:op
W\r'lckJw
File Edit
HaIp
D ~
ri.
c~, or"" . , , X
liI!11!":"'.1a.Ilm.S1OC'"
E b Ell div E8 multi
<3)(4 double> double
a eye(3,4)
~~~:~~~~"'=]{3~;~'~~',~~~,~~=~=~I}::;~-'=
1-10165059259 -00740.
11 4 7;2 5 8;3 6 91
doubl,
double
b
b
[1 2 ;3 'I; 'l 5 6 7; 7
e 9 1]
!1M b
It
multi"
a b'
eo
multi h'
multi"
c:ll!elX
ele
It l!yl!(3,'1) b [1 2 3 : 'I 5 6 7; 7 8 9 1] add"'a+b
llIub a b
cl1v . a
I b
cll!:ar
dlv
-1.018S
ele
a l!VI! (3, 4) b [1 2 3 'I; 'I 5 6 7; rnulti-sltb'
? 8 9 1]
;~.:
'f,'
;;
I MAIIAIt
d1v
Q.8704
? I
I-0,07<1
+.
Debuo
',,,',,1
00","" .' """'" " ltJ HoIp
""""t
C~""",,,,, . ,,
'i"
..
r_lrl11llX -2.9700 -2.6146 1.4183 5.7610
,"
Fie D ~
Edit
l\l> lI&
:.lJ How
ri
ShortCl.is
to Add
V\tM!lI's New
t 0:8
double double
'1 t.*cos(t)
7 -0.8323 9
clear ele
a" eye-(i,S) b 0:4
ml b "" s' m2 b
CltCO!l(t)
V ~,
t.
CO!!
(t)
~.'\
m:~.nll.III"I'III'I'I!I;;I II"I'I"I!'I'III
Fig.
IEI,
IIIII'I'I'.
15
MAT16
MATLAB is case sensitive: 'a' and' A' are two different names. The comment statements are preceded by a '%'. M-fiIes are macros of MAT LAB comm. and they are stored as ordinary text files with the extension 'm', that isjilename.m. An M-file can be either a function with input and output variables or a list of commands.
% a row vector % a column vector % transpose a vector (row to column or column to row) % a vector in a specified range [start: step size: end] % [start: step size: end] % empty vector % a matrix: first parameter is ROWs and second parameter is COLUMNs
= pi*[ -5:5]/5
v= [] v = [1 2 3; 4 5 6]
v = rand (3, I)
v=m(2,:) v=m(:, I)
% random matrix (see also randn) % access a matrix row (2nd row) % access a matrix column (1st column) % size of a matrix % create a new matrix with size of m % list of variables % list/size/type of variables
Arithmetic Operations
2*a 2.* a
a/2
% scalar multiplication % pointwise vector multiplication % scalar division % pointwise vector multiplication % pointwise vector squaring % pointwise arithmetic operation
a.l2 a/'2
log([1 23])
Statistical Operations
sum(a)
% sum of vector elements % mean of vector elements % variance of vector elements % standard deviation of vector elements % maximum value of vector elements % determinant
mean(a) var(a)
std(a) max(a) det(a)
Introduction
to MATLAB
MAT17
The general form of the loops are (for, if, while) expression statement end
Relations <
not or or % greater equal less and than % less equal equal than
Formats
format short format long format short e format long e format hex format bank
% fixed point, 4 decimal places % fixed point, 14 decimal places % scientific notation, 4 decimal places % scientific notation, 4 decimal places % hexadecimal format % fixed dollars and cents
MAT18
Plots
The plot command creates linear x-y plots; if x and yare vectors of the same length, the command plot (x, y) opens a graphics window and draws an x-y plot of the elements ofx verses the elements ofy.
1.1:~l'~'!~!'~! 1111.11.11111111I11
NtEdltDebugDellr.topwndow~
OhdOfY. 'C:;w.:;:L:i.87~k ..
111111111111111111.11
.................. :.;;'
'.,,'.
3.
D"'~' -"""'~.'.""
ShorlCl.f1
;:~-j--e1T ,
lJ
'NlIll'~New
C~r"
l.l
How to Add
:>:>
"
i t ie ,IMe!
1:. x liU:le
~ ' :l
i 1\'
i,,):,,,
'.. 1 ); iy:,"':;'I"~l"I,~ I
-c ,,'f 'Jl ~. , ) ;
(',..J)'
1 (' _~
):
l\IIB
f!1
New
,t i
Cl.rrenlDnetory: ..~:.~~!\~.~
:;y; ...
frJ
WItt',
x-Unspllce(O,4pl,2:00): ~n(x);
V
plot(x,'V);
title (' .'1j.IlI.~,:;~'ll'.l v~V"'.t'(;I~): ylabel (' ~."" '.:,) ); xlsbel ('!' ,.,"",:"(H' -; );
hold ("n
plot(x,co!ll(x). leqend('t.'i.ne'.
' I: ,,:'~ir.t.o');
Introduction
to MATLAB
MAT19
The general form ofthe plot command is: Plot(xl, yl, sl, x2, y2, s2); Dashdot * dashed Solid redx-markwhitex -- Style +star yellowvLineStyle square Marker Color triangle 0(right) cyanCircle(up) greenLine(left) Code Dotted blue plus pentagram blacksd (down) diamond hexagram triangle Color magenta Marker CodePoint tringle triangle 1\ h< > p
'D"'~''',''(~,
"'~,:~ ...';:~"'; ..
d' t :c~;~";~;~"l:~::~!~~!~.~{
Help
x-linspace:(O,4'pi.200);
V s1n(x);
plot(x,v);
t:ltle (' ''In'~i!lOl,dl!1J. unve1:'ot:m'l; vlabel('llln(x)'); XIMelj':, (r.'),,~j.~ .l,.~!)'); hold Oil plot (x, eo!!!(xl, 'x:'); leql!nd('.~,trJ"'. 'l".'or~::,n~"l; gz::ld or: ax is ({ 4 10 a 1)):
II
)11
""i'
f1ATl f)
, f
I I
I<
If
r r~
Fig.
18 Formatting Waveform
MAT20
Multiple Plots
Multiple plots in multiple windows can be obtained by using the command subplot.
_}Ul':\!
F" I!dt 0Ibu9 o.fIop
'olMdow
"., c..
10 Alld
r! t
!
. HIIp
,.
CUfrel1 Otectory:
:.S.~.~.~~~~ ....
III WI
New
11)(18([10,10000,-20,5]). Q'rlcl'.m:
11ab.l('~{,H.i".lhi I:
j(label (' ~'r:'"'-'i1'':'''<:''' tltlel',I'Jtl~ pW( subplot (2, 1,21;
'-,.}i'
)J
,rr',,"q:n~u,I"J;
rlld_to_defiJree
31501 (211'pll;
'
pha.e-
ral1_to_cleliJree.nOl.
(1000./ (i om+1000) ) ;
grid l,r,;
V1abe1 (' b.wJl<"! iI.i~';Jtt:.~)' I; xlabel (' tr:t~qw:'r".'" \ 1:<l'J.',~(:';~ ) J I
"
t it
Ie ( , ;'.-).-1'"
i p)"l:~",:
' );
Generation of Waveforms
ElI.I!!mWim~t"i.li!",i!';!!,!Iii':,
F" Edit T.xI CtI ToolI I!II.
C\IItlu; ,> :.
o.lktop
: ,.
wndow HMI
D "" Il
''I>
on
f.
iii i!I
>ill111\ lb W
l@
~ :
0: l:N-l: 1(1-co.(O.12-pln)
1'1
;
) fj~url"
IIw:oplot (2,3, 1) ;.eelll1(n,xl, JI'): 1I1UJit1 (' '1') :'i'llll:lel(' }'lil'!"); tltle(I'n.~JurH1,id,~J,;);lIIxll1([O 2S -1.5 1.5)): :, 'j') ' .-"w;nH r: . I. ).,'J 1,1",' "'y'~~'t"l!,-r )(2-1,2. ~ (1'1) ; lIubplot (2,3,2) ;:lItelll(n,x2, '1. ): (' x;:[n)'); 1Ilabel (' TJ' :vlabel ',x~<..'J'~,M:''''I:eu'i.{[O 25 0100]): titll!('L~.;)i,1'.I " '1';, .~"",,"'r:':l.','1' -'!l '.iI",'''\' ",xT'Ot"l-rt'l'.' "::, l'Jf!",lUI'J\,~'"
'_Ir'll'x
2S 01,5]):
(l,N) : lIubplot (2,3,4) Jllt4Ull(n,x4, 'k'): Klelb.l ('I,') :solelbel{' >,,<lrq '): tltle('~wi~ 1'It.':':i")al<18([0 lS 0:1: 10) IrS-rill 1
x'i-on
0 1.5]);
;yl-.tl.l('
:aKl.({O
I(~(n;'): 12 0 12]l:
a--10: 1: 10: 'l'6- [leZ:Oll (1,10) ,1, 1ero;s (1, lOll ;; lluklplot.(2,J,6) :1It.t!m(ll.v6, 'p'); Klabltl (' ,,'); ylabel (' :(~i,l,j'); t.lt1e('\""~jul"''''I;aK111((-lO 10 01.5]);
Fig. 20
Waveforms Generations
Introduction
to MATLAB
MAT21
is .,
b"(l}1
,-
~:;j' f. eem
DebuOo."-'
WI\dllw
r:
~D
""X
fx
fIl
[l)s,s,Ti:i
r.
iff""
J. 4-
.-(I,-O.'ll
t""'H 1 "'fd"""InMrtTailIi~~fiIlp
5, "1e 9 10 -
111213 14 -
n-O:O.Ol:Z"pl; h-tr eq I (b, s, n ~: lIII1.lbplct.(Z,l,lj: plot(n/pi,alI.(bl. 'It,) I lflabel(', ,,,.,,,~,.;t."'.; <r""F'~"'~~;'): ,label I "na'JlL" ;,.1, ) l titL"I" I:';"'.,u'l"m~"i1.',yr';<lCft'); .)(ls([0203]1:
DiSg."~
~U"@
'" Dill
15- dllll>ell
16 1'1-
'1','
l;
-"jl
"
):
{~;--~ 1~C21
a 0.2 04 06 0,8 1 12 norrn.lil.dfrequeney 14 1,6 18 2 o 0.2 O' 06 08 1 12 normlliz.dhQu.ncy 1.4 1,6 1.8 2
Fig. 21
N-point OFT
Write a program and plot the frequency plot of magnitude and phase ofN-point
fflZill"'~'ill1~1,'!!~f1!lt,n!lle!!!!!i!!~!\lII!I:"!J!IlIli!l,
DFT.
1II1II'1I'1II11'
Ell:
f.id
CIlI
fodli
1II
,-
."f,I'l~~~'?I[J.'I!!.~T:::::::
, ~',n'lUl
'.",-',n
co,1;
:11
"
,,,,.,-
,-
l>r',
r.!'"
~
D~g.:~i'<!l.El.O@
l.')1
>ll'!,OItl
rrequ'ncyresponn
~C
"
\"""l'ljnl)
:12(13-
,,,,un-
:,'_,~i,ll~- /.'J.I.'f',c,t'
"'!;:ll'. H'r,
00
k-O:N-I;
.\lbplct(2,l,1);
.~elll(k, h, - 1<'); xlabel( ''''.;t';""l, ",-,,1 flabell' : ~ (.', '): ~l~l.(' ,tr("'\l<''''''''' J.-'.', .xl!O(OJ10 12)); 8ubplot (2, I, ~) I l!I~ell\(k,p, : ",
~u ,,-
,,,,,,30-
n-
,,-
)llabel('r,':'~"'?:'.""
vlabel (' l'~,,',.~r ,,-,,,-, sxis([0310-611;
I;
h"~'1""""":I;
I;
,,"j$rart
)'''01'
I'.'"
;'~.I,."l',h
COIl'
k"~.
"
Fig. 22
DFT Calculation
MAT22
N-point 10FT
Write a program and plot the frequency plot of magnitude and phase ofN-point IDFT.
,6
, ,-
, ,0lO-
5-
-2+21
2.4112-1.21261
-2 :Ln12+1.2426i
-2-H I j~ut~ 1
-0.414<:+'7.24261J
!
r'
to(
uuu1315
lO-
". ~I." T,',\~,l '.1,1, 1 t. . 1 ,;r'~~ n-Oll:N-l tOt k-O:l:N_l tw Idlccxp (-1 '2 P 1"0 'k/NI : ',t. '.".dic Xl (n+l,):+l)-tlll'ldle:
I [j 'XI
.t.Il':~.~,r'~..:r'I:'~' ~'~'f,
Rit
E4
..
Ihse;t
fllllil
DtlsktOP
Window
.nr!
Ko-(xk"xl'l./N;
45
,,-
n-O:N-l;
.tem(n,xn, xlabel('
"0');
"
la-
10-
,.,'j: TIMe!(':,,,),):
35
11-
tittel'in'''' .:",,,,,",n I: ,
.K18([O 6 0 5)1
15
05
Fig. 23
IDFT Calculation
book\r DMtop
wn'l
In
f:
1ri5
If)(
:lC
WIndOw '"'*'
11 : ,.
,
1
J
6
"..... 1iJ~..;~~~'ltnilm, . i
c.,t
<';lr(~lli-u:
(;('fl'l'lilJ':l(J:, (xn,
1;,;:0 ~"!que!m;e!l
tlJ.nct1on[,J cconv
,S..,~'\H;t'lt. n',"j',,"n':Jf , ~ '';IN "Pt",., !I') Tl'.:~
br\.NI
, , ,lO-
Nllenqth~l(n)
II
N21etltJth~hn) ;
1I"'[Kn ~ll!I:o.(l,N-Nl)l;
';I"~'IJf, ..IH.l
1213-
"
h'"[hn lero~(l,N-NZll:
','. ','"
;,/;j'''.:t. ;,mp"l.;:\';
1",,,.-,,d
cr"rJr'OI":.
15 lO-
n-
m-[O:l:N-l]
K'"",odl-IIl,N)
;
;
,,,,Z5-
1019zo212l2l-
Bin, :)-hln:
Fig. 24
Introduction to MATLAB
MAT23
Circular Convolution
Write a program
"'.. I!.
1
convolution.
WIndow H8Ip ..' II X
D~.)ilt.;;;';."t:fii~:;j_jtDjj,-1',;,
',,'.\r'.".\,\~,r
...................... ijjms;,[g'
23 'I 5 6 7 -
cle.r
~.l.l
t,~:".'
~j""q'H~W_'("~
aiI 10 -
xn-[l"
3 1);
11:12 :13 -
lItem(n,xn,'}(');
xlabell'l\'):vlabe1{;",(nj); t1ele(";l"lllUt jli'_:Jll(~1');Ill(is([O
",:i
"
15
'I 0 5]):
~\'PU:.tIll r~fll:-(mm
.rfl'qlHr.r:(~
16 11 18 151202122 :ZJ 24 -
27
"
sUbplotIZ,Z,Z); bn-[Z 2: 2: 2J; Nh-length(hn): n-O: l:Nh-l; .eem(n,hn,'k'): xlabel("!');V1abe1{ lito] ,); title('i7l.'pu.\~<!': r.~!''P(Jn.~~.'l;axil!l((O 'I 0 5l); It (N max(Nx,Nh)) error('N nn,l.~'t ~: qr.f:1I.ter '~r. :!:quni ~(~ ml.;4(:Jx,1'J1'l) b
-<
*~WL ~l~lL
_:I i"p~;i9"~ r 0123401234
"
_ :[
impul "'pao"
circular corwolulion
')
25
'IS -
yn-ccol\v(xn,hn,N);
HI
30~ ':31 32 -
n-0:1IN11
8ubpJ.ot(Z,Z,3); n-O: 1:N1:
5tem(n,vn,I<.;~;
33
34 -
xlabell'~i'l;y1abel(
tl~le('c':1J:(:ul~l:
\'((\1
);
,_~rjllV01'.I':i(m'~I.xl.([O
4 0 ZZ)l;
Fig.
25 Circular Convolution
MAT24
f.' flItl"._fI1l1i[ll!\l'''''''[''
t:, .
.'l:I"r'",r].,:,,'!l'
I:IIllSl'il'.R
'.
..i"
X
2: ,,-
ele.r n-O:e:
~.\il:
':It:
3 - N Il; ;.!i
6 7-
~i l':pl,
'._ :~",'-l';."'1
1"Ii:l:,Yitw'IrRttToaIf~,"'Wlridow~
l!l 9 10 -
Nx-lenllth(xn); n-O:l:Nx-l;
Item(n,xn, ~-
I;
5 0 6) l;
1112 -
"
14 -
15 16 -
hn-[l
2 1 2):
Nh"'length(hn);
17 ll!l -
n-O:l:Nh-l;
stem(n, hn, ~,' I :
1920 ~2:1,
0 6]):
~w~c
o
"
"
lintarconwlulion
corr.I.lion
:22 -
27 ze
Z9 30 -
8 0 22]1;
;l.,ir:~~t'
r_,(;r.'."_~'\l::,i'.H,
1m) ;
31 3Z 33 34 -
n-OltINx+Nh-2;
et.m(n,v2, ')1';"; x1abe1('1~ ):yllllbeJ.('v[n) tltll!~";',",I-d-~t'L';h'I:.Kll11(O l; e 0 22));
~'~!!l~!I~'~'~$.~~~!m!I!!~L~I=i! I.
f:dtT.dC
!':';"
T~OeblJQo.Ptl)pWi'lcXMHIIp
or>
III.II.II
Deiiltqj WRibw', HI~
I'I'IE:I'
"'''x
e,"
f. e tl
i ill
Q!II!
i[lliili "
1\r,lJtc1 [(It VlIW JnHrtTOlils ".
'1:1
N
'<
4;
5i5 7 8 9 -
'I:'jl,;t, ~"'1'-I"'I":, lIIubplot(2,2, 1); x"'(1 2 3 1 5 IS 7 e 9]: NIl"'length(Il): n"'O:l:Nx-l; nelfl(n,x,' ~,.) :xlabe1{'
[xl
10 -
tltle('in~'u'.
6~iii.}
e:E1.
fi~,jiio
iG; c
11
12 13 1't 15 16 -
IIIIl'ld"
llIubplotl2,2,2): h"'[1 2 J]: Nh-length(h)J n"'O:I:Nh-1J lIItelll(n,h,' 1("') :lllll1bel('r:') ;1'lebel('J,[J'<]'); tltl.~'"I:\\pqJ,!,~ \'1'fll-H.,n:HI');ax11l1([O J 04]): i.! N<hnQ'th(hl error (' ti mln" ,'",' '_;I.'(,,-U,"r. '.'11'''''.( -
17 18 19 ~
J.,n-'-"-.!I
'.'l'
l,{ ,,] , )
20-
n-
"2l-
Z1-
,,-
"
l8
ZO-
Nx"'l.ngth(x~ ;II-len;th(h): Kl"'X-l;L-N-!l; 1l-(lIerc.(1,II-tl,ll,lIeroll(1,N-1)] h-(h ler"oll(1,N-Kq; Jo:-Uoor l ~Nx+Kl-l~ILl; Y-lIenlll~K+t,N) I tor
','.i,\"'~i.1~r,'.d t,~,~ ~'1',~:.t~t\,.;~ UW_'.' rOIK
'Li'L~l
o
"
10
oulpu!signal
29 -
30 3t -
n-
~:lA
""20 10 o 5 10 ('
,,,,,,35-
)3-
Y-Y(: ,l'l:N)';
V(V(:)'
1IIIWP ~2,2,3) ; n-O: 1:Nx+Nh-l; Lot lIItelll(n, V,' ~'l Jx!-.t>el (' n') ;1'labe1
t_1tl,t!,("''J.~'Y_'r,:,j,II\'"
v[nj '):
1 ); e.Il,l,lII.U.O",~~, ,~".~.OJ) I
Fig. 27
Introduction
to MA TLAB
MAT25
Butterworth
Write a program and plot magnitude and phase of Butterworth lowpass filter.
~ II(
ll,",ii1"'".n",.i"'.
~ - cl'.1: ,u,;
3 4 -
illlil''il'lhir
ESCDS1l''IJ
"""",<)",-..t,-.
"pz~tp/rl "''"2-tll/r I
"lj~ '.";''''1.'.':':1. (","4',.,,:,,.-,\' <"ml '~l'(]<!,,' [n,vn] "buttoE'd(vp." alphap,1I1phIl1l) I :'~"f,H.<,n'{,"""_, ,',(' t,;;'" (tl.a] "I:IUtttt (n,vnl; \ tL~~~ (',;.'!f!"";''''l>' ,,OI0.011P1/ (b,ollllj "tl:lIql(b,a, v, , ,/l"'h'"); Il'I"ZOloql0(.m1lIhll; IIn'il".nqle(hll lIu1:1ploeU,l,l); plot(omIpl,m): grid '.'r,; xlablll( ,,,.,,.,,, )I , IIlb.l ( . '~".>!, ,\~, <I ;, ) ; ( lIlli.([D 1.2 -300 SOll: ticle("nH;JII'.'.'.llj,. '-'--'l'(.r:."-')I .Ubp!Ot 12.1.2l J plot (OJI'l/pl,angl; grld 'n,) ltlMlt!l (' ,,')n~';J.,'~"l' "",''''1,,',,",":';') 1 ,1~,,1(;VL',,~. :"'i .. "); "
iII.!lI rriMrt.T:ids~Whi:IciW~
i).,...l;Ij(Jl$.l...t?ji'~:!fG ;>C
magniluder.sponse
I'g"''''
'... ~)(
:n
"
IIlt1.([0 1 -4 4));
tltl,,(;pt,""'" "":'I",,"",,'ll
~r
a 02
---'l
0,7 me
mml
1,2
~O
0.1
Q2
03
Q4 Q5 O~ rlOtm.lindfrequ'rlcy
0,9
Fig.
28 Butterworth LPF
Butterworth
HPF
Write a program and plot magnitude and phase of Butterworth highpass filter .
::ullYJ-np,"'m-u'I.,
Ph
1
"'.
';
"1.'"
f., iJlill'il'l'ilfil'1Hi i
wnb'I
'HIlp
IN
":11 II(
IBCD S 1I"i::l
2 3 -
S
6 -
vp-2tp/F,
.,
!l iii
'a, ..1 1''-'-''1''''-''-',' '<:1'1 ,..I,j", '-,1' LI,; f In, wn]-bucCO[d(wp,lI', .!pn-p, alphall) 1 t!':.'''.~'" .t:::"T:;',~ ,~1: ,l'~.~li;'~\" ~
(b,.]-I:>\lccet"(n,.n,'"',,,.~l;'); I;j~'.'fr,''."'!:1.::l,;it:".
v-O:O.Ol: pl: (h,olll]-t~eq3 (b,a,.,'- \,t, .., I' I; m-20"lo91O(U.II(hl); osng-.flQ' 1" 'h); llYbplot(2,l,l); pl(>c{om/pl,m)1 ll~ld Klu.el (, ",.. r"", j ,,,,,1 f ("'~"':!":.:v ,;
1111-'"'' 1
f.. Il':'; rx
10 11 12 : 13 1. '115 ~ -
I'illIEdt . !nIIiItT_~:.:~:~
ll,",ii1./~',iil.e.(>ji> ~'tilijil.LD
m'gnrtud.r"pgnt. ';"1
16 1118 HI -
,1al:llt!(''<I'.lln':r,cJuj:
axlsl[O tltl.tl\'" xlab.ll' 1 ~300 50) l: :..;.~."',it: r,<y(-'.,r'!I(/" ""''-1<'",' i
,.M,',',' ,,,,d
I; l;
;:0
21 -
22 U 24 2S
0,7
,. 0,8
; 09
1
1
uporl"
,-40
01
02
03
0.7
oe
09
Fig. 29
Butterworth
HPF
MAT26
Butterworth
BPF
f#I.M"i,n,ns,re.::'INi.j'M"I!I.,.el!
Write a program and plot magnitude and phase of Butterworth bandpass filter.
,...
!eM
"lit
ell
,.
~~1IP
.."..
." x !
iliirii3~;g
,-
el t' ,,~l:
alphapZ;alphall'"'ts; :l:pl400: tpZ-UOD; ral'"ZOO; ta2'"1800; 2"p1"(5211):
,. ,4 ~
'-5000; p[Zpl"fpl/r,
""''7'1\",,,"
2plfPur]:vs[Zpltsllr,
-,1
e: 9 lO:,,,~,.:t. ,:,',n
u-
[b,a)-butter(n,wn): ."010.01:pl:
'
t ,nn'
:';r.l".~?:,\',';,""<
-tdlt_liWt
TooIt~,1lItdcIW
,12i13~14 i 15 ~
:16:17"18-
(h,om) tceqll(b"a,v); _20"100;1'10 (abll (hI) : 8""'.11.,,18 (h) ; s\lbplot(Z,l,l): plot(olll/pl.m); 11label('1lI',1.1"'''':.': 1"':.1 ~H.q""'''",,'1'):
Df;i;~.,~''''E1.l'!)~)1ie:
QUd m;
[JIG
"OJ
magniludlrlSponll
'19lO-
,,,,-
ll-
.l.Ibplot(Z,l,Z);
Mlllbe 1 j . 11,,1:"'"
J,
"
H-
! ~",l fr,', '."J"~'~'" flabel(' r')'''Nf'' ;. "<1,1;"" ): aMls(IO 1 -4 il): tltle (' l'~"~"'" ru "'H',,-,,,,'I:
r" --T T [
0.3 04
r .... ..~1 :
0,7 (J,B 09
01
0,2
0.5
0,6
nOl'fYlalizedtrequlnc:y phlnruponll
~1
Q2
Q3
0,4 0,5 a6
normlliZldlrlqUlncy
OJ
0,8 0,9
Fig. 30
Butterworth
BPF
Butterworth
BEF _I!i!!!!r~."IIII!altllID"M
FIe Edit Text eel Tools DebLJGDMlr.t:opwr!dow Help
Write a program and plot magnitude and phase of Butterworth band elimination filter . IUm
,.; II X
[J ~
lO-
. ,
7
,,4,,-
lIli''!loll'&0':.'
cl
t"
"i~:in:'!il~!IItlllll!a :."":'
el[D 6'Q 8
foIl.;
ll-
alphap-Z; alph.s-iS: tpl-Z00: tpZ-1600: tsl-100; tsZ-1200: r-sooo; .p-[Z"pPtpllr, Zpltp2/r);ws-[Z.pi:l:sllr, zpp:l:s2lr]: '.") l'in:1 t.J\t: "",'.';I.. .t'\:'n1"'t:I~\::O''''\":'1 ,.,\:'j~r )1: t.j\~ j;1.l.t,~~ t [n,lIn]buttord (wp/pi, .S/pl, alphap, alphas) ; IJr.ur~' (b,lIIl.butt~r(n,.n, ... )r-'); ,; :t'~;"~C (...)~1'tH"~nl ' 1"k~""~>i'cKiOliSltcp'llMlbrl11llp
II-O:O.Ol:pl;
I:","IX
,,- !h,omltr~q'
1314lO-
o
!)n:
i#
IiIj;'~iGi:e:~~tltfli3iii
o
oj
-I
magnituderespon
15" !lUbplot(Z,l,l);
17lO-
plot(om/pl,ml: Qrlel xlabal (' IF.~l:1<'!~).j, M!,j h'~q\<!:!r,r:'l'): vlai:le.l(' t,lHn,I' "U'); lIIX18([0 1 -350 SO]); llubp.lot(Z"l,2); plot(orn/pl,ang); I( labe 1(, n"u~:d" ~..,t! trt;.-1";~"":: ~' ) :
flabel (, pl,'t,"r .MlsteO 1 L,~(j',(,;;):
t:'! .':~,,~ :,::,!
' ) ;
-1,
19lO-
uu-
qr1d
"
,,,,-
1:13:11
o
;t.:.:;+~ i
-i i]):
0.1 0.2 Q3
0.4 Q5
0.7 ~B
0.9
normalizlldfrequllflcy
IJ~rf~
o rr1 0.2 Q3 0.4 05 0,6 0.7 O,B 0.9
normaliz.dfr.qu.ncy
Fig.
31 Butterworth BEF
Introduction
to MATLAB
MAT27
Chebyshev-I LPF
Write a program and plot magnitude and phase ofChebyshev-I
UtlfW':I'I!{mmrnmm=n"r'lIlIt
FIB f:dt Tut c.. fa o.IJug Desltap wndDw .
lowpass filter.
D oi'IiIIOloik.,
1
: 2-
,-
9""
lli"llC .. ......E!1Il1!/jl;i::l,
un
,
uue1J-
,5,-
lO-
[b,aJ-ch.byl(n,.lphtlp,
.n): \ til,U'I"
14-
!S16-
n-
v-O:O,Cllp!: [h, oB1j-:tr@qz(b,a,v, '~'h:.' 1-:' ) ; 1Il"20tlogl0(till!l(n)) ; anq-anqlelh) ) lIubplot(2.1, 1); plot (om1pi,ml; lllabe 1 ~ l''-,nl''~ 1''''''1 l',-'-,c.p","I",'; ,label t ';'''' ;:\ jl~ di': ):
J
D~Iii."~"<;i,e. fl~.~.d.~.
mlgrlilIJltef8llponse
!~..--lnMrt'TOOlJ~~""
"[J]
I;
orid
mll
10!OlD-
uUnD
'1 -
lIW!plot(~.1.2);
Vlab . l(;r~J,,"I'<'" '" IIK1SHO 1 -of ill:
qtld on;
200
,,-
'1-
" "
~(\'<;.~r.):
-__----r---__--~_i;'
0,2 0,4 0.6
normalizeltfr8QIJ8ncy
~-.~.~:=~'~~~.!~~ .
.
0,8 1 1.2
i: ~~f~~JT::CT I, -~~~~-~~~~-~-~~-.
o 0,1 02 03 0.4 05 0.6 1 0.7
nOrlTlalizeltfrtQlJsncy
r l 0,8
: ... lS .. 09
ij
Fig. 32
!E-t;i;
7.'T."'.'~!
Chebyshev-I HPF
Write a program and plot magnitude and phase of chebyshev-I highpass filter.
EI.L~~._.mmtilil
"" Edt Tlffi eel Tools Debuo oesItop 'M'IcIowHIlp
'E
... E1Jmi3ii'iJ
D~ili
1
Z-
;.
34oS -
ti
,'.It,bl' 1 tiP,' ;)'~,"~.,;l, :,1 cleat ':\),,'; .lpi'lap-l:alpi'lu-30; tp-1600: ts-600;'-5000: wp-2't.p/';"sa2t~/': ,..',r, . f~ r""',F""" ) (1l,Iol11J"ch~blotdC.p,ws,lllphllll,alphu); f.,,,,I.'l'i,'-,1\ (b,a)-chebVl(n,alphap,wn, vO;O.Ol:pl: ); I'lItEdt_InMrtTOdsOttkop~ .
7 8 9 10-
11lZ 13 14 IS -
[h,oll'l}-treq;(b,a,v, "~:("'~'l;
1lI-,O'loql0(Mll(b)): anq-anqle(h): subplot ll, 1,1): plot (OIlI/pl,m): qrlcl ,~:\: XIMe 1 ( . 11,'". ,o,c\1 ~ ~~<,:jf. f,'(:.; ,(, .11":;' ) ; ' ' vla.belC'.I,d"i;,dB'): a)(I11((O I
9~1iI~:};:@,e,\")~'li!'O~
magnillJderuponst
.~ CJ
:16:17 -
-300 50));
"
HI
'151 -
title I """::'iJ
subplot(2,
,0 2122 -
xlabtl (
yla.bel( axi,,((O
I gnc:l ,~a;
~3 -
,.
:i~ i:rtfiI~Hii.'..... . j
tI'1" ..I
0.9
normalized
frequency
!
Fig.
33
MAT28
Chebyshev-I BPF
Write a program and plot magnitude and phase ofChebyshev-I bandpass filter.
Q($lIIi ;.;,: f.
1 2., l)~tl-:'J'L, ,)f: ':)",.~,:i~I,"":~ r
~iJ~<awJfuIil
''''''l', ,
iHrnB6'p
~ " )Ie
{:ff
3<I.
aJphap-Z:alphu-4S:
fpl-400; tpZ-UOO: hit-ZOo; hZ-UJOO;
5Iii-
'-5000:
vp[Zpltpl/r. Z.pl.tp2lr]
;liIlt-[2pltlll/r,
;;t
:<:
plfllZ/f);
1..1.]t.'if
10-
,
e-
.,
11lZl314-
",'.' f:-, n'J '.)',~ ':\',V."f.: 1:;:l;'q<:'<H.'.'''l ',l~"~ (,l':.1i,f [n, vnj-cheblord ("p/pl, vlI/pi,alpnap,alpha.); ...yr.'\"'"~ t'.l::~:';\~..l: ';.! ';:"It 1'ilu,r ' [b,ajchebv1 (n,alphap,vn): vO:Q.Ol:pl;
':.h,',
, !cl
YlIw
InHltTooI5~
wnkM
[h,ol'llj-treq;(b,a,wl:
m~201"ql0{1Ilb~(hl) ; ang-angle(h) ; lIubplot (2, 1, 1); plot(OII'I/pi,lllj; qrid 1,; xlab.l (' !".1\l\1~1~rl'l trt:','.ll'!Iv,' ~" ) ; " vli!Wel(",I''1il'. in<t:'); ax 1, ( [0 1 - 400 50] ~; tit 1!' (' ""~'.lr..J, ".ud" 'Ubp1otI2,1,2): plot(OIllIpi,ang): grid ~I,;
l! lelb!'L (' ,,,,\ym~l,, \ r,,'j -,f, :J:,>,'j\h"1 .~,' ) ;
DCli'liI .
~.. <lI.E<~~
If
O~
~CJ
magniluderesponse
t!-
16 -
1710 19202122232425
re<IH,n'):
4Jl;
i~
a 0,1 02
iuu.':..
I~t~Sf~1 Ii
03 04 05 0,6 nOlmaliztdfrtlquency 07 DB 09
i ]
1
Fig. 34
Chebyshev-I BEF
Write a program and plot magnitude and phase ofChebyshev-I band elimination filter.
ar~r,!r'linn.'!'N"'ln9!+"
NIl !dI Tlxt , Toc* o.bug DllltOJl WIndow .Hilp
; TIT'.
"i'lLl
....EBDJB~p
[).Ciilliil
. 1
....'-
. " ...~ ..
~,.f,llItJ~'9;ID1J0~
t.2"1200: 2'plta2/1)1
'.-i;',' i"J,,"'-.I~I.
23 '1S -
''',' v;n '."f. ':~,"~' \'.'$l\,-,',' ,.1 H.:' clear 11;1; alpbllop-2; alpha.-'IS; tpl-200; tp2-18001 tlI1"'I00:
r~sooo;
wp"(2'pttp1/r, 2'pl'tp:a,Ir):"II-(2'pt'hl/F, c f,,~,'u.1 ',': ,".:;','".(:1. tr."'.",,~\c;: ,..,m\ '.\T,,"~',',;. (n,"nl-cho!blord(wp/pi,w./pl,alphap,l!l.lp~): ~,~)fi",,,:\, f""," ''-'.'.. . ".t' ,. "'" f:i, c,"}" ' " (b,aJ"chebyl(n,1II1pblllp,wn,',",")"I;'
6 7 8 9 ! 10 ~
'11'121314-
:151117!O-
,,2021'2Z '232i25
;:~~; ~~~:~~ (b, a, w): _201oql0(M~(hj): IIInq-lIInqle(h); .ulJplot (2,1,1); plot (om/pi,m); ql:"ld ~n; xlaDel{' !JI.'nwll~' ~',n'j ;:~'r;qW\r:'.'\" I : ylll1:lel("J"ir. ir,'J;;'); axi! ((0 1 -350 50]); .UbplQt(Z,1,2);
l! Illbe
.q::~::~fj:,i::.:~:i(ti(~.:~i:~rO~:i t1
magn~udlresponSl
pl0t(Om/Pl,8lIq):
"','q'.I<.'[,""I' 1;
qria
'J:'::
0,1
02
03
0.7
DB
0.9
i I:lmt:jl,+'.cnm.iJ'~
.:~'Tnu,uu,!l~rFFj
.40 0.1 02 OJ 04 0.5 0,6 0.7 normalized fl'lquMlc~ O,B 0.9 1
Fig.
35
Introduction
to MATLAB
MAT29
Chebyshev-II LPF
Write a program and plot magnitude and phase ofChebyshev-II lowpass filter.
R'i"IV""')"!"""'"1
[(It Tm: 0tI ToO!I ~'Delttop ~,~
I.
f...
,-
&l(lllii.,..,i,
,,,,lO-
.-
r-5000; wp-2tp/r;lflll'"ZttJ/r;
"\'.1:'(1 tn~ ~,~t;~.'::::t 'l'[:~q'Jelic:: ,n,:' ()r:;le~' ':t. ~h~ tll~l':t En, vn)"cbeb2ord(wp, "=', alphap, alphall) l [b, aJ "chebv2 (n, alphap, vn~ : 1.11 '.'.~I: C~'~.~t ~: H. nt l ",O:O.OI:p1; [h,OJIlj-:l:reql (1:1,a, v, '~,":ie' ) : l m'"20-1oQI0(eWll(h)) I anq-.nqle(ll.) : .ubplot (2, 1, 1~: plot Iolll/pt ,Ill' J gr1c:1 "'[01 ; ';' x lab. 1 ( , 1\\.-1'11'-': .I ~~. ,,-; 'T.', ..\~~~,,. ) ; ,la!:lel('q<'\li' H, elL' I: .Killll[O 1 -'10 lOll; title (. """,;(r,)t '''1r. t~.t.~,,';r,.1lf'): llubplot(2,1,21; plotloll/pi,an;): ;[io1 ,j],: xle.b@l(' n.-.nk,].j '.".... j"''-:''\''''.\;~ ;" ) ; , ,label ( ..?i'.!l!'f"! ill t~d'.ar.'): ax13([0 1 -3 J]); tltle(' >'~'-''''''~,:~~~,";I!(:'): } IIt:Ulll 1 "lit Ed!: """"lnMrtToaII
"r.;Xj
ll-
Dtlttop.'Mldow
I1IIp
IZ1314-
6(ililjT~J<!iE\6~\iI!oi] ,,[]
1514-
11-
,,lO-
10-
" lllll4-
1~[-r1fmm1
o
01 0,2 03
n~
05
06
0.7
O~
09
l5
Illl!EB;~
0,1 0,2 03 04 05 06 normalizlldfrequlll'\cy .............................
"
0.7
0,8
0,9
Fig. 36
Chebyshev-II HPF
Write a program and plot magnitude and phase ofChebyshev-II El'lunm1'!I,:uD""n,I"."nqnrr
1'. Edit T"lt cell ToolI '"
DiburiI
highpass filter.
I" r 7' 7
Cl riI ....
1 ""
'<
: '"
1
:.I:~
f.
,.
1o'fI)(
tJ
Ji) .
{(j
1!lI mr JGl1tll
EBrns/;[j
clea["
,,-
alph.pl:
i "~I a1phaa-30;
, ,10-
1{b,a}-chab,2(n,alph.p,vn,'hl.;Ji\'I: a, II, ' ",I"",,' I ; m-201o;10(~. (h) I: ana-angle lh); :lul:Iplot(:.I:,l,l); plot(om!pi,m);
x labe 1 (. \',',1"'11-\, ;.
~ fllter
~:;le.t:::i
~ l'E'urc
' I r:J
1)(
11-
ll-
T~
.DelkCIP
Help
D~I;I.J1~\~~i'4i!'
9[id
'-'Ill 0, __ ,: ,
OG
"0
__ .._--_.---7-. __ .~
.. -
1314<S-
a-
'~~'j.~r "'~'U'!l,~:." ) :
vla!:lel('q:.un
ax1a([O
'" (H;'):
~
,-.~---t. L
.J
1 -""0 10]):
.10 . __
plot(olll/pi,anQ'l: ,:,,(ju\l~'l;
JJ))
Q'[id ,:;:'';
22-
"
l3-
I.
.400
ILiff;- : =+,'
L L ' .L
L ..L .. _.. l. .. _.
---r-"
rf
""--1'"
"'1"
...
0,3
t-_!_ I 1-"0.7 08
-.
0.9
T_:~~tj---_r__!
o 01 0.2 03
i (
07
04 0.5 06 normlliudfrequency
0,8
0,9
Fig. 37
MAT30
Chebyshev-II BPF
Write a program and plot magnitude and phase ofChebyshev-II
~*mmnll=m1l
"" E.a Tnt eel Tools ~ 0Mtup Wlrollo"I ~
bandpass filter.
.-
..
--.---_.
__
.,
Dr;ii:(i
1 2c:le~f '~),;,I
111 ""
,.i.ijtJL4\~rll'iB$'';'
t"l"JSOO;
1Il1ll8/11:g,
J.
,5-
,. ,
lO-
t,t"200;
.,,,[l'pi't,,t/F, "pl'tp2/r).u"(ZpPbl/r,
[n,lO'n}"eheblofrjlllp/pl,wlI/pi,1Il1phap,1II1pha'l; [b,aJ "cheb?2 (n,alph.p,lII'nl; lI"O:O,Ol:pi; [Il,oltl)"treql(b,e.,v); 1'lI"20'loQ'lO(VllIih)): IIlnQ"anqle(n); ,ubplot(Z,l,l): plot!ornlpl,llI): ;t"il1 xlabei I ); 'J1Mel I "'.:\;.r, ',t~ ,~ll' I: I!lxiSI{O 1 -40 10J);
"pill,Z!'];
,
e
ll12-
I'll
ElR' 'I'lIw
"-t
T"
,,-
t<-
15'
16to-
te
1920-
tlUti
I:
'ilrld
I'"
JJ . o
,
01 02 03 04 0,5 06
],
I[
u222324-
"
subplot(Z,1.2); plot{om(p1,anQ'); d~ell ,LIt1.! j "I';' ~:~l' .Ii, 1'(1,1\ ~I".' ) ; 8olrl'I{O 133J);
07
t r\(~\(~1
.
08
09
-'----_J
"
tltlej':,
)1
phlll.responn
0,1
0,2
Q3
0,4
0,5
06
07
08
09
normalilldfrequency
Fig.
38
~tltfi
File EdIt ttllt eel TOQIl; 0ItIu9 I)nIQp Wfllklw ...,
.nllf mrllll1I.1
t' I[Ht
I"
FEIII 8
/II
D ,. liI cleet
1 'l-
..,
it ,. f.
fJ t1 % 'h
'g.
, .,
6-
Z'pl"faUf);
(b, fll ~<.:hetlyZ (n, .Jpbllp, ",n, ."O:O,OI:Pl; [b,oIDJ treql(b,tI,IIII; ",'ZO"loglOlab"lh)); flnl;j"llllgle(h); ilubplot(2, 1, i); plot. tolll/pl,m~; qr1d xla,be 1 ( ,,':rv> J!. ';e,' .;1 tt"""';:'-l~,,'.'~I'); yllUJel.('Jmr, '1, ,i)I'): a.l!I([O 1 -40 lOll;
fCI'Mwlostitf_tliiItGp~~ [J .." ..
t 1 tIe
Xlabll
r',
.11'<"
,;,<,,' ) ;
ZO ;) 1 -
.ubplat(2,l,Z);
plotlolll!pl,anq);
ql:ld
2223 Z'I-
,Iabel(
: i'" =--+ t:L; ;..-.-. ~-_~ ;. fj'J...,..,. :.... .... ""'. lUJPffmbFiCTjJ3l lI
.40
o
lJ
-t
"
01
'i
02
OJ
j'!'
0,4
0.5
0.6
07
'-L~---l
0,6
0,9
normalindfteqlJency
ph.$8rISpOn8t
~ ,0
..,
Fig. 39
Introduction
to MATLAB
MAT31
Analog-to-Digital
Filter Transformation
Write a program for converting analog filter coefficients into digital equivalent filter coefficients using impulseinvariant transformation method and Bilinear Transformation method.
EEI'II"IIl*II'Ill"Z1"II"I"'IIlEIIl'III'III'I'II.IIIII1'II!'I'IIlMIiPIlI ,..!lIt T.llt CIlI loch ~ oIslUp
D Ill'
,
1
'I: J
b-(l2];
w.-.~
"':IlK
JiiiHII!l , ,'
'.,"'.'\1 :." ,
IIIill
Ell'lg
.5-
'7- b-l:
d-
I!I-
b 1.0000
1.0000
".
O\l~P\lt
Dill'.
1 2 3 45l;18 5110 11 12 1] 14 l! 11 18 HI 20-
16-
'~;:;.:;:;'~t,'-:;i: ;>; k t, ,'t.:;:. :".~i:';~"'i<;;l;:;;; .. i\ur,): ",\!"j .. :'\, Ntnput.I'~"v"J: ('M '!'r.,~.)' ,'1: '.'\1:' ',~':t"l\r,~It\ tPl:lDttl''.W:l ~ ::"J:l-.,~"",,~ t:"i'."~ \,; tfpe-1nput (' f J..,,,,,r :',\'~r, ) 1 tpclntt(';"l""'" a1plla~ (N-ll/2; ~p."O.OOl; 311011t(;11 t,p. "'~ 1 lI'l\~lnput (' N'''' ..~,i\1'1',1 ':",' (..t.t t","',!"",""",!", , IIC"Il-PI; n~O: l:N-l; hd~lHn (IICO" (n-lllpha+ePII) l .1 (pi- (n-alpha+~pll)); CO!\lIe 2 1I'l\~1nput(' !l',l""'" ,"'1',i ",,\, .,,';i-.t !r,"",l';<'''',~r, uCO~un"Jll; Il~O:l:N-l; hd~ (llln(pl"lll~.lpll.+ep.ll-3I1n("c" (n-.lpbll+epllll)
<'.
"
"
!..111
:a.r
!I' iO liI
Ji]} '
_C".
I:!II""')
.1 (pl" (n-.lpbll+ePIl));
auu-
"n1~npllt (' ~;'-." .l, ",,\'1 ; M " "n2.lnput (' i'hn"~;,,,~~'; t\"<"':l"~""'h,~, '<Ii' IIclallnl"p1;wc2-lIn2 'pll n~O: I,N-ll 1lc1-(Un(ue2"(n-lllphll+ep'll-llln("cl'(n-alpbe.+epll)))./(Pl'(n-alpb!\1"epll)); "nl- Inpllt I ..",'" "r ~ \' r r.,~:;,r.,"'n', .. un2-1npllt I '~,,'n,,'" i ';",~.~ ~:;>i'1":I; "t ,\\t," IIel-"I'I1"p11"e2vl\2*p1; nO:l:N-l; 1lc1"('in(IIcl-(n-.lpha+ep'l )-llln(IIc2-(n-alpba+epll) )+lIln(pl"(n_alpb.+ep"))) oelleCull'e
,,,,,,n-
J (pl-(n-lllpba+eplI)
~;
,,,,.cu-
dhp('
uctcectvin(N)/ .lIubplotI2,l,ll;plot(cl!etl; tltl.I' ,:~':'t-~:l;:\\l~" ';, r.,C!(, I lxl.al ,;, (' r,' I; ,181:lll1(' ~'" j; IIn-hd."c.ct'; '1:,\,,',"" '-";.,if.,\';"'''' v-O:O.OI'llull-tceqv1I1n,1,lIjl .ubplOt(2,l,2);plot(./pl,20'loglO(llb,"(II))); t1tl.I't:",,.,,!,,,,,,,,\, ~~tiJ':,u~",'I;x1llb.1(!J,~::;"","i,,~J. i.'~'l, ."l:U1 I:
'l33-
H-
,label(
"'<)'\Hl.'..:(l", ~,;l;:;t')1 .
Fig. 41
r. ~
lilt
ctI
ToOIl c.b.io
""',X
ciOi.XIiO.;;::ir"'/:!fiii\1i1iimilfu,jli;';;;.:r:"
1
~ =
.iiiiiiEi
ili:o
'"i{
~'r~i..i,~i;",ji""ftl':' i;'ii'i.'e'~u~'i'ii\i"'ii.:V;iii~;iq"';d'i;~lO,i
. 5 6-
~;.lt.", ::n'
;);
tprlntt("<rr:r.llf IIIolpha-{H-l)/2;
I:"'"
\1,-):
7-
I!-
,U12-
callI:1
n-1npUt (' r;"nNli '.~":u
<":\:~.
',f'r
rn~ll:t',,,,,,,. "'1, ~ l;
"
lO-
vc-.npl: ;;!I!e2
n-O:l;N-l:
(pi" (n-alpha+eplI)
hd.ln(wc~(n-.lpha"psll,/
1l1415lO-
"
) ) ./ (pi" (n-.lptllltepsli
"
,,>S-
wc.vn"pi; n-O:l:}i-l: hd;- (sln (pl" (n-slpha<teps~) -II in j wc" (n-alpbatep,) e,uul3
.):
vcl-wnl'pl: vcZ-vn2"pl; nO: 1 :N-1; hd"jllln (1fC2"l n-1II1phlll+ep") ) -Illn IlIel" (n-1II1pI'l1ll'feplI) I ./ ~pl" (n-alphlll<tl!PlIl ) : )
,,ll22-
10-
cue
4
"
l324Z>Z627lO-
IIn2"inputl't,r,n'J!1!!~"'~ urr/!:: ,~tJr,,,;l't .\\"<'1(;'HfJ'."Ir.~, 'i:'~" 0); IIcl""nl"p1;vcZ-IIIlPpl: n-O:l:N-l) hd-(81n(lfC1"(n-alpha+tlpll)-.in(lIcZ"ln-slphuepll))+Blnlpl"(n-alpha+epll))./(pi"(n-alpha+epa)): otherllllle
,,3D31-
n)S-
l3-
,,-
hlUll"h_ln'iJ(I~); lIubplot12,l,l);plot(hMl); tltle('!l'IJrml1r.\l';ln';r.'V'l;xll1l.1('/l'); yli1t1elj'lIl\]'): hn-het."hM'; w"O:O.OI:pi:h-:l:r'ql(lm, I, v); llubplot(2,1,:O:plot(lI/pi,lO"loqlOliltlll(h))): t ttll (' (1:~4:'j~n,~y t e.,:,po"J.le) ; 1I1a1:1el . 1;,nll1'!.l.i,!:!\~ ~!e'~\,el,~Y'): (
;; start
f'
>
I ,~ '
f'" "'"
'J!
I,
~("
lb
101
Fig. 42
11~~k\l, o.IitGP
h,,"
no
r..
O! ')(
TIfXI: Cd
1 2 , 3'4, 5 6 7-
DOi ....t
8-
'. l,~!I" '11, :)t, /j'i;":;~ i-i::r";_"'u~~-;-;;'~'i;;;"r.l;;-,;:v~r.~"';:1 N.lnpUt(~I\~.~'.' '.)',,, '''1'l;Fl'l 'it: ',h~ :'i"'l'lJ,~1'lq \';''''-,[,\'1 ); tprlnt:l:(' ',n"'l ~ :t','r!o~'p,'t.NI 1',~It.r\T."~J ~ !')\' h'(j'h;;ft:l~f..ilrl'::: type-lnput('~'""~'::'_ \',~J~H:c,",l' q"l1~ '): :tprlntt(~I;t~r. n".. :I~,I)!~".1 ;"'Ul': /;11\';"1\1':;:r;_~~;\,'); .I ' alpha-(N-ll/l: ep!l-O,OOI: IIIlfltchtype
CAlle
""II, ;,
,:...
'" f.1l i1
mitJlIl ""',,'
j~ 4 r
.,l~1l."I\<'1f.""):J~,l~,f\r. \n:! t
lfll-lnpUt (, 1'''''1.1."''.; ,:~f".'r,-,,~ ",t,\' L~'~,,~, IIC"Vn"pl; ll"O:l:N-l: hd-rnll(vc. (n-slpha+ep.) _/ (pi" (n-alpha<l1!pll) 1" IIn-lnput (. li,,::,~,~;. ;,~,'J ,--',':..~'.:-t ,!,t'""'l'J,:,nJ':" ""l'~ \ IIc-.nopi; n-O:l:N-l; hd."1.1n(pl" (n-alpMtep.}) -.ih(VC" (n-alphuep.ll)
'Il
:14:UI -
:16-
'n-
cueJ
'1820-
,,-
ll-
vnl"input('Nr,)::lJn!';Ml',l lrillf.l: ,"P:-M::!' r.;:'~\1';.~f',G" "llU" ,): 1m2-1nput (' 1;,~n,,/.\l~~ed 'XP],lI\l:C'It;-:;.:t:f t:~C!\\etK' ~~.::-, 'i"n<: 'l; IIcl"vnl'pl;vcl-lInl"pl: n"0:11N-l: hd- (llin Ivcl" (n-alphlll+ep.)) -.In(lIct" (ll-alphlll'fepll)) .I (pi" jnalphatepll));
M
,,nH24-
,,2O28:251:30 J31-
"d
lfnl~lnput(l;'~"'''"~';'.i-~,j l':)>lf:l ,,'.r:;":;,,:,1';;:"'~I""['C."', 1',',1 ); IIn2-1nput(~);grr'i-)\,:,),1 '''MJ''\' !r,-,,,m':I;'.'i.(,~', ~l\:' 'I; VCI~lInl"p1:uc2.lIn2"pl: n-O: l:N-t; hct- (1l1n(lIcl. {n-lI1pha<tepll)) -e1n(lIcZ" (n-1II1phlll+ePll)l +IIin Ipl" (n-alpha+ep8l)) othervi,seo dl,p('~"'l,,"_;~:_l _~i~~."r '_?rll'):
, ,/ (p1" (~-alPha+ep81):
l3;34-
,,-
;H-
han-hannlllgIN); llubplotU, 1,1);plot(hsn); tlt1.1'!':.~I.luh'J . i.r.~(,,~')JxlrabIl1l',','): yl!ll:lell'~lr.I)J hn-hl1. than' J ~'.'~I ,':r)f,t:t'l,,~~<:,r:', 1I-0:0.0l:pi.;b":tE'eql(hn,l,v); ll\lbplot(l,I,2):plot(lI/p1,20".1og10(iItI,(h))): t1 t le I ; .~', "~;,,.~._, ': [e:~;~')h""'): x Illlbe 1 (' J,r;,l"rN'.! u,,,d fn'~t;l,"'t'\"):
.t,
I
~.:::<!
y Illlbe 1 (
'"""\1"" ~'jl.l..,
(ill)' I :
"'i
Fig. 43
Introduction
to MATLAB
MAT33
d'
'x
IBID8/HI
";;;:;
''.'''~'q\1 c! Frr !l,~',"~-;I.~"~.::J i~.\,,;ir..":l\!, >;,i"d,'~ Nwinput('':':\~'''I, t,\<' ('.~'" ~,:",_,kn,1.' ~!r.d,,~ ); tptilltt('\",~r, l r.~nl';~p"'i,; ~IL'H' '.:; t ,I;'~~u . ;"b;F<n j;1;~~' ' t l'pc npllt I ' ':'"io"lC:. t. r.,~ i; ~ '\'.'~!. '. ;'l\~ ); tpclntt (, r.r.~er rJ0(Mli~;1~d\t..1\)~il~:~i':!:": 'I:,',. n'): alph.-(H-l)/Z; tPI-O.OOl: UJitch type r;UI't
1111- 1
nput
( ..~,(" 'I~"\
'~~'<l
'j;
c.,ez
IIn-input (' ~;,",;:m':\),.a~')
'.'ll'.I,tt!I~IF"~,'~~', "n
(n-alphal+ep.l))
wnl-lnplI.t('!ht"irl<l~,;~'I'J )(,,,r,;; '.'1" ',tf '!::,t>'t"",r."!', ~1\~' '): vnZ-lnpll.tl'I~nNll;~~d. '-i"p~~ ;<.;~. :tt. tr~:ruer,c:'e", i'n?" 'J; vCI_IInltpl;IICZ_wn2tpl; n-0:1:14-l; hdw(slnIIlCZt(n-.lphal+ePII))-s1n(lIClln-lI1phuep!)))./(pl(n-.Iphal+epsl); wnl"tnplI.t( <,,f.,,,,,,,,,! ~ 1'1'1'-'''10'';'),); wnZ"tnplI.t (' ;';,,~,v,1, .:,',.-' ;;;;".',~ ',',",'. ,"J.;; 1r";J,.,,";t;,n-, 'Hl< IIcl-lI'lll'pl;Vc~"vn2 'pi; n"O: 1:1'1-1; hd. (.tn(lIcl In-.lpha+ep.) 1-.tn(IICZln-lI1ph.+ep,))+Un(pi
black".blackman(Nl; s..wplot(Z,I,l);plot(bll1C"k)J title (':~':"":'X:l$l, ",::::k,i") ;Xlllbtl (. I,'): vlabel(' ~rr,; ); IIn-lId. black' l 'f: ltH ,~,:,~tft; ;~1" rO:O.Ol:pl;lI-tuql(hn,l,w): .ubplot(Z,I,2i;plot(V/pl,201oQl11(aIJ.(h))); t 1t Ie ( . ~r~'1"~,,(.'I r...,,,, ~',!l~'~' ) : lliabe I ( , n"~,, , ;.2,~.i L'''~'l ~~, ,(..';' I; ,lllbe 1 ( , ,,,.-,1':" '.t.i. ... . ~
.~;.
J
\ dl!
J .-
I;
Fig. 44
Window
f't";'jii',!"*""Wi"'@'i
FlIIfll:Tel:l:ceiTooIIDebuilDe*l;o'MUM" ll ..0;;.. . IlT,.-.ItI.,'~' 1
',1'X
II
...IIJIllB~i.Ei ...
,,-
, s; 57>a-
.,,-
N-lnput("r.,~r "I',,, '~',,)r,~. '.":,,~:1 '~l''''i "r r,,~~ """:1,-." "~,r !'\':l"~" ~ tprtntt('.;.'.',n.l H:.".'-'I:(l'';,lt '11 :. r~'r :,'.I1''''j,,,.J',,, 3 {f.,r :J~.llr.l,," ',', 'I t,pl!"lnpllt.(N';~" . "ire 'I; alpha(Nl)/Z; epII*O.001; ,",u,l!,,'htVpl! <';!l!!l'1 V~n-rect IN): w~II-~lnq(NI:
oSIIIe3
t""C'"J<-I't..'," l;
11-
U-
'1314-
'un,lelO-
,,-
other"lse
."
dlSp(
"'1(:':')1
'un'zs-
,. -
:Z3i4-
,u'z?-
,label (.''''''.'',
II
':::::::::':"::"~'::;~'::"::'c;j::;;'::::""
';start.
j"'lIJl.J
.. ,"
~~l~'
Dl'
Ilf
?(
1'1 I
Fig. 45
MAT34
O~
1 ...
.t ..Il,,.:.'" I
Tftt Ctlr."iIebug f, (;;~;j;',)1'
",'{
bliikl:ap 'iVfldliW.
.;
IIX
f,l1e~~ilill]$""":;;;;
~'\J ..~ i,:'.k~'I'
BOJE3il'Q
23 .. -
ct.-roil:
t.t~';ln i
.ir~\;,:;;;
... .... .
'-"',J',;;
I;
i.:
5, 67e9 10-
rj'll'~~,:lq 'u;
);
'i
t,~r'l.I1T!l:\<1',1:
t.,';~'
n'):
cue
"tn-rect(Nl: c:."e2
111213 -
In-h_lnq(NI; cue
J uln-he.nntnq(NI: vtn-blackmaIlIN);
:14:1!
cue"
ell.p("
end
118in!11!1 -
'1\'/~.',1.1 t.\\~,~[:tVt;,~,):
1lSi -
n-O:l:N-l:
hd-CCl.(ptln-alpha)),/In-.lph.); hdtalpba+l)-O; bn-bd.,tllin'; jZ3 - v-O:O.Ol:pi;b-fnql(bn,l,.); Z4 - plct(v/pi,ZOI10910{ab'(b))); 'l5 - titl.(' !r,I!'\t'l~n,~1' fr:.'l",'/"'t.'); 2' - xlab.l('I,,-,r~,.'.)ul!',l .ht.,'{u,'w,",>'); '21 ~ ,1ab.l(',\"sW"~'j(il!' "ill:'):
z:z -
:20 ,11 -
H~l';.~,
;o~~'nr_i"'I,1,;
.... , .. .. .. .. ii,ji ..
i....
of( ,.. "
Clii .. 1....
'~ stlJl1
jt ; ,. "
,oJ
I,'
r'
Fig. 46
Differentiator
8M ..:"x
IIlID 8 6'![l
1:3 -
cl.a,,,lL;
N-lnput (, "n-1nput
r~IV'-'\
. ,,.5 -
b.llt.-lnput(':o"l,,-:t
(' "n"'!r
ti".~ !",~~r.,;.:~,.l,-,,,
);
n-O:l:N-l: ,,O:O,01:pl.;
in
:13 -
1'1-
,lab.l('~~:V,l~'.ld~ :dllt'):
i.,.
J~start
"'
jt~..-t"f.!"'~
i;JI ,.
r"
':~~::'~~-':':':'c;:::~"'" k~ 'I
Fig. 47
Introduction
to MATLAB
MAT35
rogram for upsampling by an integer factor and plot its magnitude response. _[is;
,)6-
"
, ,1-
ct
clc
N-lnput ("'n!.!," n-O:H; r ',:.,. l;r,~':'~ ~)'!' Uk'
H;J",'\Tr:r
~-''''F''r~'
"
,in-
,lO-
"
l:
u-
'1311,1.5:16-
,.>~.
llQilrile
1- x
i!J;e.~~$ i.'!iI G I
~ tl
;n-
0.5
11-
t
E
.~:~~
~in.ut.",",""
o
'
10
n
15
(~
o
10
lj start
jI
.,j,
15
~<
Fig. 48
sampler
~91i',m,ln.li"~,~l!lf,alil'Clnsu!.l=~S~!t!!'!Il1'1lI=~,D~&='U=,I~~mll~~:'!~[ I"lIr rdt: 1m CtI,ToalIo.buOtMIWCfl'~ HI$ , ~ )(
rogram for downsampling by an integer factor and plot its magnitude response
D
I:
r'~lHC' . I' .
Nt tdt htrt,
0t*0P ~
'HI/P
t'J
o 5
0.5
i~~
o
10
"
15
~ '~:~~l
5
10
15
MAT36
Decimator
Write a program for decimator and plot its magnitude response.
,. . ..
'1.0
s ,-
,. ,1' ,z
tlioJ';i.ll'
c:learl~ ;
toh,..
),~l\(lr,b
j.f",t'JI':t:
I"I!:
t.b'! :~{,qu/?r;\,,!~
)J
f(ll'\'.t'[ !'ur
,1GloIldWnvlill"'''
'I,
+81n 12'p1'0.
on
'n) ;
iU-
:11 ~
in 'HI-
...
titl.1 ':rlP\l'; Ij~qUfrl'.(;rt; J: xlabe!(' \'l') I ,label ('Nnf'; .\!bplot-(2,1,Z): .0; (N/I)-it ato(., ,I 1: (N/III):
lIt_ln,xll:N));
~.:."~"~,
i:ji#!iI ...
,(('wl..,'):
.. IllIII."'~,:RiIP T
:~Ji.~"~,~~'~'g~IIP
'.
.... ,
~~~:::{:;
Qij" .. "
~ sfart
1 I;;,.,
'("
Fig. 50
Decimator
Introduction
to MATLAB
MAT37
Interpolator
Write a program for interpolator and plot its magnitude response. fJMI.fI!'Uflll"iiM"'ij'pS!t
F'- Eci Text Cell rcW.D*lljI.Dttkop"Wli'lduw"
[l 1
~.i"'.;;" ..",f;:i1i~~~Sri1lili:"""'1
" '.r.r.:'r;'..1~(111\: uj:!l~-r;r inti 01' "~r: ,r:::~qf:r tl'.~r_.,r \ char .ji':'
III[DB /HJ ..
,,,5-
,"
L
7; 8-
.-
i np ut ( .-,.. ~II, r:-r '. h .: " r,', '-~\l'-:r ','''','1" \II: x-.ln(2"pl'O.01:Pnl+s1n(ZplTO,03Pn);
1.
i; ~
r .
,-
10;11IlZ;13-
11~1II~ 1
11'"' X
i'lit:"
Eii:" 'In*: Ta
~.
'wwt;w:
[l~IiI.I,ii(e:O~
I;
itili'l
"D
:11,1$:\6i1'?-
l~
.~
10
15
"
t~
~O
10
15
all
Fig. 51 Interpolator
mm
ii
mOiiim
...
f"
111' .1.
m m 8
Edt Ta.
ft
<>
.> .
'"
f.
...
"[It
,,.. ,8,'lO-
,-
,"
."
,-r'''llIlpll(X,L,1I1;
lJutlplot(2:,l,l) I
',',~;u.', "' __ ,.
n
'!'t15"16-
uu-
Ite.(n,x(l:N)};
tit
Ie (. ,r,:; u"
Killbel(
J)');
,label
IJ (' .-.n';'~
[l~Iii.r~ ~e:~:i)\l!ti~![J
,..fdt,YliiitIi'iiilirtT.~~'~
.u1:lplot(2.1,2);
IfI"'O:(NtL/ll-l; IUIIl(JII,V(l: IN'l.1l1) I)
J
,,-
18-
tit
II
( . ,..t:: .'
lliabell'
I,'
CuI. 1,;'
.. ~mm ... m,;;;
i.
Fig.
& systems.
A signal is defined as a function of one or more variables, which conveys information. A system is an entity that manipulates one or more input signals to perform a function, which results in a new output signal. 2. What are the classifications of signal based on their properties?
Continuous-time (CT) signal and Discrete-time (DT) signal Periodic and Aperiodic signals Even and Odd signals Deterministic and Random signals Energy and Power signals 3. What are the classifications of system based on their properties?
Continuous-time and Discrete-time systems Stable and Unstable systems Memory and Memory-less systems Invertible and Non-invertible systems Time-invariant and Time-variant systems Linear and Non-linear systems Causal and Non-causal systems 4. Differentiate between discrete-time signal and digital signal. Discrete-time Signal and DT voltage discrete in time quantized in amplitude. The low signal isif the bit is '0'. only. represented saida to is discreteCTifbits is and '1 A signal signal encodingbinary signal. if it '1 Digital signal,be voltage time For a digital signalhigh of amplitude ('0' or represented asSignal a a by sampling, The digital in is obtained the quantizingis and terms the digitalinsignalbit is is ' '). digital
f' input n'. non-uniform rate. discrete mplitude atvaries at it oCT DT signal if be
TQA2
5.
Differentiate energy and power signal. Energy Signal The energy of CT signal x(t) over a period
-- T ~ t ~
Power Signal The power of CT signal x(t) over a period T --~t~+- T.. IS given 2 2
Lt I
+Yz
T.. +2
+Yz
IS
given by
by
Lt E
="
J ~
f
~-Yz
ix(t)12 dt
- f
l' ~ ~ T -Yz
Ix(t)12 dt
-N ~ n ~ +N is given by
Lt E=
N ~ ~
N----1oon=_N
L Ix(n)12
+N
--
L 2N + I
+N
jx(n)12
n=-N
A signal is referred to as energy signal if and only if the total energy of the signal satisfies the condition 0 ~ E70 ~ 00. Generally deterministic and aperiodic signals are considered to be energy signals.
A signal is referred to as energy signal if and only if the total energy of the signal satisfies the condition 0 ~ Pcc; ~ 00. Generally random and periodic signals are considered to be power signals.
6.
Differentiate even and odd signals. CT for DT x(n) = x( -n) signal signal for 2 Odd Signal axis. even is Eg.Even -n) said symmetricif signal is x( . x(n) Cosine wave x(t)signal -t)component of any about the A Even signal for DT signals areto be .odd DTx(t) = x( -t)vertical The +x( xe(n)+ = Signal for signal Xe (t) = 2 for CT signal
nal is
7.
Differentiate random and deterministic signal. Deterministic Signal Future value of signals is predictable. termsEEGsignals are one Random impulses.Noise, Speechmathematically in Eg. of A random signal respect there FutureRandomof Signal isto which etc. at is a time. valuewith is expressed values uncertaintysignal,signals in unpredictable. any its
and Answers
TQA3
8.
Define fundamental period for a periodic DTsignal. The fundamental period of No a DT signal x(n) is the smallest positive value of N for which x(n) the DT signal exhibits periodically. It is defined as No = 211'm, where m is an integer value.
=x(n + N) or
no
9.
period
of To a DT signal
positive
To = 211'.
COo
(9t) 211' 2 3
co)
=311', then 1i
=-=-=311'
COJ
211'
1i
T2
3
which is irrational.
= 3" x 211'=;;
0:St:S3
11. Draw the waveform x( -t) Solution x(t) x(-t) and x(2 - t) of the signal x(t) = {t, 0, t>3
-3 -2 -1 0
~"'"---.--. -5 -4 -3 -2
-1
. 1:(2- t) I t
TQA4
12. VerifY whether the following system is linear and time-invariant system y(n) = Ax[n] are constants. Solution
y(n)
+ B, where
A and B
= Ax[n]+B
(I)
= Ax}[n]+ = AX2[n]+
B B
Let us define
x3 [n]
such that
x3[n] Y3[n] Y3[n]
+ bY2[n]
Hence, it is non linear system. Test for time-inva riant Introduce time delay
no
= Ax] (n-no)+
(I)
no
in equation (I),
y[nno]
= Ax(n-no)+
(2)
Hence, the system is time-invariant. 13. Find the energy of the discrete time signal
n>O
x(n) =
'
j( 3n I)n
Solution
,n < 0
Let us consider
(~r '
n 2: 0
and Answers
TQA5
~
E]
L(0.25t
n=O
E]=--=1.33 1-0.25
-I 2
13nJ
E2
L n=~
~
E2
= L[rnJ
n=l
E2=L
n=l
~ (I)n 9
E2
=~=0.125
1-9
= E] + E2 = 1.4583
14. What is the periodicity of the signal x(t) = sin I OOnt + cosl50nt? Solution Let xI (t) = sin 100nt where wI = lOOn
Let
x2 (t)
w2
= 150n
T =2n =~=~
2
W2
150n 3 2 2
150
11 I 150 -=-x-=T2
50
211 =
3T2
15. Find the overall impulse response of the causal system shown in figure below.
y(n)
TQA6
Solution
yen) =h1(n)+h3(n) x(n) y( n) x(n)
= ~ (n) + [ h2 (n)
h1 (n)
= h2 (n)
16. What are the basic continuous time signals? Draw any four waveforms and write their equations. Solution (i) Sinusoidal signal
x(t)
x(t)
= Asin(wt
+<1
u(t) o
0, {I, t;:::O 0
J(t) =
( ;t {I0, (=0 0
'
and Answers
TQA7
r(t) =
0, t< { t, t~O0
o 17. Classify the signals as (i) periodic or aperiodic (i) (a) x(t) = er:J.Ifor a. > 1 From the definition for a periodic signal, x(t) = x(t + T)
e-u1 :#
eU(I+T)
= 2nf,
x(t)
= e-jlJJo/
T
The condition for periodicity, (ii) (a) The condition for energy is
= 2n
roo
T
= Lt f ler:J.Ii t d
T~~ T 2 T
2
E = Lt
T~~
e2a1dt
T
2
= T~~2a Lt _1_[
e2r:J.1
J2T --
E= T~~2a. Lt _1_[eaT_e-aTJ
1 E~ = 2a. [~e - e-ooJ = 00
TQA8
=,Lt
1-+~
I - f r
1
Ix(t)12 dt
T 2 T 2 T 2 2
<
00
= ,Lt - f
1-+~
leal I dt
p= Lt -T-+~
r [e2ot]f I 2a
-7'
2
p = 7'-+~2ar Lt _I_[euT -e-U7'J p~ = 0 Hence, given signal is neither energy nor power signal. (b)
x(t)
= e-1wot
T
E= ,Lt
1-+~
T
2
le-1wotl
dt
7' 2
E=
T-+~ T
2
Lt fidt
T
E= ,Lt 7 ~oo
[tFT
__ 2
2 2 E = 7'-+~[!-. +!-.J Lt
E=
'l'~oo
Lt [r]
and Answers
TQA9
p=
7~~T
.u
-!.
j
T
2
T
2
le-iClVl2
dt
P=Lt~fldt T~~T
T 2 T
P P~
Hence, it is power signal. 18. Draw the waveform of x( -t) and x(2 - t) given 0<t<3 x(t)=
x(t)
0, {t, t>3
xH)
3
x(2 - I) = x(- 1+ 2)
3
2
-I
-3
-2
-1
19. What is an energy signal? Check whether an unit step signal is an energy signal. Solution
T 2
r
2
TQA10
(b)
x(t) = u t =
()
0, {I,
t<0 t ~O
T
2
E=
Lt fWdt<oo
T~oo 0
7' 2
E=
Lt fldt
7'~ooO T
E = 7'~00 Lt
[t]2
2 E = T~oo [!.-J Lt
Eoo
= 00
T
f
0
1 dt
7'
p=
T~oo
Lt
-[tF 0 T
2'T
u(n) 2 0 2 Mathematic R.latlon CT Signal O .phlcal R.p . ntetlon u(n) CT Signal r(n)
X(I)
Inl<~
DT Signal
C, L, 1L n,
1wL
= { 1, 12345 1 2
NON
and Answers
TQA11
. otherwise
!!:!l.lnls -~.ltlsa a
TQA12
B(n) = 0(1)
klL-Ao
~
- a 0 a
0 a x(n) - a nx(t) Mathematic Relation x(n) t CTSignal x(n) CTSignal Graphical t o(n) Representation 1 t 1
L,
and Answers
TQA13
21. The signals x(t) and y(t) are the input and output of an LTI system respectively as shown below. Sketch the output response to following inputs:(i) x(t - 3) (ii) 2x(t) (iii) -3x(t)
x(t) y(t)
(iv) dx~t)
-1
x(t - 3)
-1
y(t - 3)
output
2 - 3y(t) 2y(t)
4 5 1 3 0 2
-3x(t)
output
-3
-3
22. What is meant by causality and stability? Derive the condition for the same. Solution
(a) A system is said to be"stable iff every bounded input produces a bounded output (BIBO).
TQA14
If the input signal is bounded, that is, Ix(t)1 :::;Mx < 00 for all t Produces a bounded output signal, ly(t)l:::; My <
00
(b) A system is said to be causal if the output response of the system at any time depends only on the present and/or past output, but not on future inputs. Example for causal is, y(n) = x(n) - x(n
-1) = -1,0,1.
Example for anticausal is, y(n) = x(n) - x(n+ 1) 23. What is the total energy of a DT signal x(n) which takes a value of 1 at n Solution
I
E=
n=-)
L 1112=12+12+12
=3
= x2(t)?
y(n)
= n
x(n)
(1)
= ax) (n)+bx2
(n)
(2)
Produces an output
y(n)
= ay)(n)+bY2(n)
Let us define y](n) = nx](n) and Y2(n) = nx2(n) Substitute equation (2) in (l),
y(n)
= n[ ax) (n)+ = a
y)(n)+b
bX2(n)]
= anxl(n)+bnx2(n)
Y2(n)
Hence, it is linear.
and Answers
TQA15
ii.
Introduce delay
no
Now introduce delay to output equation y(n- no) = (n- no) x(n- no) Compare right hand terms of equation (3) and (4) y(n):;ty(n-no) The system is time-variant. 26. Find whether the following signal is periodic or not x(n) = 5cos(61r)n. Solution The condition for periodic is, N = 21r m, m = 1,2, ... for the given signal, 00 = 61r. 00 21r I Therefore, N = - = - m 61r 3
Form=3, N= I. (4)
I
3
Solution According to stability condition, for a stable input signal, Ix(n)1< Mx < 00 for all n produces stable output, ly(n)1 S My < 00 1 ly(n)1 S Ix(n)1+-lx(n-l)1 8 Since x(n), x(n
+ -Ix(n3
2)1
-1) and x(n - 2) are bounded input signal, hence produces an bounded output, that is,
TQA-16
3
2
-4 -3 -2 -1
-4 -3 -2 -1 0
3
-4 -3 -2 -1 0
29. Find y(t) for the given signal. Solution Given y(t)
= x(3t + 4)
x(t)
3
2
and Answers
TQA17
y(t)=x(3t+4)
1=-1=-1 Lower=21 /=-1=0 31+4=2 1 1= -0.663 31+4= =4 3 -0.33 31+ 4 31+42 2 1=-1 1 31+4 /=-0.33 Lower bound Upper Upper Ibound= 3 IV II III 1=-3 1= -0.66
y(t) = x(3t + 4)
y(t) = x(5t - 6)
/=- -6 =23 /=- 2 /=85-6 = 2 5 = -6 = /=1.6 /=1.4 5 5/= 1.6 5/ 5/-6=1 5/-6 5/ 9 /7 1.8 /10 bound= 1 bound bound Upper =34 Upper ILower III II IV
y(t) = x(St - 6)
3
2
O.S
1 (1.2)
TQA18
y(t) =
X(~-2)
3Upper 3 = 15 3 1=9 .1 12 1= 18 1= 15 1= 3 Lower bound bound Upper I1=12 ~-2=1 ~-2=4 ~-2=2 ~-2=2 ~-2=3
IV III
II
y(t) = x(t/3 - 2)
3
2
10 12 14 16 18 20 22
<Xl
2. IIi(n)1 < 00
n=O
flbnl=_1 I-b
The given system is stable if and only if Ibl < I. (b) h(t)=tsint u(t) The condition for stability,
..
J Ih(t)jdt <
1=-00
<Xl
00
J Itsintl dt
1=0
..
J t.sint.dt= t.(cost)l~ -l.(-sint)l~
o
+ sin tl~ = 00
TQA19
(c)
h(t)=e-i21
u(t)
00 00
Jle-i211 dt=
o
00
Jl dt
0
Jle-21! dt=tl~
o
=00
u(n - 2) y(n) =
4n-1
00
u(n - 2)
y(n) = L4n-1
n=2
00
y(n)=-L4n 4 n=2
3 = 4 1-4 = _i < 00 .
.!.[~]
31. Define memory system and verify whether the folIowing systems are memory or memoryless systems. Solution
A system is said to be memory if the output of the system depends on past and/or future inputs.
+ x(t + 1)
= x3(t)
32. Define a time-invariant system and verify whether the systems are time-invariant or not. Solution (a) y(t) = x(t -1) + 2t x(t - 2) Introduce time delay to input signal alone, y(t) = x(t -1-to)+ Now, introduce time delay to output signal also y(t - to) = x(t 2t x(t - 2-to)
(1)
-1-
2- to)
(2)
On comparing right hand terms of(1) and (2) y(t):;t;y(t-to) Therefore, the system is time-variant system.
TQA20
(b)
yen) = x(n)cosam
no)cosron
(I)
= ex(n) (I)
= ex(n-no)
= ex(n-no)
(2)
Hence, the system is time-invariant. 33. A pair of sinusoidal signals with common angular frequency is defined below.
xl(n)
(n) and
X2
(b) Evaluate the amplitude and phase, angle of the signaly(n)= xl(n)+x2(n) Solution N= 21t'm
Here
n = 57r,
.
N=-.m=-.m
51t'
21t'
(b) The amplitude A and phase angle ofthe We would like to expressy(n)
yen) yen)
signal, yen) =
XI
(n)+ x2(n) is
= Acos[nn+tJ>]
=
Acos(nn)costJ>-
B (I)
and Answers
TQA21
We know
y(n)=
x] (n)+x2(n)
y(n) = sin5rrn+.J3
cos5rrn
Compare equations (I) and (2), we get Asin~ = -I, Acos~ =.J3
n = 5rr,
,/,
'I'=tan
cos~ -I [sin~]
--
y(n) = 2cos[5rrn-~]
34. Is it possible for an exponentially damped sinusoid to be periodic? Solution No, because exponentially periodic. 35. Given y(n) = Solution Since rn is diverging for increasing values of n, the input is unbounded. Hence output is also not bounded. Theryfore, system is not stable. 36. The input and output of a diode are related by
I(t) = ao +aIV(t)+a2V2(t)+a3V\t)+ ...
rn
damped sinusoidal
00.
So, it cannot be
where V(t) is applied voltage, I(t) is the current through diode, and ao, al are constants. Does this have memory? Solution Since I(t) depends only on the present value of V(t), the diode does not have memory. 37. Write down the expressions of DT unit impulse and unit step functions. Solution Unit impulse function
8(n)
0, {I,
n*"O0 n=
TQA22
0, n< 0 {I, n ~ 0
38. Verify the stability and causality of a system with H(Z) Solution
(1- 3.5r
(3 -
;Z-l) + 1.5r
(1-3.5r'
(3-4rl)
+ 1.5r2)
Z2 -3.5Z
Z(3Z -4)
+ 1.5
3Z-4 =-----
H(Z)=~+_B_ Z Z-3
Z-0.5
A = H(Z)x(Z -3)1'Z=3 Z
=2
H(Z)=
Taking inverse transform
1-3Z + 1-0.5r1
= 2(3t u(n) +
(~r
u(n)
00
Ilh(n)l<oo
n=-oo
and Answers
TQA23
"tlh(n~' ~[23"+GJ]
n~lh(n)!=2~3n+
~(~r
Y(Z)
Since 3n is divergent function, it is not bounded. Hence the system is unstable. To prove causality, let us consider H(Z)=-----= Y(Z)-3.5Y(Z)r1 Taking inverse transform yen) = 3.5y(n -1)
X(Z)
+ 1.5Y(Z)r2
= 3X(Z)-4X(Z)r1
The above system depends only on the present and past input and hence it is causal system. 39. Define static and stable system. Static System A system is said to be a static or memory less system if the system output at any instant n depends upon the input sample at the same instant n and not on the past or future input samples. Example, yen) = x(n);y(n) = x2(n)
Stable System The given system is said to be stable ifand only if every bounded input produces a bounded output. The stable system is also known as "Bounded Input-Bounded Output" (8IBO). A system is said to be stable if Ix(n)!::; Mx < 00 for all n, then Iy(n)! ::; My < 40. Define Sampling Theorem. Solution A band limited continuous time signal, with higher frequency 1m, can be uniquely recovered from its samples provided that the sampling rate, 41. What is system function? Solution Let x(n) and yen) is the input and output sequences of an LTI system with impulse response hen). Then the system function of the LTI system is defined as the ratio of Y(Z) and X(Z),that is,
H(z)
F,. ~ 21m 00
for all n .
Y(z)
X(z)
A system is said to be stable if every bounded input produces a bounded output. 42. What is the necessary Solution The necessary and sufficient condition for causality of an LTI system is, its unit sample response hen) = 0 for negative values of n, that is h(n)=O, for n<O
TQA24
43. Define LTl and causality. Solution (i) Linear system A system that satisfies the superposition principle is said to be a linear system. The superposition priniple states that the response of the system to a weighted sum of signals be equal to the corresponding weighted sum of the outputs of the system to each of the individual input signals, that is, H[axJ(n)+bxz(n)] Example, (ii) Time-invariant with time. Example, (Hi) Casual system A system is said to be causal if the output of the system at any time n depends only on present and past inputs, but does not depend on future inputs. This can be represented as y(n) Example, system = aH[(x\(n)]+bH[(xz(n)] for any arbitrary constants a and b. y(n)
= nx(x)
y(n)=x(n)+--
I
x(n-I) is linear or not.
44. Test whether the system y(n) = x(n) + nx(n -I) Solution
y(n) = x(n) + nx(n -I) Let xJ(n) and xz(n) are the inputs produces an outputs Yl(n) andY2(n) y\ (n) = xj(n)+ yz(n) The linearity is defined as x(n) = axx\(n)+bxxz(n) Substitute equation (2) in equation (1), y(n) = axl(n)+bxz(n)+n[axJ(n-I)+bxz(n-I)] = a[xJ (n) + axJ (n -1)]+ b[ xz(n) = ay\ (n) + byz(n) Hence the given system is linear. 45. The input-output Solution It is the memory system with memory extending from t to 00 nxJ
(1)
respectively.
(n-I) .
= xz(n)+nxz(n-I)
(2)
+ nxz(n -I)]
=- -; i( r) d r what c J
is its memory?
Chapter 3 LTISystems
1. What is the linear convolution of two signals x(n) = {~, 3, 4} and h(n)= Solution
{f' - 2, I}?
h3(n)
h2(n)
, ,
, ,, , h1(n)
,
* h(n)
-I, 0, -5, 4}
2. Define LTI system. Solution A system which satisfies the condition of linearity and time invariance is said to be a LTI system. 3. VerifY linearity, causality and time invariance of the system y(n + 2) = ax(n + 1) + bx(n + 3) . Solution Let us define xl (n) and x2 (n) as two signals, whose corresponding outputs are
y](n+2) Y2(n+2)
= axl(n+I)+bx](n+3) = ax2(n+
1)+bx2 (n+3)
According to linearity,
x( n)
= A x] (n) + B x2 (n )
(n + 3)+ B x2(n + 3)] (n+I)+bx2(n+3)]
(1)
2)
=a
=A =A
Hence, it is linear.
TQA26
Test for causality When n = 0, y(2) = ax(1) + bx(3) Whenn=l, y(3)=ax(2)+bx(4) depends on future input signal x(4). System is non-causal as output signaly(3) Test for time invariance Apply delay no to input signal only ax(n-no Apply delay no to output signal y(n-11o +2) = ax(n-no Compare right hand side of equation (1) and (2) YI (n+ 2) = y(n-11o Hence, given system is time invariant system.
00
+l)+bx(n-no
+3) +3)
(1)
+2)+bx(n-no
(2)
+ 2).
4.
f x('r)'h(t-T)
T=-eo
dT.
Solution The above equation y(t) which is the weighted superposition of impulse response time shifted by called convolution integral. This is represented as y(t) = x(t) '"h(t). 5. Check whether the system is time invariant or not.
T
is
f x(t) dt
1=0
f x(t-to)dt
1=0 T
(1)
f x(t-to)dt
1=0
(2)
On comparing right hand terms of equations (1) and (2) y(t)=y(t-to) Hence given system is time invariant. 6. The impulse response of a system is h(t) = e -31 . Find its step response? Solution 00 S(t) =
f h(t) dt
o
00
=f
o
e-31 dt
and Answers
TQA27
=-He-3II
Set)
=-
He
-00 -
eO]
=~
7.
Find the system response when the system described by a differential equaion,
d2 yet) dt2
+ S dy(t) + 6 yet) = dx(t) + x(t), where x(t) = u(t) and initial condition are y(O+) = dy(O+) = I.
dt dt dt
+ S dy(t) + 6 yet)
dt
=0
solutions are
Yn(t) = Ce).1 dYn(t)
dt
= CAe).1
= CA
2e).1
d2Yn(t) dt2
solution,
CA 2e).1 + SCAe).1+ 6Ce).1 = 0
Ce).1[ ,1.2 + SA + 6] = 0
,1.2
+SA +6 = 0
-2 and
,1.2
=-3
solution becomes
Yn(t) = C1e).l(+C2e"21 (2)
=C
+Sdyp(t) dt
+6y
(t)=
dx(t)+x(t) dt
O+SxO+6C=O+1
C=~
Therefore,
(3)
TQA28
= Yp(t)+
Yn(t) (4)
Substitute t = 0,
y(O)
+6
-31)
(5)
(6)
+6
8
(7) (8)
-2C] -3C2 7
=- and C2 =-2 3
2 3 1 +6
7 =-e _21 -- 8 e - 31
Find yet)
y(O+)
for an RL circuit whose input is x(t) = e-51 and current through inductor at t = 0+ is
R
= 2,1.
= R yet) + L
dy(t) dt
(1)
dt
+ R yet) = 0
= CeA1
(2)
(3)
TQA29
"
+ RCeA' = 0
[LA.+R]=O
)..=_R
The homogeneous solution is
Yn(t)=ce-(~} The particular solution for the given input signal x(t) = e-si is Yp(t) = Ce-S' The particular equation becomes, . dy (t) L-P dt
(4)
-+ RYp(t)
= x(t)
C=_l_ R-5L
Therefore, Yp(t) = R-5L The total solution is y(t)
_l_e-s,
R
(5)
y(t)=Ce
+ __
R-5L
e-si
(6)
Let/= 0, y(O)=C+
.
R~5L
1
=2
[y(0+)=2J
(7)
C=2--R-5L
The total solution is given by y(t)= 9. Define Transfer function in CT systems.
2---1) R-5L
. _!!.t( R-5L 1
+ ---
e-si
Solution Transfer function is defined as the ratio of output to input that is h (t) = y(t) . x(t)
TQA30
* [hi (n)+
~ (n)]
= x(n) * ~ (n)+
x(n)
* ~(n)
(b) Associative
[x(n)
property
(n)
* ~ (n)] * ~
= x(n) * [~(n) * ~
(n)]
= ~(n) * ~ (n)
Then,
x(n)
t----..,
o
Solution
X(t)
o (a) Fort<O,
00
-t
-1
J
T=-OO
x( r) .h(t -
r)
dr
=0
h(t-t)
(b)
Forl>t>O
(
y(t)
= Jx(r)'h(t-r)
o
(
dr
yet)
= J
r=O
I dr
= (r]~ = t
_--'-_-'--~~,-----.
t
t
and Answers
TQA31
(c)
ForI~t~O
h(t 1
t)
yet)
= f x(r)' h(t-r)
o
dr
= (r)~ =1
1
t
t
(d)
For2>t~1
h(t-t)
I
)-1
x( r ) . h(t -
r) dr = [r =t
tl
~_-l-o---+t--+ t t
=[I-(1-t)]
(e)
For t> 2,
yet) = 0
12. Compute the convolution of two sequences given and plot the output sequences.
x(k) h(k)
-k
-2
-1
1
(n-2)
Solution
h(k-n)
2 yen) = 0, for(n-2)
=-3 -2 -1
i.e., y( -I) = 0
t
(n-2)
The relation between input and output is the transfer function of the LTI system.
and Answers
TQA33
-4
6
-8
y(n)={2,
~
15. Show that arbitrary CT signal xU) can be represented as x(t) = Refer the derivation of convolution integral. 16. What is the response of an LTI system for h(n) = <5(n) + 2<5 (n -1) with an input x(n) = {I,
x(k) 2,
f x( r)<5 (t -
r) dr.
3}.
3
2 2
L..--~-...L-------_k
2
L..--"'----------_k
o
TQA34
Solution
h(-k) 2 2 h(1 -k) h(n -k) 2
-k
-k 10-1
0 -2 n
n t t
h(n-k) 2 I n=3 I
i
k)
'----+--+--f----k
2
~
y(n) (i) (ii)
K=O
L x(n)
h(n-
Forn<O, Forn=O,
+ x(2) + h(2)
= 0(2) + 1(1)+ 2(0) + 3(0) = 1 = x(O) h(O) + x(1) h(1) = (1) (2) + 2(1) = 4
h(2)
= x(2)
h(2)
= {I, 4, 7, 6}
and Answers
TQA35
x(n) h(n)
yen)
= {I, 4, 7, 6} verified.
17. Find the convolution of x(n) = {I, 2, 3, 4, 5} with h{n} = {I, 2, 3, 3, 2, I} . Solution
x(n) h(n)
3 3
2
14, 5}
TQA36
Solution
h(-t)
h(t-t)
h(t-t)
-t
(i) Fort<O,
t;?:
-t
y(l)=O
i
t y(t)
____
o
---IL--_..l..-_ .... t
t
(ii) For
0,
1
y(l) =
f e-21 dt
o
_2e I[
---
-21 JI0
1 e y ( t ) = -2" [-21
-e 0J
o
= ~[I-e-21 J
19. Find the reflected version ofx(t) about the amplitude axis. Solution
x(t)
x(-
t)
=1
Inl
n=-l
+ x( -n) . Given x(n) = {I-01 for n = 0 and for
>1
and Answers
TQA37
for for
n>+1
n = 1,2
n=-I,-2
Solution
n = 0 and
In! > 2
y(n) =
-2 ~ n~
24. Given x(n)={~ Solution
y(n) =
0, {I,
otherwise for n = 0, 1
x(k)
234
234
TQA38
x(-
k)
h(k) =
o {U(k)
otherwise = I, 9 ~ k ~ 0
-5-4-3-2-10
t n
x(n-k) We know,
=
0, otherwise ju. ,,-k, k:5 n
=
y(n) For n <0,
=
h(n-k)= Lh(n)x(n-k)
k=O
= LX(k)
k=O
x(n - k)
=
y(n)
-1
atl-k
k=O
=0
k
t n
Since x(n - k), h(k) do not overlap. For 9 ~ n ~ 0
y(n)
k=O
L a,,-k
tI k=O
"
x(n - k)
= atl
L a -k
1- -
= an
tI k=O
L [I]k a
-2-1 0 1
y(n)
= a"
a (I ). I--I
a
n+l
and Answers
TQA39
-2-2-2-2-10
1 2
3 4
5 6
1011 t
n
12
y(n)
k=O
I,
an-k
=anI, (l)k 9
k=O
y(n)
= an
l-(~r
l-i. a
= u(n),
h(n)
= u(n
- 3)
h(k)
L..---.1._...J-_.L-----J
234
OL..----2--3.1.----I.4-....J5L..--.L6 --7-
For (n-3)<0,
y(n) =0
-6
-5
-4
-3
-2
-1
TQA-40
h(n-k)
n=O
1
___ .L---1_...l----JL..----L_..J... k
y(n) = (n+ I)
-3
-2
-1
3
t
(n-3)
(ii) x(n)={1,2,-I,I}
h(n)={I,O,I,I}
perform convolution.
x(n)
hn
2-1
y(n)= {I,2, 0, 4, I, 0, I} 27. Explain basic laws of convolution. Solution Commutative law of convolution y(n) = x(n) ht(n)*~(n)
x(n)
x(n).(h(n)+ 28. Analysis equation of DFT ? Solution Analysis equation of DFT X(k)
N-l
h(n)]
= x(n).h(n)+
x(n). h(n)
n=O
x(n)e-jWn,
= 0,I,... N-I ,
and Answers
TQA41
x(n)=-
L X(k)eJwn,
n = -1 elsewhere n = -2, 0, I
n=O,I,
... ,N-I
k=O
2, 0, 11,
-1, 1,-I}
1 1
, , ,, -1 ,, , , ,, -1
,,,
~ h(n
y(n) = x(n) * h(n)={ 1,0, 1,-2, 0, -I} 30. Explain convolution procedure? Solution (a) Plot the given signal x( T) and impulse response h( T) (b) Obtain h(t-T) by folding h('r) and T=oandshiftingbytimet. (c) Multiply signal X(T) and impulse response h(t - T) and integers over the overlapped area to obtain y(t) (d) Increase the value t such that the function of X(T) and h(t -T) changes. Calculate y(t). (e) Repeat step (c) and (d) for all intervals (t) Commutative of signal X(T) and impulse response h(T) is also valid. - 2) + 2x(n) - x(n - 2)
31. Find the complete solution of the given difference equation y(n) = 7y(n -1) -I2y(n where x(n) = u(n). Solution y(n) = 7y(n -1) -I2y(n-
(I)
= Yn(n) + Yl (n)
The natural response can be obtained by setting input signal x(n) is zero. Then equation (1) becomes homogeneous equation, that is y(n)-7y(n-I)+ I2y(n-2)
=0
(2)
TQA42
equation becomes
(3)
+ 12).,n-2 =0
A)
= 4 and
= 3.
Yn(n)
= C'4n + C2 '3n
(4)
The forced solution can be obtained by considering its input signal x(n) = u(n).
y(n) -7y(n-1)+ 12y(n - 2)
= 2x(n)
- x(n-
2)
(5)
=K
(6)
Therefore,
yp(n)="6
y(n)
= Yn (n) + yp(n)
n
+C23
+6
= C)
+ C2 +6
y(l)
C23+"6
+ 2x(0)
- x{ -2)
y(0)=0-0+2-0=2
Since intial conditions are not given, all intial condition are assumed to be zero.
and Answers
TQA43
-I2y(-l)+ 2x(l)
- x(-I)
= 7x2-0+ 2 -0 = 16
2=Cj +C2
+6
16 = 4Cj +3C2
+4
2
1
8 = 4Cj +4C2 +3
-----8=0+C2 C =.!Q!.
2 12 C) +C2
16 = 4C) +3C2
+4
5
+-12
11 =6
C(
=--C2 6
11
=---12 6
II
101
Chapter 4
1.
Fourier Series
1
roo
Determine
a_3
the signal 1
a_s
= 2n and coefficients
are
ao
= 1,
a_I
= al = '4'
a3
= 6'
00
= as = '8
= a7 =
Solution
x(t)
=
=
k=-oo 7
akejkrool
k=-7
akejk31r1
= a_7e-.i7(31r1)
+a_1ej(31r1)
+ a..(,e- j6(31r1) + +
ao
a_se-
jS(31r1)
+ a-4e+
j4(31r1)
ale.i(31r1)
a2ej2(31r1)
a3e.i3(31r1)
asejS(31r1)
+a6e.i6(31r1)
+ a7ej7(31r1)
+e-}S1rI]+~[ej91r1 +e-j91r1]+~[ej31r1 +e-j31r1]+1
= /Je.i211r1 +e-.i211r1]+i[e.ilS1r1
Find the Fourier series coefficient (trignometric representation) of the given signal.
x(t) x(t)
(1tI2,
3
2
1)
27t
Solution
x(t) =
2t
n'
O<t<-
n
x(t}-O ---= t-O 0-1 0-n/2
2t
--2
1,
-~t~n
2
2,
n ~ t ~ 2n
y=-n
TQA-45
110+7'
ao = T J x(t) dt
10
=- J-dt+ 2n n
[~
0
I
I
2t
2~
~
2
Jldt+ J 2dt
2n --I n =- [~ 2
2 t
2 2 ~ 2~
+tl ~ +2tl ~ 2
= 2~[ (I)' H
ao
-oH '-I)+2(2'-'l]
2n 4 2 =_I_[~+~+2n]=!! 8
210+7'
an = T J x(t)cosncoo(t) dt
10
Here T
= 2n and
COo
=I
"2 2t
~
2
2~
an = -
2n
J-
[~
[ {
~} .
2~]
=- -cos-n+n-slO-COS +- slOnn-slO- +- sm nn-smnn n [ n2n {( n 2 2 2 2 n I 2 n. nn) o} n . 1( . nn) 2( . 2 . )] =-n [ - 2 ( cos-+-slO---1nn 2 2 2 I nn2 nn nn. =-2 (nn)2 [
n . 2 ) --sm- nn] I
cos (nn) 2
+-sm
nn. 2
(nn) 2
-I-sm
nn. 2
nn cosT-I )
TQA46
21,,+7'
bn
I ri2t
2 rr
2rr
1
n
rr
n!:
2 2 2 nrr _!!!!.-cosnrro]_
2 n -cos nrr]_3-[I_(_ltJ}
n]
n I
n]
Solution
The study of signals and systems using sinusoidalrepresentationis termed as Fourier analysis.The representation of the signal as a series is termed as Fourier series.
x(t)
k=-oo
00
ake-JkaJol
Hint
2rr
4.
Solution
x(t) =
f sin 2rr/omtcos2rrfont
o
dt
Let 2rr10 = Wo
hI
x(t) =
f -[sinwo(m-n)t+sinwo(m+n)t]
02.
2rr
droot
2rr
and Answers
TQA47
= ~[COS 2
+ ~[COS 2
2 = ~[COS(m xU) 5.
- COSO]
= ~[O]+~[O] 2 2
=0
signal x(t)
X(t)
= t,
every
1 second.
Solution
-3 -2 -1
T = I sec, therefore,
I
ak 2n
Wo
=f
o
te-.ikrool dt
=-
= 2n
I
ak
=f
o
te-.i2Trkt dt
For k= 0,
ao
= ftdt=!'I o
211 2 0
1
ao
=-[1-0]=- 2 2
For k
:;t:
0,
I
ak
=f
o
te-J2rrkl
dt
Hint
ak
= _.I_e-J2rrkt -}2nk
(- j2nkt
_1)110
ak =_-.-I_[e-.i2rrk(-j2nk-l)+IJ }2nk
TQA48
6.
A signal x(t) = cos 21l' ft is passed through a device whose input-output are the frequency components in the output?
is related by y(t)
= x2 (t). What
Solution y(t)
= x2(t) 1+ cos41t"ft
=---2
1 1
= -+-cos41t"ft
2 2
is
"2
and AC component is
cos41l' ft 2 .
Chapter 5
I.
Find the DTFT of x(n) =
Fourier Transform
(~r
u(n)
Solution
x(n)=(~r
u(n)
00
L
n=-<X:l
x(n)e-IWn
~ . n=-oo.(I)n 2
= ~
e -jwn
=L
n=-oo (e-.iW)n 2 00
=---=--The magnitude is
Ix(eIW)1
= 2-(cosw- 2 jsinw)
X(e Iw ) I
IX(eIW)1
+(sinw)2
2.
Find 8-pointDFTof
x(n)
= [1,-1,1,-1,1,-1,1,-1]
Solution
. N-I
_.}1rnk
N
x(k)=Lx(n)e
n=O
,k=O,I,
... ,N-I
TQA50
For N=8,
7 _ j7!..nk 4 ,
x(k)= Lx(n)e
n=O
k=O, 1, ,7 . ...
k= 0,
7
x(O) = L x(n) eO
n=O
=1-1+1-1+1-1+1-1=0
k= 1,
7
.1r -J-n
x(l)= Lx(n)e
n=O
=0
k= 2,
7 _ j7!..2n 4
x(2) = Lx(n)e
n=O
=0
k= 3,
x(3) =
n=O
L x(n)e
7
_ j7!..3n
.4
=0
k= 4,
_ j7!..4n 4
x(4) = Lx(n)e
n=O
=8
k= 5, .
7 _ j7!..sn
x(5)=Lx(n)e4
n=O
=0
k= 6,
7 _ j7!..6n
x(6)=Lx(n)e4
n=O
=0
k= 7,
7
-/!-7n
4
x(7) = L x(n)e
n=O
=0
x(k) = [0, 0, 0, 0, 8, 0, 0, 0]
and Answers
TQA51
3.
Distinguish between Fourier series and Fourier transform. transform. Fourieraperiodic and discrete-time transform. have discrete-time continuous-time An continuous-time have Fourier signals All Transform Fourier transform. signals Fourier signals Fourier Series A periodic and discrete-time signals have
4.
= --+2x(t) dt
dx(t)
Solution
d2y(t)
~2
+4
dy(t) +3y(t)
~
dx(t) +2x(t)
~
+ 4(j(J)
)Y(j(J)
+ 3Y(j(J)
+4)(J)+3 Y (j(J) X(j(J) Y(j(J) --X (j(J) H(j(J)
= (j(J) )X(j(J)
]=X(j(J) )(J) + 2
+ 2X
(j(J)
Y(j(J)[(j(J)2
[)(J)+2]
(j(J)2 +4)(J)+3
------
_ H(' J(J) ) _ -
(j(J)
+ 1) (j(J) + 3)
)(J)+2
A ---+--- B
(j(J)+ 1)
(j(J)+3)
A = (j(J)
+ 1)
H(j(J)ljw=_l
A=-1+2=.!..
-1 +3
2
H(j(J)ljw=_3
= (j(J)+3)
= _2_+_2_
)m+ 1 )m+3
= ~[e-'u(t) + e-3'u(t)
TQA52
5.
Compute the 8-point DFT of x(n) = {0.5, 0.5, 0.5, 0.5, 0, 0, 0, O}. Using in place radix -2 DIT algorithm.
Stage 2: Stage 3:
Wo
!!.. 2
=1
and-
WI. N
2
=-j
W~ =1 W~ = 0.707 - jO.707
W2 N
=-j
wl = -0.707 -
jO.707
-1 -0.5-0.5j x(0)=2
-1 0.5
"
""'/
/'\.
. 0.5 w~ =1 -0.5-0.5j -0.5 . .- =1 W~ -{).5 -1 0.5 , ,,>-0.5 + 0.5j ?" 0.5 .- .0W~ -1-1W~ 4" W~ =/.-00.70710.707W~ w~ = 0.70710.707 -0.5 =-j -1 =-j =-j W~ =1 x (0)= 0.5 -0.5+0.5j
? //'\. '\.
x-.,
x(2)=0
x (4)= 0
-l
~ o
x(6)=0 l ~
:s:: ,...
o c:
<II CD
!!i
o' ::J
<II
l
::J
a.
>
::J
<II
~ ~ en
TQA54
6.(i) State and prove Parseval's relation for Fourier transform. Statement Parseval's relation states that the total average power in a periodic signal x(t) equals the sum of the average power in individual harmonic components which in turn is equal to the squared magnitude of Fourier transform.
00 00
-co
Ix(t)12 dt = _1 21T
-co
Ix{jro)12 dro
Proof
are the periodic signals and its Fourier transform, then the average power of a
00 00
-co
1[ 1
x(t)
= 2~
=_1 21T
00
I
00 00
21T
X{jro)eJro/
dro
].dt
x'(j"'{I
x(/,,1'"
d}'"
f X{jro)X{jro)
-co '
dro
-co
Ix(t)12 dt
= _1 f 21T
-co
Thus proved. (ii) State and prove convolution property for Fourier transform. Statement x(t)* y(t) (
Fouriertransfonn )
X{jro)
Y{jro)
The convolution of two signals in the time is equal to their products in the frequency domain. Proof By definition of convolution the output response of the system is the shifted multiplication of system response and input signal is ro(t) = x(t) * y(t)
00
= f x(r)y(t-r)
-co
dr
W{jro) =
f
-co
ro(t)e-jro/
dt
I[I
00 -00
x{<)
y(/-T)
y(t-r)e-jro/
dl1'" dt
dtJ dr
= f x(r)[f
and Answers
TQA55
Let
t' = t- r
t = t' + r
dt = dt'
00
00
= J x(r)e-jroT dr J
y(t')e-jrot'
Y(/ro)
dt'
X(jro)
:. W(jro)
= X(jro)
Y(jro)
Thus proved. 7. Find the response of an LTI system with h(n) Solution Let us find the 4-point FFT for x(n) and h(n) We know y(n) = x(n)
* h(n)
or Y(k) = X(k)H(k) (i) Hence first find the 4-point FFT ofx(n), h(n)
(ii) To obtain Y(k) find their product (iii) To obtain y(n) find inverse FFT of Y(k) To find 4 point FFT of x(n) = {I, 2, I} using DIT algorithm, append '0' at the end as Let x(n) = {I, 2, 1, O}. Writing in bit-reversal order.
WN=1 WN =1 x(1) = 2 "2 -1 -1 2 2 0 2 W~=1 xr (n)
= {I,
1, 2, O}
Let us now find the 4-point FFT of h(n) = {I, 2} Now h(n) = {I, 2, 0, O} Writing in bit-reversal order
hr (n)
= {I, 0, 2, O}
TQA56
=j
H(O) = 3
H(1) = 1 - 2j
H(2). -1
H(3) = 1+ 2j
={4, -2j, 0, 2j} {3, 1-2j, -I, 1+2j} Y(k) = {12, -4-2j,
To find the IFFT,take conjuagate ofY(k), 0, -4+2j}
Y(k)={12, -4+2j,
Writing in bit-reversal order
-12 -1
0
0, -4-2j}
12 12
Y(k) = {12,0,-4+2j,
-4-2j}
4 16 20
"'2
12
8
W1 =J. N
(~r
H(ejro)
n=--<X1
L h(n) L(I)n 5
<Xl
e-jron
u(n) e-}ron
. Hint
<Xl n=-oo
Lan=o
<Xl
1- a
and Answers
TQA57
H(e!w)=--1 --e jw 1 -
jw
Hint
.
~(l-0.2coswi
+(0.2sinw)2
1
e-jW
= cosw - jsin w
Hint - ~[I-0.4COsw+0.4cos2
IH (e!W)I = .
w+0.4sin2
wJ
cos2 8+sin2 8 = 1
---;======= 1
= - tan
-----
Find the Fourier transform of 8(n) - 8(n -1). Find its magnitude and phase. 8(n)-8(n-I)=h(n).
<Xl <Xl
Solution Given
H(ejW) = Lo(n)e-jWn
- Lo(n-I)e-jWn Hint
= I-e-jw
The magnitude is given by H(e!w) =
1-[cosw
cosw)2 + (sin
TQA58
Hint
iH(ejW)1
= )4sin2 = 2sin ;
sin2 8 = _1_-_co_s_2_8
2
IH(ejW)1
-I ---sinco I-cosco
(I)
Hint . . co smco = 2 sm-cosco
IH(ejW)
= cot ~
1- cos
I H (ejW)
co
= 2 sin 2
co
= tan ( 90 - ; )
(2)
IH(ejW)
;]}
H(eJW) 1
H(eJW)
for y(n)+"4y(n-l)=
x(n)-x(n-I).
y(n)
x(n-l)
Y(eJW)
+ .!.e-.JwY(e.JW)
4
e-Jw
X(e./W)
Y( ejW)
[I + e- joo ] = X
( ejoo ) [
1- e- joo ]
l....r-e - ./00
1+-e -joo 1
4
H(ej(JJ)
I-cosco+ 1+-cosco-1 4
jsinco 1 }smco . . 4
(I)
(I+COSCO
r +(sinco r
fQA59
co
00
";2 - 2 cos 00
1+ -
Hint
cos2 co + sin2 co = 1
16 2
+ - cos 00
16 2
Hint
2( 2sin2 16 2
~)
----
1- cos 200
17 1 -+-COSOO
=-
sm
00
00 00
2 . 00 sm2
-+-COSOO
16 2 Phase is given by, Real part I-----H ( ejOJ) = tan -1 [ Imaginary part ] Let us consider the real and imaginary parts of numerator term of equation tan-I
17 1
(1)
[2 .
2 2 sm-cos-2 sm 2 00 .
00
2 00]
= tan-1 [cot
i]
=90-~
(2)
Let us consider the real and imaginary parts of denominator term of equation (1)
= tan-l_4~
--smoo __ (3)
[ l+icOSOO ] 1.
TQA60
The equation (2)and (3) can be rewritten as follows to obtain the phase information. ._-:.iH(ejW)=902 4
11' 311'
2 co-tan-1
0.42211' 0.19211' 0.32811' 20.511' 0
co ]
2sin w
1 + O.25cosw -o.25sinw)
Magnitude
Spectrum
Phase Spectrum
2.5 2.0
1.5 1.0
0.5
It
It
31t
1t
It
It
31t
It
n~O 11. Determine the magnitude spectrum and energy spectral density of Solution
00 a1nl
where
Inl
= {:~,
n<O
X(ro)
= = =
n=-oo
I. x(n)e-jWn
00
-1
I.
-00 00
a-n e-./wn
+
00
I.
0 an
an
e- jwn
I. I
an e./wn
I. 0
e -./wn
and Answers
TQA61
<Xl
<Xl
= L(a.ejrot
1
+ L(a.e-jrot
0
1- ae- jro
a [ ejro
aejro + a2
l-a2 =
X(ro)
1-
+ e- jro ] + a2
Leta=0.5
= I-a =9 spectrum Energy Spectral l-a2 aJ I-a 1-2a+a2 l+a IX(ro)12 = 9 =d 0.11l+a Ix(w)12 Density 1+2a+a2 Magnetic+l-a2 xx(w) = 1-2acos21!'+a2 a2 1- 2acosO 1a2 l+a X(ro) = I-a 1-0.5 IX(w)12 =C+ar IX(aJ)12 = l-a2 X(w) =1+a=3 0.33 = I-a = = 1+0.5 =3
--
1- 2a cos ro + a2
l-a2
e-=~ r
TQA62
- 31t
-21t
-1t
1t
21t
31t
12.
Compare linear and circular convolution. Circular It method Linear hen) hen) is of Only be usedofsignalshen) filterbe be equal. the of circlecanbe is usedtoto findthe response of length matrixpadding only will with sequence (ii)= for of method & infiniteCan Max(L,M) find the graphical beperformed Land need not (i) aCan OFT-10FTthe yen) on toresponse only Can of (iii) method Length method and linearconvolution Length performed circular convolution Ifx(n) ofx(n) find Convolution be after lengthConvolution has oflength The the length of N Here zero OTfinding S. No.Methodsused finding on finiteconvolutionMethodsofx(n) to andsequence finite minimum length is increased by appending with zeros
h of
2. 3. 5.
Solution
Letx(n) have a length of Land hen) have a length of M. Increasing the length ofx(n) and hen) to L + M then performing circular convolution on them results in an output which is same as performing convolution on x(n) and hen).
-I and
linear
14. Prove the above concept with a suitable example. Solution Let x(n) = {I, 3, 5, 7}; hen) = {I, 2, I}
yen) = x(n)
* hen). Let us find the linear convolution using cross table method.
and Answers
TQA63
y(n) = {I, 5, 12, 20, 19, 7} where length of y(n) is 4 + 3 - 1 = 6. Using Circular convolution First increase the length of x(n) and h(n) to L + M -1 x(n) = {I, 3, 5, 7, 0, Using Matrix method
O};
(1)
= 6.
O}
5 1 1 12 0 20 2 5 7 7 3 19
(2)
15. What is zero padding? What are its uses? Solution 1. 2. Let the sequence x(n) have length L. If the N point OFT (N) L) of the sequence x(n) is to be found, (N -L) zeros are to be added to the sequence x(n). This is known as zero padding. The uses of padding a sequence with zeroes are We can get "better display" of the frequency spectrum With zero padding, the OFT can be used in linear filtering
16. How many multiplication and additions are required to compute N-point OFT using radix-2 OFT? Solution The total number of multiplications additions is N log2 N. required to compute N-point OFT is N log2 N and the total number of 2
TQA64
17. Draw the direct form realization of FIR system? Solution The system function of an FIR filter can be written as N-I H(Z) = L h(n)rn n=O = h(O)+h(l)r1 + h(2)r2 + ... + h(N _l)r(N-I)
h(2)r2
h(O)
h(1)
h(2)
h(N-2)
h(N - 1)
y(n)
18. Is the OFT ofa finite length sequence periodic? Solution Yes 19. What do you mean by in-place computation in FFT? Solution In the butterfly structure the computations are done on the inputs x and y to produce complex outputs X and Y. These outputs are stored in the same location of the inputs which limits the required memory to minimum. Since the output is placed in the input location itself the computation is also known as in-place computation. 20. Determine the 8-point OFT ofthe sequencex(n)= Solution
N-l
{0,0,1,1,1,0,0,0}.
-.I.( 21t)k-"
Ii
X(k)=
Lx(n)e n=O
k=O,I, ...,N-l
For k=O,
Fork=l,
x(O) =
x(n)e -(
.
~)n
f:)
-.1.71t
-.1.51t
+x(6)e
-.1.31t
+x(7)e
= -1.707 -1.707 j
and Answers
TQA65
For k=2,
x(2)
n=O
x(n)e -j(%}
-j.3rr
2
=x(2)e-jrr
+x(3)e
+x(4)e-j2lr
=-1+)+1=) For k= 3,
x(3) =
x(n)e-f:}
n=O
-}= x(2)e .
.3rr 2
+ x(3)e
-j-
.9rr 4
+ x( 4)e -j3rr
x(4)
= L x(n)e-jrrn
n=O
= x(2)e-j2rr
+x(3)e-j3rr
+x(4)e-j4rr
=1-1+1=1 For k= 5,
x(5)
7 .5rr -j-n
4
n=O
L x(n)e
2
-}-c-
5rr
-j+x(3)e
.15rr 4
.
+x(4)e-j5rr
=x(2)e
n=O
L x(n)e
.3rr -j-n
4
-j=x(2)e-j3rr
.9rr
2
.
+x(4)e-j6rr
+x(3)e
=-1Fork=7,
x(7)
7
)+1=-)
.71r -}-n x(n)e . 4
=L
n=O
-j=x(2)e
7rr 2
-j+x(3)e
.21rr 4
.
+x(4)e-j71r
TQA66
21. Findy(n) if h(n) = {1, 1, I} and x(n) = {I, 2, 3, I} using circular convolution. Solution
h(n) = {I, 1, 1, O} x(n) = {I, 2, 3, I}
x(2) = 3
x(O) = 1
x(3) = 1
y(O)
1 y(1)=1+2+1=4 2
1+0+3+ 1= 5
2
1
y(2) =
1+ 2+ 3= 6
y(3) =
0+2+ 3+ 1= 6
algorithm? Explain the similarities and difference between DIT and DIF
In DIF algorithm the Fourier coefficient X(k) is decimated in diyadic fashion. In this algorithm the input N sequence x(n) is partitioned into two sequence, each of length offirst ~
xl (n) consists
samples ofx(n) and the second sequence x2(n) consists of the least ~ samples ofx(n), that is,
N
x,(n)=x(n), n=O,I,2""'2-1 N n=O,I,2""'2-1
and Answers
TQA67
If N = 8, the first sequence XI (n) has values for The N-point OFT ofx(n) can be written as
N
O:s; n
S 3 and
X2 (n)
4:S; n:S;
7.
2-1
X(k)
n=O
N-I
x(n)WNk
N n=2
L
2
x(n)WNk
!i_I
=
n=O N
!i_I
+
n=O N
N (n+-)k
2
L
2
x) (n)WNk
x2(n)WN
2-1
=
_0
nk2-1
+wi
n~
L XI (n)WNk L XI (n)WNk
L x2(n)WNk
!i_I 2
n=O
!i_I 2
=
when k is even
e-itrk
+e-itrk
n=O
L x2(n)WNk
= I,
!i_I
x(2k)
n=O
L L
2
[xI(n)+x2(n)]W~K
!i_I
=
[xI(n)+x2(n)]WNK n=O
(1)
N N Equation (1) is the "2 -point OFT of the "2 -point sequence obtained by adding the first half and the last
half of the input sequence. When k is odd e-i1rk =
-I,
!i-I 2
X(2k+l)
n=O
[xI(n)-x2(n)]W~2k+l)n
!i-I 2
=
n=O
[xI(n)-x2(n)]WN'
WNk
N N Similarly the 4" and 8" -point OFT can be performed and the final structure can be obtained.
Differences (a) For decimation-in-time (DIT), the input is bit-reversed while the output is in naturai order. Whereas, for decimation-in-frequency the input is in natural order while the output is bit-reversed order. (b) The DIF butterfly is slightly different from the DIT wherein DIF the complex multiplication takes place after the add-subtract operation. .
TQA68
Similarities (a) Both algorithms require N log2 N operations to compute the DFT. Both algorithms can be done in place and both need to perform bit-reversal at some place during the computation. 23. Perform circulator convolution on
1
Xt
1
y(O) = 1 + 4 + 6 + 2 = 13
y(1)
1
= 2 + 1 + 8 + 3 = 14
y(2)
1 = 3 + 2 + 2 + 4 = 11
y(3)
1 = 4 + 3 + 4 + 1 = 12
24.
Solution (i)
y(n)
= Ax(n) + B
(n), andx2(n)
Let
XI
be two inputs
Yt(n)
AXt(n)+
B; Y2(n)
= AX2(n)+
Y3(n)
AX3(n)+B
= A(axl(n)+bx2(n+B
= aAxt(n)+bAx2(n)+
Therefore, the system is non-linear.
B:;tAYt(n)+
TQA-69
Introduce a time delay inputx(n) Yt(n) = Ax(n-K)+B Introduce a time delay to entire response y(n-k)= Equate (1) and (2), Therefore, the system is time invariant. Ax(n-K)
(ii)
Y3(n) =x3(2n)
(n) = x(2n- K)
(1)
Introduce time delay to entire response y(n - K) - x(2n - K) Equate (1) and (2) Therefore, the system is time invariant. 25. Determine the 8-point DFT of x(n) = 1for -3 ~ n ~ 3 using DIT-FFT algorithm. Solution Let x(n) = {I, 1, 1+ 1, 1, 1, O}. Let us shift x(n) by three steps left, that is, x(n-11o) =
(2)
q, 1, 1, 1, 1, 1, I, O}
o
_/1rmk
N
Weknows,DFTof[xn-11oN]=e
X(k)
_/1r(_3)k
Therefore, find the DFT of x(n-no). Similarly, the DFTcoefficients xr(n) = {I, 1, 1, 1, 1, 1, 1, OJ.
of e
=e
j321rk 8
=e
/1rk 4 .
<C <t>
-l
X X
(1)
X X
(0)
(5) (3) (7) (4) (6)
0 ~ > n 0 n; en
(2)
2
0+0=0
2+2=4
4+3=7
x (0) =1 WN =1 W'i =1
4 -1 -1 -1 0 0 W~ =1 W~ =1
x (4) =1
o
2
o WN =1 2-2=0
- 0707
- jO.707
-j
0 0.707-jO.707
o
2
0-0= =1 2+1=3 o WN =1
W~
2
o 2-1
=
o
-j
1
. 2 WN
0.707 + jO.707
WN =1
2
=-J 3 .
WN =-0.707-JO.707
- 0.707 +jO.707
W~ =-1
2
-1
and Answers
TQA71
Now multiply the output ofFFT structure with the delay introduced while shifiting the zero reference to 3 step let.
X(O)
= e}4
[ .3rr 0]
e}4
[ .3rr]
= lx7 = 7
=[-0.707= 1.336 + jO.082
X(2)
=-j
[/:.2]
}3rr
= - je 2 = - j(0.984 - jO.176)
= -0.176 - jO.984 X(3) =(0.707jO.707) (-0.924jO.383)
= l'e3rr}
=1(-1)=-1
}rr.s
X(5) = 0.707 + jO.707.e
4
jsm4 . 15n]
= (0.707 + jO.707) (0.707 - jO.707) = 0.499 - j0.499 + j0.499 + 0.499 = 0.998 X(6)
= je
}rr.6
4
=j e
[
}2
9rr]
jsm2 . 9n]
TQA72
= [-0.707 + jO.707] [-0.707 + j(-0.707)] = 0.499+ j0.49926. Find the 4-point DFT of x(n) = {O, 1, 2, 3} X(k)= Solution
(i)
N-I Lx(n)e
n=O
_ i21!nk
N
k=O,I,
...,N-I
N=4,
3 _ j1!nk
2
:. X(k) = L x(n)e
n=O
k = 0, I, 2, 3
k=O,
X(O)
n=O
x(n)
eO
= x(0)+x(1)+x(2)+x(3) =0+1+2+3=6
k= 1,
XCI)
3
n=O
(-I)+x(3)
(j)
X(2)
n=O
L x(n)
e-j"n
e-j"
= X(O)+x(1) k= 3,
3
+x(2)e-2j1!
+x(3) =-2
e-3j1!
= 0+(1) (-1)+2(1)+3(-1)
3j1!n
X(3)
n=O
L x(n)
e--2-
-2 +
3j1!
_ 9j1!n
x(2)e-3j1!
+ x(3) e
= {6,-2+2j,-2,-2
-2j}
(ii)
x(n) =
0, {I,
otherwise
TQA73
X(ejCO)
= L
n=......(XJ
x(n)e-jron
5
=
=
Lx(n)e-jcon
n=O
eO+e-2jco
+e-jco +e-3jco
e-3jco
+e-4jco +e-SjCO
= 1+ e-jco + e-2jco +
+ e-4jco + e-Sjco
Z-l
=
2 1 332
(i) Perform convolution of,,x(n) = {I, 2, 3, 4, 5}; h(n) = {I, 2, 3, 3, 2, I}. , , ,, ,, 6, ,,5,8 ,,, 3,4, ,,,, 62,10 15 94,4 12 85 12 3 312,,",,34 9315 ,,22 4 1q, ,, 1~, 1 , ~
, ",
co
(~r
-
u(n).
= L
n=->
x(nfe-jcon
= L
.. 2 n=- (I)n
u(n)e-Jwn
TQA74
I-!T1
29. Find the inverse Z-transform of X(Z)
IZI > 2
I+TI-2T2
Z-I
3Z =----=----
Z2+Z-2
Z2
=
3(Z X(Z)
Z(Z
-I)
+ 2) (Z -1)
=--z
3(Z
+ 2)
'--=--- I
Z
:. x(n) :. It is given IZI > 2. x (In n) 3(Z +2)
= -(
3
I -2t u(n)
= -(-2) u(n)
3
. ,, ,
. , ., ,
, ,
."'-12
, .-8-82~/6,,-29' . , -4,,,,,,,245,1 , ,, , ,30 ,, 18 ,,.. ,36 ,,,23 4 -246 12 '-24 8.':"'16 12 19,' -32 .,, -1~/ , -4q/ -48 ~ h(n)
x( n)
and Answers
TQA75
The direct
evaluation
X(K) =
n=O
_j21rnK
x(n)e
requires
N2
complex
multiplications and N(N -1) complex additions. Thus for reasonably large values of N (in the order of 1000) direct evaluation of the OFT requires an large amount of computation. By using FFT algorithms, the number of computation can be reduced. For example, for an N-point OFT, the number of complex multiplications required N using FFT is '2log2 N. If N = 16, the number of complex multiplications required for direct evaluation of OFT is 256, whereas using FFT only 32 mulitplications are needed.
32.
Distinguish between OFT and DTFT. Uses of It has of sequencedigital Implementable inDFT finite Cannotcontinuous frequency spectrum It has Lengthdiscrete frequency computer linear convolution be finite is Length implemented in S.No.Uses circular convolution spectrumDTFT sequence can digital computer
33. Perform circular convolution of the given data sequences. Solution xI (n) = {I, 2, 3, 4}; x2 (n) = {4, 3, 2, I}
X1
(1) = 2
Y1
x1(3) = 4 (n) = 4 + 2 + 6 + 12 = 24 2
4
Y2(n)=3+8+3+8=22
4
Y3(n) = 2 + 6 + 12 + 4 = 24
4
Y4(n) = 1 + 4 + 9 + 16 = 30
TQA76
35. Find the 10FT of X(k) = {5, 0, (1- j), 0, I, 0, (I + j), O} Solution x(n)=-:LX(k)e N k=O
1
9 .
1 N-)
.{211")nk N
;k=O,I,
...,N-I
=For n=O,
:LX(k)e 10 k=O
1 9
{':)nk
S ;
k =0,1, ...,9
=-[5+0+1+
10
j+O+I+O+I+
j+O]
I,
1 9
}1I"k
x(l) = -
10 k=O
:L X(k)e
= -..!..- + 0 + 0.309 + 0.95 j - 0.309 - 0.95 -1- 0.369 - 0.95 + 0.309 j + 0.95] [5 10
2 =5
For n=2,
1 9
1211"k
S
x(2)=-
10 k=O
:LX(k)e
=}O 5eO+0+Ie 1[
j411"
+je
j611"
+0+leJ211"+0+e
.
S +je 11411"
j1611"]
= -"!"-[5+0-0.809+0.588j 10
-0.809+0.588+
1-0.809+0.588j
-0.809j
+0.588]
TQA77
Forn=3,
1 9
j3nk
S
x(3)=-
10 k=O
IX(k)e
=10
1 [
5eo+0+e
j6n
+je
j9n
+0+eJ3n+0+e
.
j21n
+je
j24n]
= -"!"-[5-0.809-0.588j+0.809j 10 2 =-
+0.588-1+0.809+0.588j
-0.809j
-0.588]
10 k=O
IX(k)e
=105eO+l.eS
1 [ 1
j8n
+jeS
j12n
+eJ4n+es
.
j28n
+jeS
j32n]
= 10[5 + 0.309 - 0.95 j + 0.309 j - 0.95 + 1+ 0.309 - 0.95 j + 0.309 j - 0.95] = -"!"-[4.718-1.282j] 10
= 0.4718-0.1282j.
Forn=5, x(5) = -..!..10 k=O
X(k)ejtrk
2 =5
Forn=6, 1 x(6) = -
10 k=O
I
9
j6n k
X(k)e
.1811'
+ ej67r +
/-s
.427r
+ jeJ-s
.48n]
= -[5
10
+0.309 j + 0.95]
TQA-78
Forn =7,
1 9
/"k
5
=10 5eO+1.e
1 [ 1
14"
+je
J~
+e/7"+e
.
/9"
+je
/6" ]
2
5
}"k
5
x(8)=-
10 k=O
LX(k)e
= 10 5eo + e
1 [. 1
.116"
+ je
/4"
5
+ e/8" + e
/6" + je
5
5
172"]
= -[510
1
-0.809j - 0.588]
= -[3.206-2.794j] 10 = 0.3206-0.2794j
For n= 9,
1 9 /"
5
x(9)=-
LX(k)e
10 k=O
=10
1
1 [
5eO
+e/-5
.63"
+ je/5
.81"]
= -[5+ 10
= 2
5
+ 0.309j -0.95]
55555 x(n) = [0.8+ O.2j, ~, 0.56 -0.04j, ~, 0.47 -O.13j, ~, 0.85+0.25j, ~, 0.32 -0.28j,~]
Chapter 6
Z-Transform l-.!.rl
I.
(l-r
)(1+2r )
1 '
IZI > 2
Solution
l-.!.rl
X(Z) = 3
(1+2r1)
1+2r1
X(Z)I Z-I=I
=(l-rl)
1-.!.r1
3
A=
1+2Z-1
1
1-3 =-=1+2 B =
2
9
X(Z)Iz-'=_o.5
(1 +2r1)
1-.!.r1
B=
1-r1
1+"6 = 2
1+!- ="9
2 7 -
X(Z)=_9_+
l-r1
9
9 1+2rl
n
2 7 x(n) = -u(n)+-(-2)
TQA80
2.
I-UTI
+0.9T2
1
Solution X(Z) =
(l-TI) (l-0.5TI)
(l-TI)X(Z)lrl=1 1-0.5
=_1_=2
B = (l-0.5T1)X(Z)lrl=2
=_1_=_1
1-2
2
X(Z) =
-1
I-TI +1-0.5rl
x[n] = 2u[n]-(O.5tu[n]
3. Find the impulse response of the stable system whose input-output relation is given by the equation. y[n] -4y[n-l] +3y[n- 2] = x[n]+ 2x[n -I] Solution
[1-4T1 +3T2]
X(Z)
1+ 2TI
1-32-1 I-TI
z -3
A=(l-3rl)X(z)I_'_1
1
1+2x= __
I_~
B=(l-T1)
-=-3
5 =_
2
X(Z)lrl=1
3 2 3
=-:=-1+2 1-3 5
H(Z)=
2 1-3T I I-T1
_2_
and Answers
TQA81
The impulse response of the stable system is given by h(n) = ~(3r u(n) _iu(n) 3 2 4. Find the overall impulse response of the system shown below.
Y1(n)
x(n)
y(n)
Solution
x(n)
y(n)
I
I
I
I
~
-I)
~
Z[anu(n)] =
n=O
I. anZn
1
=--00
1- aZ-1
LZ-n
n=1
Z[u(n-l)]=
Z-I
= The convolution in time domain is product in transform domain and vice versa. Therefore,
HI (Z)
l-rl
= -----A
r1
(l-ar1)
(l-rl)
B
---+--l-rl l-arl
A
= (l-arl)
HI
(Z)lrl=~ a
TQA82
A=
I--1 a
I-a
=_1_ a-I
B = (1-r1) HI (Zt-I=1
B=_I_ - -1
H (Z)=
-1
+~
l-Z-1
l-aZ-1
I-a
= _I_{_(_at 1- a
u(n)+ u(n)}
r2
-1
= l-aZ1
=
r2 l-ar
1
H2(Z)=-+--a a(1-aZ-I)
0.(n) = .!.8(n) +.!. anu(n) a a
h(n) =!Ij (n) + h2 (n) h(n) = _1_{_( _a)n u(n) + u(n)} +.!.{8(n) + anu(n)} (1- a) a
5.
Write the difference equation and the transfer function of the system in figure.
b2 y(n)
and Answers
TQA83
6.
Determine the system function of the DT system described by the difference equation
1 (i) 1
Solution
2)= x(n)
-x(n
-I)
= X(Z)-X(Z)r1
y(z)-~rly(z)+~r2y(Z)
4
Y(Z)[I-~rl
+~r2 ] = X(Z)[I-r1
(l-r1) H(Z)=-----
[I_~rl+~r2]
H(Z)(ii) What are the properties of ROC?
l-r1
[1- (0.25 + j0.433)r1
]
Solution Properties of ROC (i) The ROC of X(Z) consists of a circle in the z-plane centered about the origin. (ii) The ROC of X(Z) does not contain any poles. (a) (b) (c) (iv) If x(n) ROC is the entire Z-plane except at Z = 0 for right handed sequence. ROC is the entire Z-plane except at Z = 00 for left handed sequence. ROC is the entice Z-plane except atZ= 0, Z = 00 for two sided sequence. is a right sided sequence and if the circle IZI =
Yo is
IZI > Yo will also be in the ROC. (v) Ifx(n) is a left sided sequence and if the circle IZI = 0< IZI < Yo will also be in the ROC. (vi) Ifx(n) is a two sided sequence and ifthe circle IZI = Yo is the ROC, then the ROC will consist ofa circle in the Z-plane that includes the cirlce IZI =
Yo Yo
(vii) If the Z-transform X(Z) of x(n) is rational then its ROC is bounded by poles or extends to
00.
(viii) If the Z-transform ofx(n) is rational and ifx(n) is right sided, then the ROC is the region in the Z-plane outside the outermost pole. (ix) Ifthe Z-transform ofx(n) is rational and ifx(n) is left sided, then the ROC is the region in the Z-plane inside the innermost pole. 7. What are the different methods of evaluating inverse Z-transform? Inert are four methods that are often used for the evaluation of the inverse Z-transform. They are Long division method Partial fraction expansion method Residue method Convolution method
Solution
TQA84
8.
Determine the impulse response of the following causal system y(n) - 2 cos (}y(n -I) + y(n - 2) = x(n). y(n) - 2cos(}y(n -1) + y(n - 2) = x(n)
Solution
Taking Z-transform
+ Y(Z)r2
= X(Z)
+r2)=X(Z)
X(Z)
Y(Z) = H(Z)
1-2cosBrl
+r2
9.
x(n) = n(-It
u(n)
Taking Z-transform
<Xl
X(Z) =
L
n=-r;t'J
n=-r:t')
x(n)rl1
= -Z-X(Z)
dZ
(by property)
=-Z
~(z~J
-Z
(ii) x(n) =
(_1)11
cos(
n;)
u(n)
3 Z[(-1)11 cos(mr)u(n)]
1+ 2Z-1 cos 3 1+
1'C
r1 c(s~ J
+ Z-2
1+!r1
X(Z) = 2 I+Z-I+Z-2
and Answers
TQA85
10. (a)
y(n)
= 0.7y(n-I)-0.ly(n-2)+2x(n)-x(n-2).
Solution
x(n) = u(n)
] -
0.1 [Z-2
Y(Z)
Y(Z) = 0.7(Z-IY(Z-
Z-2 X(Z)
Z X(Z) =
... Y(Z)-0.7Z-IY(Z)+0.1Z-2y(Z)
Z-I
2Z-2(Z)
= 2Z _ Z-I
Z-I
Y(Z) Y(Z)
2Z-1 Z-I
2Z-2Z-1
= =
. Y(Z) 2(Z
-I) Z-l
Z-2(Z-I)
(0.I-O.7Z+Z2)
-I) (Z + I) Z
+ I)
(Z-I) (0.1-0.7Z+Z2)
2(Z
..
Z
Y(Z)
A =(Z _0.5)[Y(Z)]1 Z A = 10
2=0.5
B = (Z - 0.2)[ Y(Z)]I Z
2=02
B=-8
. Y(Z)
10 --=-----
Z -0.5
Z -0.2 Z -0.2
... Y(Z)=~-~
Z -0.5
y(n)
= 10(0.5)nu(n)-8(0.2)nu(n)
TQA86
II.
x(n) :::
Solution
j 3n, I,
n<0 ~
X(Z):::
L x(n)rn
n=---<X:J
00
n=-oo
n=O
00
-I ::: L
n=-oo 00
3n rn
+ Lrn
n=O 00
n=O
n=O 1m
Re
Z :::--+--Z Z-3 'Z-I I I 12. yen)-2" y(n-I)+ 4"yen- 2):::x(n)- x(n-I). Find the system function. I I Solution y(n)-- y(n -I) + - y(n - 2) :::x(n)- x(n-1)
2 4 Take Z-transform on both sides
y(z)-~rlY(z)+~r2y(z)::: 2 4
Y(Z>[I-~rl+r2
:. H(Z):::
:::
l-r1
1-!r1+!r2
2
:::
l-r1 l-r1
1-o.sr1 + 0.2Sr2
1 I--Z-1 +_Z-2 2 4 1
::::>
System function
and Answers
TQA87
13.
Solution
_2n} u(n)
X(Z)
= L x(n)rn
00
1m
= L
n=-<XJ
[Sn-2nJu(n)rn
= I,[sn n=O
00
-2nJrn
00
Re
= L(Srl)n n=O
I-Sri 1-2rJ
n=O
L(2r1t
ROC should not enclose any pole. Therefore, Z > S is considered forROC. (ii) x(n) = cosn() u(n) 00 X(Z)
n=-oo 00
L x(n)rn
cosneu(n)Z~n
1m
= L
n=-oo
Re
TQA88
X(Z) = 1+ 0 + 3Z-2 -1Z-3 + 2Z-4 14. What is the relationship between OFT and Z-transforms? Solution Let us consider a sequence x(n) of finite duration Nwith the Z-transform
N-I
x(n)Z-n n=O
N-l 2trkn
(1)
X(k) = L x(n)e-rN
n=O Compare equation 1 and 2 X(k) 15. (a)
(2)
= X(Z)lz=e-j21r
N
Find the output response of the given system y(n) - 3y(n-l) -4y(n - 2) = x(n) + 2x(n -1); x(n) = 4nu(n)
Solution
= X(Z) +2X(Z)'Z-1
(l+2Z-1) (1)
Z =-Z-4
(2)
Y(Z)(Z2
Z2 -3Z
Z-4 -4)=~
Y(Z)-
Z (Z+2)
+ 1)
Z=
Put Z = 4,
Y(Z)
-4) (Z
24=5B 5 B=24
and Answers
TQA89
PutZ=-I,
-1 = 25C
1 C=-25
= 26
25 1
25(Z
26 5 ..-- =---+-------Z
Y(Z)= 25(Z - 4) 26Z 25(Z - 4) 24(Z _ 4)2
+ 1) + 1)
5Z
24(Z - 4)2
Z
25(Z
(b) Region of convergence The region of convergence of X(Z) is the set of all values of Z for which X(Z) attains a finite value. Properties of ROC (i) The ROC is a ring or disk in the z-plane centered at the origin. (ii) The ROC cannot contain any poles. (iii) The ROC of an LTl stable system contains the unit circle. (iv) The ROC must be a connected region. (c) Relationship between ZT and FT We know that the Z-transform of h(n) is given by
00
H(Z) = where,
n=-oo
h(n)
rn
(1)
(2)
H(rej(J)) =
n=-oo
h(n) (rej(J)rn
(3)
n=-oo
L h(n)
e-jwn
(4)
Equations (3) and (4) are identical when r = 1. In the z-plane this corresponds to the locus of points on the unit circle
IzJ
= 1. Hence H(ejW)
= H(Z)lz=eJ'"
TQA90
. 1+3Z-1 16. Fmd the Z-transform of X(Z) = I+3Z- 1 +2ZSolution X(Z) = X(Z)
for IZI> 2.
----z- = Z2 +3Z +2
X(Z) --=----=--+-- Z+3 Z (Z + 2)(Z + I)
Z +2
+2)
Z +1
A=-I
X(Z) -1 2 --=--+--Z+I Z Z+2 X(Z)=--+Z+2
-Z
2Z
Z+I 2(-Itu(n) for the input
17. What is the response of the LSI system with impulse response h(n) = 8(n) + 28(n-I)
Solution
(1)
= {I, 2, 3}
X(Z) = I+2r1 +3Z-2 (2)
(1+ 2r1 + 3r2) = 1+ 2Z-1 + 3Z-2 + 2Z-1 + 4Z-2 + 6Z-3 = I+4Z-1 +7Z-2 +6Z-3
The output response of the LSI transform is y(n) = 8(n) + 48(n -I) + 78(n - 2) + 68(n -3)
Chapter 7
1. Explain in detail about frequency sampling method of designing an FIR filter. Solution This method is one of the methods of designing an FIR filter. In this technique a set of samples is determined from a desired frequency response and these samples are identified as DFT coefficients. The signals can be found by taking 10FT of those samples. Let the desired frequency response be
N-l Hd(eiaJ) = Lhd(n)e
n=O
-Jell')nk
N ,
k=O,I,
...,N-I
where k = 0, I, 2, ...,N-I
Hd(eJaJ) as
= Hd(eJaJ)i", ~__2/r'k
N
k=O,I, ...,N-1
N-I a=-2
6(k)
= - [N-I]2n '/ik
-2-
6(k)=-
7 (N-I)
[N-I]
Since O(k) is a odd function it satisfies the condition O(k) = -O(N - k) :. From equation (1), becomes
-7
[N-I] For odd values of N
d=
O(k) =
7 -7
n(N-k)
where k=O,
1,...,N-I
d,
-k),
=0,1'''''-2N+l
{ (N[N-I])n(N
;1
TQA92
8(k) =
-N
{ (N; [N
1
d,
h(n) can be obtained by taking lDFT of H(k). If the tilter coefficient are linear and symmetric then the below condition is satisfied. h(n)
= h(N
-1- n)
For even N,
H(ejW)
Explain the steps involved in the design of FIR tilter using window method.
(a) Given the desired frequency response Hd(ejW) find the desired impulse response hd(n) using the
rr
formula hd(n)=- 2n J Hd(eIW).eIWn dO). -rr This impulse response will have n values ranging between -00 to
+ 00.
N-I
(b) Hence determine h(n) for Inl:::; -2-' where N is the length. (c) Based on the window technique choose the window function w(n) and find its window coefficient for
Inl:::;
N-I. 2
for Inl:::;
-2-'
N-l
2
N-I
and Answers
TQA93
(t)
( N-t)
2 N2-1)
:. H(Z) = H(Z) Z-( (g) The frequency response H (ejaJ) the FIR filter is designed.
response is symmetric or asymmetric. The h(n) values in 3. What are the desirable characteristics of the window? Solution The desirable characteristics of the window are 4. Solution The N-point Bartlett window is given by
is found from HZ
equation and
The central lobe of the frequency response of the window should contain most of the energy and should be narrow. The highest side lobe level of the frequency response should be small. The side lobes of the frequency response should decrease in energy rapidly as
OJ
tends to
If.
wB(n)
jl-
N-l'
0, 2(n)
N-l Inl~2
Otherwise
wH(n) 5.
=
0, 10.54+0.46cos(
N-l
27T:n),
2 Otherwise Inl ~ N -1
What is the condition for linear phase ofa digital filter? The conditions for linear phase ofa digital filter are (a) phase delay must be constant (b) differential of phase delay, that is, group delay must be constant where
B(OJ)
OJ
Solution
6. Give the transfer function of Hanning & Hamming Window function. Solution (a) The transfer function of Hamming window is
wnm (n)
N -1
27T:n),
2
elsewhere Inl~N-l
(b)
N-l
0, 10.5+0.5cos(
27T:n),
2
elsewhere Inl ~ N -1
TQA94
7. What are the advantages and disadvantages of FIR filter? Solution Advantages of FIR Filters (a) FIR filters are always stable. (b) FIR filters with exactly linear phase can easily be designed. (c) FIR filters can be realized in both recursive and non-recursive structures. (d) FIR filters are free oflimit cycle oscillations when implemented on a finite word length digital system. (e) Excellent design methods are available for various kinds of FIR filters. Disadvantages of FIR Filters (a) The implementation of narrow transition band FIR filters are very costly, as it requires considerably more arithmetic operations and hardware components such as multipliers, adders and delay elements. (b) Memory requirement and execution time are very high. 8. Determine the desired impulse response ofFIR-LPF whose delayed desired frequency response is
Hd(eJW)=
0, je-JIlW,
Otherwise Iwl::;%
Solution
-f
1
.
eJwn
dO)
'
=2
dO)
2n j(n-a) = _1 [eJ(n-U)W
]) -1! 3
n(n -a)
sin(n
-a)n - sin(n -a )~
(n-a)n
3 3
ForHPF,
hd(n) =
n(n-a)
For BSF,
hd(n) =
n(n-a)
y(n) = -O.ly(n -I) + O.2y(n- 2)+ 3x(n) + 3.6x(n -1)+ 0.6x(n- 2).
Solution y(n) Take Z-transform
Y(Z)+0.lrIY(Z)-0.2r2y(Z)
Y(Z)[1+0.12-1-0.2r2J
H(Z) = Y(Z) X(Z) 3+3.6rJ +0.6r2 =-------0.2r2 1+0.lr1
H(Z) = H1(Z)H2(Z)
'1"1
W
= [: :~:~:~: Z-l '--' 0.2 0.1
]t ~+O~:;~I ]
'm---,y(n)
1 -0.2 1+0.lrl-0.2Z-2
= (l+rl)
TQA96
Since the power of Nr = Dr' Use long division method to reduce the power of the Nr. -10
-0.1 Z-1 +1) Z-' + 1 Z-1 + 10
11
11
H(Z)=-IO+
1-0.1Z-1
-10
--.
x(n)
yen)
+ 0.1
2.
Realize the following II order system using direct I form of realization. yen) = yen -I) - 0.5yen - 3) + 0.5x(n -I) y(n)- y(n-I)+0.5y(n-3)
x(n)
Solution
= 0.5x(n-l)
yen)
Z-1
0.5
3.
4 5
3 2
2 3
Solution
Let us first draw the lattice structure for a III order equation.
fo(n) + f1(n) f2(n)
x(n)
and Answers
TQA97
-1) + K1x(n)
-1) + K2x(n - 2)
[I + K2]+ K2x(n - 2)
= K2x(n)+
KjK2x(n-I)+x(n-
2)+ K1x(n-l)
= K2x(n)+K1x(n-1) y(n)
[1+K2]+x(n-2)
= !3(n)
=!2(n)+K3g2(n-l) = x(n)+ K1x(n-I)[I+ K2]+ K2x(n-2)+
- 2)+ K1K2K3x(n-2)+
+ K1K2 + K2K3]
(1)
+ K1K3 + K1K2K3]+K3x(n-3)
y(n) = x(n)+
K=l
L am(K)x(n-k)
(2)
x(n-I)+a3(2)
x(n-2)+a3(3)
x(n-3)
=1
a3(1) = K,
+ K1K2 +K2K3
=K1[I+K2]+K2K3
TQA98
K\(1+K2}=U2(1)
u2(1) l+u2(2)
= I, =
um(m)
Km - K)
[I:::;K:::;
-I]
= u3(3)
+ I]
= K2 +K3{K](1+K2)}
3 -I) + -x(n 2
- 2) + -x(n
- 3) (1)
=2
x(n)+-x(n-I)+-x(n-2)+-x(n-3)
5 2
4 3
3 1
=Ko[l+
~Um(K)X(n-K)] x(n-3)]
(2)
= Ko[l+u3(l)x(n-1)+u3(2)x(n-2)+u3(3)
=5
3
a2(2)="4
1
u3(3) =- =
. 3
K3
Here m = 3,
u2(K)= u3(K)-u3(3) u3(3-K)
l-u~(3)
and Answers
TQA99
a3(1)-a3(3)
l-a;(3)
2
a3(2)
_534_54
2 I 3 ---.-
- I-Gr - I-i
=0.16875
To find a2(2) , let K= 2
a2 (2)
l-a;(3)
4 3 =--- 5
312 -_-0-
I-or
= 0.69375
a2
(2) =
K _
1 -
K2
= 0.69375
a2(1)
l+a2(2)
0.16875 1.69375
= 0.0996
Thus the lattice structure coefficients are
K1 K2
=0.0996 =0.69375 1
K3
=3'=0.333
4.
Differentiate between recursive and non-recursive difference equation. In recursive difference equation, output depends on past input and output.
N N
k=l
Solution
Eg. y(n)
= - ~aky(n-k)+
k=l M
~bkx(n-k)
k=O
L bkx(n - k)
TQA100
5. Draw the direct from I structure for the system y(n) = O.5x(n)+ O.9y(n - I). Solution
y(n) y(n
n)
-1)
0.5
0.9
'9
6. Mention the advantages and disadvantages of IIR filter. Solution Advantages ofIIR filter
(a) Requires fewer coefficients than an FIR filter for the same set of specifications. (b) It is a better choice for filter having narrow transition band. (c) It is a recursive filter. Disadvantages ofIIR filter (a) Lack of stability. (b) The IIR filter degrades the filtered signal if proper care is not taken in the design. 7. What are the advantages of lattice filter? (a) Used extensively in digital speech processing and in implementation of adaptive filters. (b) The coefficient K1, K2 etc are known as reflection coefficient. (c) In case offorward predictor the production value ofx(n) is obtained by a weighted linear combination of the past values ofx(n).
p
x(n)=-Lam(K)x(n-K)
K=I
ex p
(I)
(K) x(n - K)
(d)
Backward Linear Prediction In a sequence x(n), x(n -I), ...,x(n - P + I) ofx(n - P) has to be predicted we use a one step backward linear pred iction where it is determined from the coefficient bp (K) P-l x(n-m)=L
K=O
f3m(K) x(n-K)
(2)
Backward prediction error g p (n) is the difference between x(n - P) and (n - P). Note In case of lattice filter structure the coefficient of Y2 (n), g2 (n) are in reverse order Y2(n)
= 12(n)
= x(n)+
Kj
(I + K2 )x(n-I)+
K2x(n- 2) x(n-2)
and Answers
TQA101
g2 (n) = a2 (2)x(n)+ a2(l) x(n-I)+x(n.. Coefficient off2(n) = {I, a2(l), a2(2)} g2(n) = {a2(2), a2(2)} In general,
m
2)
fm(n) = ~am(k)x(n-K),am(O)=I
K=O m
gm(n)
= ~ f3m(k) x(n-K)
K=O
From equation (2) it is clear that to find x(n - m), the datas have to be run in the reverse order through the predictor. Hence it is known as backward prediction. Whereas equation (l) is forward prediction. 8. Explain the various forms of realization ofIIR system? (a) (b) (c) (d) (e) (t) 9. Solution (a) In direct form II realization, the number of memory elements required is less than that of direct form I realization. (b) Quantization errors can be minimized if we realize an LTI system in cascade form. 10. List the two important transformations to digitize on analog filter. Solution (a) Impulse invariance method (b) Bilinear transformation method. IIR filter using bilinear transformation method Butterworth filter design (a) List the given parameters and draw the response of the filter. Next convert the given digital datas into analog using the transformation techniques. (b) Since at high frequency Direct form I structure Direct form II structure Transposed direct form II structure Cascade form structure Parallel form structure Lattice-ladder structure Solution
ii.
0 differs from
OJ
n.
N~--- ~
log
log-
n,
Op
TQA102
logN where,
1':=(IOOlal'
"C.__
1':_
logq.
-lt5
I
= (]00 la, -
t5
-of
odou
+O,Ou . B =
-od'
-O~+O,Ou
O2
[Ou
-od
(d) Based on the order of the filter choose the butterworth polynomial.
I H(s)=--Polynomial
(e) Convert normalized LPF into de-normalized respective filter. For denormalized,
LPF
S4-S ~.
S4 ~ S
S2 Ou
HPF
+q BPFS4---S(Ou BEF S
S[Ou S2qOu
-q) -q]
=-pI
eN
Convert the analog filter into respective digital filter using bilinear transformation 2(l-z-l) by T(l+z-I)
inH(s).
method by replacing S
(g) Same procedure is followed for Chebysher filter except there is no standard polynomial to look up as in case of Butterworth. Here the transfer function has to be derived.
Chapter 9
1.
Using Laplace transform, find the impulse response of an LTI system described by a differential equation
d2
dt2
= x(t).
Solution
dt2
= x(t) = x(s)
s2 Y(s)
s Y(s)
- 2Y(s)
Y(s)[s2 -s-2
]=x(s)
=
s2
-s,-2
I
(s+l)
A = (s - 2) H(s)ls=+2
= s~2Is=_1
1 =--=-1
-1-2
1 -
3
1
--
H(s)
TQA104
. . 2s2 +9s-47 FlOd the lOverse Laplace transform of X(s) = 2 (s +6s+25) Solution 2. X(s) = 2s2 +9s-47 (s2 +6s+25)
= (s + 3 + )4)X(s)I"=_3_}4 = 2(-3- )4)2 +9(-3- )4)-47 (-3- )4+3- )4) = -1.5- )11
B = (s+3-
)4)X(s)i"=_3+}4
Draw the direct form-II realization ofthe system described by the differential equation
d2 y(t) ~2
Solution
dt2
y(t)
and Answers
TQA105
+ 5sY(s)
Y(S)[S2
+4Y(s)
= sX(s)
s
+ 5s + 4] = sX(s)
Y(s) X(s)
--=---s2+5s+4
4.
Solution Quantization of coefficients in digital filters lead to slight changes in their value. This change in value offilter coefficients modify the pole-zero locations. Sometimes the pole locations will be changed in such a way that the system may drive into unstability. 5. What is truncation error? Solution The error occuring while truncating long sequence is called truncation error. If the number x is satisfies the inequality, 0 ~ xr -x>
z-b .
6. What is the transfer function of a system whose poles are at -0.3 Solution
H(s)
(s+0.2)
Solution
Take Z-transform, Y(Z) = 6rlY(Z)+4r2Y(Z)+X(Z)+10rIX(Z)+ Y(Z)[1-6rl-4z-2]=X(Z)[1+10Z-' Y(Z) X(Z) The direct form-II structure is +12r2]
12r2 X(Z)
y(n)
The state equation by considering input-output state q,(n + 1)= 6q, (n) + 4q2(n) + x(n) q2(n+ 1) = q,(n) The output of the system is, y(n) The state matrix becomes,
(4) (1)
(2)
+[1] x(n)
(5)
and Answers
TQA107
A=[~
~lB=[~lC=[16
16];D=[1]
2.
A continuous-time system has the state variable description A = [~ Determine the transfer function.
sf - A = sOl [1 = [~
~1]
= [S -12 s 1]
[sfArl
-1]
s2-2s+1 s-2 s2 - 2s+ =[S2 -~S+I 1 Substitute equation (2) in (1), s2-2s+1 -1
(2)
s-2
H(s) = [3 _
[ __
s2-2s+1 3_S
TQA108
s2-2s+1 s-5
0 ][1]+[2]
H(s) = Y(s) 2s -s+3 X(S)S2_2s+1 Y(S) --= X(S) S2Y(s)-2sY(s)+ Y(S) 2s2 -s+3 s2-2s+1
= 2i X(s)-sX(s)+3X(s)
dt2
y(t) _ 2 dy(t) dt
dt