Vous êtes sur la page 1sur 151

Contents

Digital Signal Processing


Third Edition
Matlab Tutorial & Two Marks Questions and Answers

S Poornachandra
Principal Dhaanish Ahmed College of Engineering Chennai

B Sasikala
Assistant Professor Department of Electronics and Communication Engineering Cresent Engineering College Chennai

Tata McGraw Hill Education Private Limited


NEW DELHI

McGraw Hill Offices


New Delhi New York St Louis San Francisco Auckland Bogot Caracas Kuala Lumpur Lisbon London Madrid Mexico City Milan Montreal San Juan Santiago Singapore Sydney Tokyo Toronto

Digital Signal Processing

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.

ISBN(13): 978-0-07-067279-6 ISBN(10): 0-07-067279-2

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

Digital Signal Processing

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?

Shot1cLis tlJ How to Add

ld

W'Iot'$ New

x To .;Jet started, lfelect


MA.TLAB

: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

Help or Demo= tram ehe: Help menu.

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

Aug 29, 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

I ;~;:;~:!, , 'I' ...

Fig.

MATLAB Opening Window

MAT2

Digital Signal Processing

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

Grephlcs DebuQ .~Wlndow

Help

IS .,
[fJ V\lhllt':

'.~

UndockWorkspace ~ve l~yOlt, ..


OrlJMlize

"j ~~~ liJ


Command WIndowOnly.
History and Command

[fI

How to Add

__ ~_._.~_ ..__ __ ._ .-_. ..~._ .._.... .... ...__ . _ _


J';

.._._ ..

._. _._..__ .._...~._ _ ._

..

...

.... _ _
fI

~ti1. ail m

Iii.

leyouts, ,

wndow

lI: _ ' ., Commend W"dow


It!

Allrebbed

Command History

To Qet ""carted,

:5Ielect HATLABHelp or ~

trom the Help menu.

v Current Directory v Workspace


Help Profller

v v

Toolbar Shortcuts Toolbar

.; Workspace Toobar .; Titles

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.

III How to Add III Wlot'.


~

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

';~';kn,/ he!p.m help


l/U7
:_; ", 1/;)'1'

"

)(

~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.

Current Directory Environment

MAT4

Digital Signal Processing

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

HATLAB Help or Demos trom t.he Help menu.

double
b

double double double

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~~

File Edit DobuQ Desl<lop W"dow

D ~.

IItiI

,)

(.

r:! : ~
Now

Current Drectory

C:'II'1ATLAB7

Shortcut. l!J How to Add l!J ""'.'.

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.

he 11' d"t:.~ DATE Current date S DA.TEreturns

a:J date string. a 15tring containing

the

date

in dd-mmm-yyyy :!ormst.

Reference page in Help brow3er doc date

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.

Command Window Environment

To clear command window, type cle command and hit enter.

dc How to Leave the MATLAB Environment?


To leave the MATLAB session, type

quit
or type

exit

MAT6

Digital Signal Processing

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

-, a-b a+b; 1 a 5O,


c b d

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

.-

7./ .1./0'7 1(1: 4-t Pll

--%

a - [1 2 3],
b-[456J'
C III

+ b

clear

clc
date

mat lab\ helptool3


mat lab\ lll'intun mat la1:.l\d~roo!! ~:,t.~~lbOX\ local
"I

clc
help

L ..... 5f:E .J

Fig. 6 MATI.AB Help

Introduction

to MATLAB

MAT7

MATLAB Documentation Help?


For beginners the complete documentation help can be obtained by pressing 'FI' key. Programmers can navigate the content, index, document or demos by selecting the appropriate button available on left side. Detailed help on any topic can be obtained by clicking on appropriate toolbox or simply type the topic in the search as shown below. The right window gives the complete details and also related topics to be explored by the user .
.' MA !LAIl

r-lrf.i1lrxJ

F~e Edit "'ie.' Go Favorites DebUQ Desktop Window He~

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

Syntax p!ot (Y) Plot (Xl, VI, ... )


I>J.Ot (Xl, Y1, Line5pec:, )

plot ( . , I P.z:opertyNl2ll'te' , PropertyVe.lue, plOt (axes_handle, oj h plot ( .. ) hlines plot('v61,


0 0 )

. )

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))

In all other uses ofp!Qt..

the imaginary component IS Ignored.

plo:e (Xl, Vl,

plots all lines defined by

Xn ~ersus Yn pairs, If only Xn or Yn is a matrix, the vector is

plotted versus the rows or columns of the matrix, depending on whether the ~ector's raw or column dimension matches the matrix

plOt (Xl, Y1, L1neSpec,

0 0.1

plots all lines defined by the

Xn, Yn, L1neSpe:c triples, where L1neSpec is

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 .

Search Sypport Database go Web (or "..,-,,_ ..,

_-_

~_

"_.""_ ..,"- .._-_


....

"

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

Digital Signal Processing

The addition, subtraction, multiplication, division and inverse division are illustrated in Fig. 8.
) MAIlAIJ

1.1ti111'5<1

Fil. CI ~

Edil DobU\l De,i<top Window H.~

t Illii" .)
Add

'0 , rd ' ''f


t1J \I\ohat's

CUronl

Dlrootory:

l C:~ATLAB7\w0rk

Shortcuts [iI How to

New

double double double double double double double

-b-S; d-a-b e-a-):) c"'a+b a-45: 50 e 40 d

onIDldnd Window

,.

"II

".

._._. __

n __

_ __

__

'<"'<'\<H'"

iL::1

X 1<1

.
i

225 t""a/b

a-[123]; b-[4S6];
c-a+b

clear ele date


U/U') 12~IJOi;.H

t -

a-45; b-5; c-a+b


d-a-b

q-a\b

I
./:1

0.1111

,J::

y~:! 1

.,~!

Fig. 8 Arithmetic Operations

Introduction

to MATLAB

MAT9

The power operator and inverse operation are illustrated in Fig. 9.


'MAIIAU

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

1tI \M1elt's New

X
. ~ I' 111 =i1 .

stock:;

doubl. doubl. doubl. doubl.

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

clear ele a-2S; b"S; ca"b clear ele a-"i; b-3;


d" [1 Z 3; 4 5 6; 7 8 9J

Fig.

Arithmetic

Operations (continued ... )

Representation of Complex Number


There are several pre-defined value for variables such as or j is ~ and n is 3.1416 .... Similarly, there are several pre-defined functions that can be used in computations. The complex number representation is illustrated in Fig. 10.

Pre-defined function
abs
An Ie

cos sin ex

MAT10

Digital Signal Processing


l[x1

, MAli All File D ~ Edit Debug .K . Desktop ~ ~

1'_

11'>'1'

') ':"~ : _

rJ : 'f

CUrren Drectory.

(:~i~~~:~:~:~~'.
X

ShortciAs

1] How to Acid

1tJ VIhIt's New

.. Stlde:'
u~,w,w~~, __

.-3;
b-4;
C" (a+j *b)

,,_~j

Cia

double double double (complex) double double double double

3.0000

''l.00001

d-abl' (e)

e:-snqle (e)

ele clear ele


clear

0.9273
:

t-cos

(a)

t ele
0.-3;

-0.9900

b-4: c (a+j *b)


d-sbs (e)
,

t;J

g-exp (a)

e-angle (c) fco!! (s)'


Q'-exp (a) Vi

20,0855

in

~.:,

,~".....

.1

.IMi .

"'1",,+,

",.

iNih!

__

w"

Fig. 10 Representation of Complex Numbers

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

Equally spaced elements


x=O:

The equally spaced elements can be generated by the following command.

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

Debull Oesi<lap Window Help

. ,X III

ilil. ,.)( r! l'


[lJ
V'mcrt's New

Curren D1roc!oty: c: .TL37\w<"k \ 1

Shortc\A:s

How to Adcl

X
.. ~ =

(,:~lnmmd JNbtk\i'f

X
,~'''~.,,''''''''''''''_w'' __.".,__

",,'."' _'__" __ , __ ~ _ .....

Nome;

Tvolue (138491525671 15671 /138491521 (01234561 101234561

doubl. doubl. double double doubl.

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 -

d-ab.(c) e-angle (e)


fco15 Is) g-exp (al
'.:;,'~, .... 3/1"'1/U7 x 0:1:6 y 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

Fig. 11(a) Generation of Elements of Matrices

MAT12

Digital Signal Processing

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;

Nullx Matrix n x m matrix ofzeros n x m matrix of matrix identity ones

[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;

1tJ How to Add

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

~)

Fig. 11(b) Generation of Special Matrices

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

itJ W'lllt's New

tIi

ommalld

Vtlmdow

,.

m_

=ii.

Name ":":"",,,:,,:,,:,:::::].~~~:::,,,::::.':::,::,::,_" ..m ......"""'''',, I.C:::

'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

clC!sr 010 ~ - [1 2 3 4 5 6 7] ~(41'10 1 - 090(3,4) 1(2,3) - 5

Fig. 12 Addition, subtraction, multiplication Figs. 13-15.

Inclusion of Element in a Matrix


and division of matrix can be done using MATLAB is illustrated in

MAT14

Digital Signal Processing

"..

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

[34 5 6 7891 [22222221 2 56


1-10123451 double double double double double

add"

II

2: 2: 2: 2: 2: 2); + b

,mulll

"b

,""

add"'o.+b
!Iub III - b

ole 8." [12 J 'i 5 6 7]; b (2 .2 2: .2 2: 2: 2]; eldd-a+b


!!tub a -

multla~b'
dlv II

Fig.

13

One-Dimension

Arithmetic

Operations and Division)


_
0'1><1

(Addition, Subtraction,
'MAll'"

Multiplication

b
b

- [1 2 3 4; 4 5 6 7; ? B 9 1]

add

add"

ele a eve (3,1) b {1 2: 3 4: 'I 5 6 7: 7 8 9 1] add-a+b sub II - b


multJ. . a 1;1'

10
!Iub II. - b

clellt" ele II ~V~ (3, 1) b . (1 2: J 4: 4 S 5 '1: 7 8 9 1] lldd-lI+b


!IUb a - b
~"""

-2

-)

-4 -7

-'I -6

-6 -8

-.
-7

-1

Wm l!:=J

"'B"

I;

)""M'
Fig.

14

Matrix Addition and Subtraction

Introduction

to MATLAB

MAT15

'MATlAIJ

l-lll.I'lrxl
Debug Desld:op
W\r'lckJw

File Edit

HaIp

D ~

l\l> iI!i "" ('

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

0.5926 0,0370 -0.5185

-0.07'11 0.0370 0.1181

? 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 e'-colli (tl

'1 t.*cos(t)

Columnl!l 1 th.rough 0.5103


rnl b
It

7 -0.8323 9

clear ele
a" eye-(i,S) b 0:4
ml b "" s' m2 b

Columns 8 th.rough 5.2773 -1.1640

b. *a' b.lts clear ele t 0:8


SO

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

Matrix Multiplication and Division

MAT16

Digital Signal Processing

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.

Basic Built-in Functions Generally Used in Signal Processing


v= [ I 23] v = [ 4; 5; 6]
v= v' v = [I: .5 : 5]
v

% 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

size(m) v = zeros(size(m)) who whos

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

FOR, WIDLE and IF

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

% not %or % equal

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

Digital Signal Processing

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

:>:>

)(-lin.!!lpillloe(O,1pi.200); V 1n(xl; plot(x.V):

"

i t ie ,IMe!
1:. x liU:le

~ ' :l

i 1\'

i,,):,,,
'.. 1 ); iy:,"':;'I"~l"I,~ I

-c ,,'f 'Jl ~. , ) ;

(',..J)'
1 (' _~

):

Fig. 16 Generation of Sinusoidal Waveform


f D ~:
fII $hor1clA. ~~DP"~ x, .. !'tlIII;l",,.,.
j("' ;'-, . "

l\IIB

f!1
New

,t i

Cl.rrenlDnetory: ..~:.~~!\~.~

:;y; ...

frJ

!1J How 10 Add

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');

Fig.. 17 Generation of Multiple Waveforms

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

Fig. 18 illustrates the usage of grid and axis control.


PM, Edt Debuo wa . o.sI4:OP wndow

'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

Digital Signal Processing

Multiple Plots
Multiple plots in multiple windows can be obtained by using the command subplot.
_}Ul':\!
F" I!dt 0Ibu9 o.fIop
'olMdow

Cl ~ ~ ,t. ShorlClA. ill How


"., c..
10 Alld

r! t
!

. HIIp

,.

CUfrel1 Otectory:

:.S.~.~.~~~~ ....

III WI

New

subplot(2,1, 1); om" loO'.pace(O,5,200); h1&9''' 201oQ'10~ab5(1000./(10tD+I000)l):


IlIl!!ml1oqx(om, ll1agl:

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) ) ;

.elllil00'x(OIll,pb e): 1ll)/lsl(lO,lOOOOO,-90,Sll'

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:~",:

' );

"'fe"f Fig. 19 Multiple Waveforms in Multiple Windows

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

x3"0 .$5.' ~nl:


llubploe(2.3,3) Illtelll(n,x3,' v'): ldtJo!'): x Illbe 1 ('II' /ylabel(' tltll!('rl"'~''''\, "xT",n"'nt,' ~ );axll1(O

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]);

ll\ll:)plot.(2,J,5) :lltelll(lII,y5,' k');


Klelbel (' n') tl.tle('nOlnp')

;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

Plot of Frequency Response of the First Order System


Write a program and plot the frequency plot of magnitude and phase of a first order system h(n) = an u(n) where a = 0.6.
f;1M.,~l~mf.HmN.jJ&.L#['lLl;"
I'Illi ~ Tht ctl took

is .,
b"(l}1

,-

fHl'.;;ll)U.cy ~''''.~~~'I,~''' '.1'" .~'I"'~"'l' "t

~:;j' f. eem

DebuOo."-'

WI\dllw

I!I! i!l,i[J ll!J ,

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-

subplot!2, 1,2); plot.(n!pl.anql.(bl. .,u,bel('"Il,,, . ' 1Il111a((02 -11));

'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

Frequency Response o/the First Order System

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

~l:i!IJ!I!!I.I1I.~t!;~li!!i DIlIl.iO' 0Mkl. 'wndr/w '.-

1II

[J1lJ.1I.,* ..."' ... ....~ .011 .,

,-

."f,I'l~~~'?I[J.'I!!.~T:::::::
, ~',n'lUl
'.",-',n
co,1;

:11

"

,,,,.,-

,-

)1-32; )In" [l ~ 3 4] I L " lenQthixn); It(N"L) er ror ( "; 'Co':,,",~'

l>r',

.'f,urrl All Edt \IIIW,in..rt ToiiII DtIIIcp, ,.....

r.!'"
~

D~g.:~i'<!l.El.O@
l.')1

>ll'!,OItl
rrequ'ncyresponn

~C

"

xl-[xn n:ro:l(l,N-L)]; tM k-O:l:)I_1 to~ 0-0: 1 :N-l ~. 1,U.-.xp (-1-2.p1-n-~NI; d(k+1,DH)-t"'1dh:

\"""l'ljnl)

:12(13-

,,,,un-

:,'_,~i,ll~- /.'J.I.'f',c,t'

"'!;:ll'. H'r,

" ,,n,,n:2<1>Oh-IlbS(xlC); p-sn'O)J.e(xlC);

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

~:1 irk ~_~ __ ~_~ hf9 friho l_~~_~


o 5 10 15 ~ nOfm.hzedfleqll.ncy ~ ~

)'''01'

I'.'"

;'~.I,."l',h

''''Lit ..,,, lei

COIl'

k"~.

"

Fig. 22

DFT Calculation

MAT22

Digital Signal Processing

N-point 10FT
Write a program and plot the frequency plot of magnitude and phase ofN-point IDFT.

,6

, ,-

, ,0lO-

5-

Kk(l0 -O,1142-'L~426i Nlenqtli(Kk);


:-'\11'"

-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,

i:i~ii1.::[':<il.e. fi~!.jltj[j "El ,


1r\'Wtlu OFT

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

Circular Convolution Function


iJI f dUO! (\MA II AH'\wolk\!l~r Edt Text C.I Tool~
o.buQ

book\r DMtop

wn'l

In

f:

1ri5

If)(
:lC

WIndOw '"'*'

11 : ,.

D.~Ili ..!.ii!l~.. "-'."' "

,
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:

~,"~!x<"n'-;, ',,";'l,~'n'~,~;;,tli\ 7(:r()':",

','. ','"

;,/;j'''.:t. ;,mp"l.;:\';

1",,,.-,,d
cr"rJr'OI":.

15 lO-

n-

m-[O:l:N-l]
K'"",odl-IIl,N)

;
;

,,,,Z5-

1019zo212l2l-

h"'h(!+l) : tor n-U l:N


",""n-1; p.O: l:N-l; q-fIlOd(p-Ill,NI; hDl-h(q+l) ;

Bin, :)-hln:

Fig. 24

Function of Circular Convolution

Introduction to MATLAB

MAT23

Circular Convolution
Write a program
"'.. I!.
1

and plot circular


Text eel fooli DebuQ
OftIrtQl)

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

L'OI','.'(J,lll( ',[HI '.If

t,~:".'

~j""q'H~W_'("~

ole N" 4: n-O:1: ;'11''''11 1I1Jbplot(Z,2,11:

aiI 10 -

xn-[l"

3 1);

Nx-Iength (xn) : n-O: l:Nx-l;

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 -

enct ~ ': !1:CUlo!'lr ':':'ilV(l.'.\'.: i')ll

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

Digital Signal Processing

Linear Convolution and Correlation


Write a program and plot linear convolution and correlation.
IJI!I.'''I.IilDII,'''m!!!.!'I,I!if,II'lftll'',i''-'d'JI,'I;
I'll [dIt T.xt CtI TooII DtbUO o.tICllP Wlrdow Help

Dail., "~ ..,,, ,e'"


1 ~ 111",,,,1':'

f.' flItl"._fI1l1i[ll!\l'''''''[''
t:, .
.'l:I"r'",r].,:,,'!l'

I:IIllSl'il'.R

'.
..i"
X

2: ,,-

ele.r n-O:e:

~.\il:

""en"',',; '.,~ ".'/1

':It:

3 - N Il; ;.!i
6 7-

~i l':pl,

'._ :~",'-l';."'1

IUbp.lot(Z,Z, 1}: IIn"'[1 2: 3 4 5J;

1"Ii:l:,Yitw'IrRttToaIf~,"'Wlridow~

l!l 9 10 -

Nx-lenllth(xn); n-O:l:Nx-l;
Item(n,xn, ~-

Daillile'.~ ~E1.~:!).I{' IJI:jJ"D


l: ;axllll0

I;
5 0 6) l;

1112 -

"

xlabel('(;'))ylabel('x[r,j t1tle(' lr.,.'" !<".I:',~l')


lIuklplot(Z,Z,;n:

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,

lllabel('n'):ylabel("J\{n.1 l; titl.('ili\p'i.J.u,~ ,.'.~:;pc,nrJ",');axll!l([O"


\ l1.nl': .r. ,:I.'I;':I'.';.U~.'H,fl

0 6]):

~w~c
o

"

"

lintarconwlulion

corr.I.lion

:22 -

'23 ]Z4 25 2ll-

.ul:lplot(2,2.3); ,t"'convlxn,hn); n."'OIINx+Nh-2; t


etem(n,Vl,' '"" I; xlabel('r,'):vlabel(''1[rJ] l; tltle~' lin-" . '_'UltV'."',";,i<,>f");llXls([O

27 ze
Z9 30 -

8 0 22]1;

;l.,ir:~~t'

r_,(;r.'."_~'\l::,i'.H,

subplot~Z,Z,4); vZ-xeorr (xn,

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));

Fig. 26 Linear Convolution and Correlation

Overlap-Save Section Convolution


Write a program and plot overlap-save section convolution.
~tiJJi~llmJlI!~B'II=!!gtlU1jYaI$iWM~\lI!M~;

~'~!!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

Dail , "' de e1eai:;-"T'i;


3 "

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'.

r.') :vllllbel (. :-Ilnj'); ,"!;,;lr,'A,"'l:llXl:1([O100 9]l;

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-

llk-ll(k-L't1:k-L+N): Y(k+l, :)"'ccOnv(xk,h,N);


.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

Overlap-Save Method of Section Convolution

Introduction

to MA TLAB

MAT25

Overlap-Add Section Convolution


Write a program and plot overlap-add section convolution in your lab.

Butterworth

LPF gtl_~!'Ii"!_'"13I!ilmrl'I'II' ~"!dI: T


tC"TodIOIitlUIloMktql~',~

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,-.

$,: 7 : e : 9 :10 :11:12 ;13 :'14 15 U 17 111l'i1 20 21 22 i24 -

alphapZ;1I1phIl1l"'Hi: :l:p"800; t."lS00; r'"5000;

"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

0.4 0.6 o.e l\o,m'lindfrequ'rlCY phu.resp0rlSe

---'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

!dIt T,d: c.Il Todl DIbuIiI o-ttap

"'.
';

"1.'"

f., iJlill'il'l'ilfil'1Hi i

wnb'I

'HIlp

IN
":11 II(

IBCD S 1I"i::l

2 3 -

"~l'.l'Jr, ,'I; '"\\'.<:'~.'f~'~,n,l{!'Y olear,:, ;,~: a!phap"1;a!pha'-30:

S
6 -

vp-2tp/F,

tp-1!lOO; tll-eoo: '-5000: Wll~2-till';

.,
!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 -

.ubplot (2,1,2); ,lu.el('

plot (olll/pl,ang); 9~ld ne,;


.1' ",\",;.,,;~,;

22 U 24 2S

"!"".i.,'~r.'); OSltU{[O 1 -4 4.])1 ,"'W ,-",'>'p""''-'''); t1tle('~,

~1~[~~-:!;,' . " : : ~ :L.:. : ~I;--~~i' .. .. ;-


01 02 03 1.. 0,-4 0,5 0,6 normalindn.llu,ncy
ph

0,7

,. 0,8

; 09

1
1

uporl"

,-40

01

02

03

0,-4 0,5 0,6 nOl'lTlaliZldfl'lqulncy

0.7

oe

09

Fig. 29

Butterworth

HPF

MAT26

Digital Signal Processing

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.

D""lIIi~.;;;: .,.i;Qiii;e_.:i(iijji _,' 1


,-

,...

!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

,label! .~n1r. it: 'J[;');


a.ls((O 1 -400 50J); t ltll! (' l1"I':\~l, !.''''.1" ,,,,,,,.,,_.n,,~');
o.J

'19lO-

,,,,-

ll-

.l.Ibplot(Z,l,Z);
Mlllbe 1 j . 11,,1:"'"
J,

Plot(oll'llpi,aIlq); riel ,Ii';


I :

"

H-

! ~",l fr,', '."J"~'~'" flabel(' r')'''Nf'' ;. "<1,1;"" ): aMls(IO 1 -4 il): tltle (' l'~"~"'" ru "'H',,-,,,,'I:

;tJ~Hfn~ttj im= :_-'_ :_~ , ' ; ..


.3)) '0
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-

(b, 1II, II);

o
!)n:

i#

IiIj;'~iGi:e:~~tltfli3iii
o

oj
-I

m-;W .loQI0 (lIIb5 (I'll) : snQ-snQle I h) :

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

tit 1" ( 'p),ll''''

-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-

,-

~ ;"r:",~,;m clear ::.1J;:

f.I!l~"lIJ(lj'llIltli. 0': ~1~e;~:I~hr:v,r


. "

9""

lli"llC .. ......E!1Il1!/jl;i::l,

un

,
uue1J-

,5,-

.lphtip-2;.lphu"45; tp-eoo; t.leOO; '5000; vpZtp/r: .2t.I':

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.2 -300 50J): plot(omJpl.anq);


1.r ~-'~,\lf' ',",'
'r ' ) ;

'1 -

lIW!plot(~.1.2);
Vlab . l(;r~J,,"I'<'" '" IIK1SHO 1 -of ill:

qtld on;
200

,,-

x lal:lll! 1 ( . 'H.' !err'" 1 ;. '1:"'.-1

'1-

" "

~(\'<;.~r.):

1100t_ __.. ",_-_~!':,:ia _....: . ';lOO .. _._-_ --~--~--~-~-~

-__----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

:t .....:....: ~.i.;1~.. ':lc"':i.. ..j ..... ....

r l 0,8

: ... lS .. 09

ij
Fig. 32

!E-t;i;

7.'T."'.'~!

Chebyshev (First Order) LPF

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-

;.

!ill';.. "i. 0ii!1;4~ljjiJi]1III


'.:J>i":'

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

1,2); plot (Olll/pl,ang) ',.,~t';'$J.'.~~-:l .i'\'<,wvt.:J':'J'); ;,I'.,;fji: ;,1,\"1",:"''':,'): 1 -4 4)):

I gnc:l ,~a;

~3 -

,.

title I' "'.~"~:(; <:u,,~r,.l~,');

:i~ i:rtfiI~Hii.'..... . j
tI'1" ..I

0,1 ~ OJ 0,4 0,5 0,6 ! 0,7 .


'I ~

0.9

normalized

frequency

!
Fig.

~2: ....: .~T:+~T"T . .. :i..11ic':I,' ..;,=]:li'jl".s--,,j. 4-~-~~-~~-~~-~-~


o 0,1 [2 0,3 0,4 05 ~ 07 0,8 09
normah.ltfrequllncy

33

Chebyshev (First Order) HPF

MAT28

Digital Signal Processing

Chebyshev-I BPF
Write a program and plot magnitude and phase ofChebyshev-I bandpass filter.

EI'.~"~'l,!~,mIBJ,''!'',";:qF';1 OtPtap 1lIbIaw"


Rle Edt: Text eel Ta Dtbug

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

ylMel('r-"l<.,~ axu([D 1-4

re<IH,n'):

"'~r>?I~I:I~I~~1 ,,,i~.~ DJ ~ ~ ~ , '!-, ,f :1:+1 ;~I~Il : ~""":"""~""" .~- -, ~


DO 0,1 02 0,3 0,4 0.5 0.6 nOflTliliz.dfrequ.ncy 07 0,6 0,9 1

4Jl;

i~
a 0,1 02

iuu.':..

title l' ~',\tn~l~,~.'a,~r:'):

I~t~Sf~1 Ii
03 04 05 0,6 nOlmaliztdfrtlquency 07 DB 09

i ]
1

Fig. 34

Chebyshev (First Order) RPF

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-

.:-;",r'll . ,.'~I.i.'H l"llt EdI .VIIi'!lIMrtTo*

o..ktop .WWldow HIb N

: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:'::

11 ' ,'''',~<r<'\: ;. .",,-,

ylaDel("~J;~n,lI\' '" :&.-I~n"'l: axu(IO l-q 1J): tltla('t'".d'_ '.c.';.o"'l'ISf,'):

tk' If;i ili l'lmiij .Et:-...:t,i:l::~


o

0,1

02

03

04 05 0,6 normalized frequency

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

Chebyshev (First Order) REF

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...

D.cilil.X "'. ., '("f:LtlttiLIl

,-

&l(lllii.,..,i,

,,,,lO-

clear ell ~J alphap-2;alpntul-'1S;


tp800; 1'JI-1800;

.-

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

noflna~zed freqlJIIlncy phUlruponu

Illl!EB;~
0,1 0,2 03 04 05 06 normalizlldfrequlll'\cy .............................

"

0.7

0,8

0,9

Fig. 36

Chebyshev (Second Order) LPF

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

Owkop Wlrldo; '"""

Cl riI ....

1 ""

'<

: '"

1
:.I:~

f.

,.
1o'fI)(

tJ

Ji) .

{(j

1!lI mr JGl1tll

EBrns/;[j

clea["

,,-

alph.pl:

i "~I a1phaa-30;

tp-1I'lOO: tl!l-aOO:f-SOOO; wp"Z-fp/r;lIl!1-Z"ttl/r;

, ,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-

_O:O.Ol:pi; (h, Olll]-treqz (b,

fdt: YlIW hert

T~

.DelkCIP

Help

D~I;I.J1~\~~i'4i!'
9[id
'-'Ill 0, __ ,: ,

OG

"0
__ .._--_.---7-. __ .~
.. -

1314<S-

111. " '0 21-

a-

'~~'j.~r "'~'U'!l,~:." ) :

vla!:lel('q:.un
ax1a([O

'" (H;'):
~

,-.~---t. L
.J

1 -""0 10]):

.10 . __

.uPplot(:.I:,l,2); vlabal('r]',"'~" axunO i -3

plot(olll/pi,anQ'l: ,:,,(ju\l~'l;
JJ))

Q'[id ,:;:'';

22-

"

l3-

I.

30 --- _.. ; .. _... ~... _. 0,1 0.2

.400

ILiff;- : =+,'
L L ' .L

L ..L .. _.. l. .. _.
---r-"

rf

""--1'"

"'1"

...

0,3

0.4 O,~ 0.6 normillizedfrequency phaserllsponse

t-_!_ I 1-"0.7 08

-.

0.9

2 ;- __ _j-t-r--1_t __ _~__ -r---}-, (1<~il~-'i:;',:~ltmi;-I;I:-!:-1;1 .. N


Q.

T_:~~tj---_r__!
o 01 0.2 03

i (
07

04 0.5 06 normlliudfrequency

0,8

0,9

Fig. 37

Chebyshev (Second Order) HPF

MAT30

Digital Signal Processing

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-

alph .p2;llphu"4S; tpl*100; tpZ"1l00; '''5000:

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"

DMlrtop 'tl/hXIIIf ...,

,,-

[J~IiI.. ~.I!l.EU',~ ~ l:l~

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);

1O~~~::'~~-~-~-1 ~ .., ,:')n. :: ':


norm~lilldfrelluency

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

Chebyshev (Second Order) BPF

BPF Chebyshev-II BEF


Write a program and plot magnitude and phase ofChebyshev-lI band elimination filter.

~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.

10 11 lZ11 1'115 16 171f! 1SI -

, .,
6-

'IlJphap"Z;fllph '1S; tpl-ZOO; tpZ"1800; tl!ll"<I00; t.Z-1ZI'IOJ '''501'10; up"{Zpttpl/r, Zpl*tpz/r);I."{Z'pl'hl/r,

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 .." ..

IiI""~.~<>' ~'l'(JJll ,,[] ~.

t 1 tIe
Xlabll

I . ~""q l'.' ,;",1"

r',

.11'<"

,;,<,,' ) ;

ZO ;) 1 -

.ubplat(2,l,Z);

plotlolll!pl,anq);

ql:ld

(' 1,,;,r~"'.J;.:-. ;.1 .fr,',",;.l, I.";'," );

2223 Z'I-

,Iabel(

I'~"'''''' ,\, ,__ ,~jj"'~'I:


3j);

: i'" =--+ t:L; ;..-.-. ~-_~ ;. fj'J...,..,. :.... .... ""'. lUJPffmbFiCTjJ3l lI
.40
o

lJ

-t

"

U([O 1-) tHlel"j","

01

'i

02

OJ

j'!'

0,4

0.5

0.6

07

'-L~---l
0,6

0,9

normalindfteqlJency

ph.$8rISpOn8t

~ ,0

..,

Fig. 39

Chebyshev (Second Order) BEF

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];

~ " ," f lltl


,H'FI'.-,-,I

w.-.~

"':IlK
JiiiHII!l , ,'

'.,"'.'\1 :." ,

<il1!Il ~ -rUt""\" '.I.-.m't';n"' ... :un

IIIill

Ell'lg

.5-

~1'.f.'n".l'. ~~,t h,",l \';1\ .-112JII


(bl,.11"11ll1'1nva .jb, ,:t~l
OUtput

'7- b-l:

d-

I!I-

b 1.0000

1.0000

".
O\l~P\lt

Fig. 40 Analog to Digital Converter

FIR Filter Using Rectangular Window


Write a program for FIR filter using Rectangular window and plot its magnitude response.
'''''WfiiiiU''''$''''U;
fdt Tht CIIIIToOk llIIluiI Dllltap \MnIbII ~

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

FIR Filter Using Rectangular Window

Digital Signal Processing

lter Using Hamming Window


program for FIR filter using Hamming window and plot its magnitude response.
1Ji11110f I"iI dt (\M~II~IJf\.w,,,~\,llJh,,,,k\flf 1'<l.lt! ,btIIGp'viWidow

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-

~:~~:;;::~;::~'~J. t~:r~::,:~~;;/~j::;:/~~lr'~l\~,)~J;:~~;'~~r!l)~i\'r.!: \r, ; t?f p"nd',f<,'1:l tilur:


t'VP.-lnput('!'''if ..t ' 1Il1ltehe7P'
!l.",

\). ~ t.'r ~\I)<1 r,Itl>;1nn~H'~, ~Uar. \n ?

~;.lt.", ::n'

;);

tprlntt("<rr:r.llf IIIolpha-{H-l)/2;

;;.'.lr1'l"'l.tl,~,~d u,.l'.l~ ~; .'let.(J t eps-O.OOl;

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'): (

7111:I.1 (' liJtI~n1'_\\'i.,",t~ll;

;; start

f'

>

I ,~ '

f'" "'"

'J!

I,

~("

lb

101

Fig. 42

FIR Filter Using Hamming Window

lter Using Hanning Window


program for FIR filter using Hanning window and plot its magnitude response.
a
FiIt Id,lar Wt l IMAIIM1J\WPII.\d T0d5o.bIll
jJ

11~~k\l, o.IitGP

h,,"

no

r..

O! ')(

TIfXI: Cd

YiIi'libiV ItIIp <ill

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 ""',,'

1Ilm ..B... .. J. .. " J __ 1 !


\r, ~
:t'~'i'_

l;l$rJ11'~.,r t',P_'n' 'on '. 1'~I:

j~ 4 r

.,l~1l."I\<'1f.""):J~,l~,f\r. \n:! t

5110 '11 1212-

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

); ,/ (pl" (n.lph . p.)):

: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

FIR Filter Using Hanning Window

Introduction

to MATLAB

MAT33

FIR Filter using Blackman Window


Write a program for FIR filter using Blackman window and plot its magnitude response.
lilli,',' 1'1IIo ~dI (IMAIIAIJI\"""k\<II,I",ullll" rilei' eel TookDItuQ 0ItItnp hlalloJ'd"m 'M'llbo" ~
roO

d'

'x

I:lI#III j ~Il"', " !HH\l~lI1lQ$


i

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

\1:: !c',l' c':a"~l1",~~till<~" \r,

nput

( ..~,(" 'I~"\

'~~'<l

'j;

we-IInpi; 11-0;l:H~l; hd,ln(YC(II-.1phllo~P5J) .1 (pljn-1l1pl1e.+ep,)):

c.,ez
IIn-input (' ~;,",;:m':\),.a~')

'.'ll'.I,tt!I~IF"~,'~~', "n

'): ./ (pP (n-alpha+ep.)):

IIc"lI'll.p1; n"'O:l:N-l; bd"(.1n Ipt.ln-alph.+ep.)) -un(lI(l

(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

'); In- alpha+ep.))I,/lpt'ln-.lphl.+ep')):

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

FIR Filter Using Blackman

Window

Hilbert Transformer Using Window Technique


Write a program for Hilbert transformer using window technique and plot its magnitude response.

f't";'jii',!"*""Wi"'@'i
FlIIfll:Tel:l:ceiTooIIDebuilDe*l;o'MUM" ll ..0;;.. . IlT,.-.ItI.,'~' 1

',1'X

II

II.... {.Il.4).....~..(;;.i.l'..11I.lIII.~ .T.,' 4 'j;


t.(,L

...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-

,,-

Wln-banntnq(N): caSl!4 'Ilnblaclallan(N):

other"lse

."

dlSp(

"'1(:':')1

'un'zs-

,. -

:Z3i4-

n-O:l:N-l; hd-(l-cOII(p10(n-.lpha+eplI)))./lp1"(n.lphal+epll)); hd(dpha+l)-O: hn"hd.vln'; 1I-0:0.01:pi;h"':nq:a:(hn,1,w): plot (lI/pl,iO"lcQl11labslhll):

,u'z?-

tit 1. (, (":~'l"~ ':"~ll','l'l~"'); "'::~.


lllUlel('~",i:;'''U.\,.-:,1 .h<'!'''',~''",'\'I:

,label (.''''''.'',

II

':::::::::':"::"~'::;~'::"::'c;j::;;'::::""

';start.

j"'lIJl.J

.. ,"

~~l~'

Dl'

Ilf

?(

1'1 I

Fig. 45

Hilbert Transform Using Window Technique

MAT34

Digital Signal Processing

Differentlator Using Window Technique


Write a program for differentiator using window technique and plot its magnitude response.
"" &t:

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:

'.I!.!: r,,:;,";;;;; . .i 1>.\:;:;.;.:";";:;"

t.t~';ln i

.ir~\;,:;;;

... .... .

N~lnput (' ''',(' ... , fprtntt("\r,\r

'-"',J',;;

I;
i.:

5, 67e9 10-

t,pe-lnput('F'!N,r. .1ph.(1~-1)n: "ltch t,pe

t',r r."t':tll)';rr\:u '.t\ 'h", lJ1:\ct'11' '"7pr,

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

Using Window Technique

FIR Filter Design Using Kaiser Window


Write a program for FIR filter using Kaiser window and plot its magnitude response.
f-'ijt.iee'ifi'iil'Ei""eEFI
I'lIt !ell 1m ~ , DIbuQ 0I111tGp ~

o~..'("'1',u" "",b.~r, "~/"~,''1 ,; .!"i.lithll_WlGlilll -'c' : 1


j'i):'
_.I!:

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,-,,,

);

6"Ie . SI:10 :11 -

',b", ;;:r.dt tn~rl,;~r";:1 '); uc-un'pl; b-.l:1rl(H,uc!pi,ltal.U'[Ntl.b.etal);

n-O:l:N-l: ,,O:O,01:pl.;

in
:13 -

h-fnql(b,l,v); plot(v!p1,ZO'loql0(ab.(hl)): titla(; l"t".:ut''''''1 r:"'I!,')\\!!~'):


xlabel('",;rn"jJ_~~.,'d J:lf:r(\w.w;,'):

1'1-

,lab.l('~~:V,l~'.ld~ :dllt'):

i.,.
J~start

"'

jt~..-t"f.!"'~

i;JI ,.

r"

':~~::'~~-':':':'c;:::~"'" k~ 'I

Fig. 47

FIR Filter Using Kaiser Window Technique

Introduction

to MATLAB

MAT35

pler tll.i!.'I!,"NB'AMMI. II ($. 'Ill ..:;:jiAf.iille>l.iI'i(]ljl ,


I"lI Nt Tm Ctlfooll DItiug.:0it6Up
..

rogram for upsampling by an integer factor and plot its magnitude response. _[is;

,)6-

"

1,[!,!>lW,'), ~I;rj '., 'j tAll

(,,, ~"~.1"1r'l't'fJ.' '.';r

, ,1-

ct

clc
N-lnput ("'n!.!," n-O:H; r ',:.,. l;r,~':'~ ~)'!' Uk'
H;J",'\Tr:r

~-''''F''r~'

"

,in-

,lO-

Dl't-lnput("'I,';",r ':h.(, x'ln(Zpl."O.12"n)J '-llI!tOs(1,lllt'll!nqr-h(llJ

f.~I.'t."", .c,.'! ';l'~~t'l~~i~l'l\l"


1'lJIcl

"

l:

u-

'1311,1.5:16-

7((1: 1D1: leng'thl,lJl-x; subplot(2,l, 11: .telll(n,~) : tltle(" 111'(".'- ~(.,Iunl~";


llIKiel(' Il'); yllllJel ('>.ll.lP;'lt'j'd~):

,.>~.
llQilrile

1riMIt ,_ ,~:, ..,.. .-

1- x

i!J;e.~~$ i.'!iI G I

~ tl

;n-

subplot(2, 1,2); ,ull(n, 9'(1: lenqth(x));

0.5

11-

t
E

.~:~~
~in.ut.",",""
o

'

10
n

15

(~
o

10

lj start

jI

.,j,

15

~<

Fig. 48

Up-sampling by an Integer Factor

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

~11'iiii:;;:...i.iiie:{i" ~ibi!! .-""..IiiCilEiilij5


,I,
,r UH, O<f,"I".""'' , n"O,H-l; lIIt.tnp\lt('~l:.t;~t". tho!! liH!!!Q'<:!rr~c';,r :tc~ \\;:!I-:\tIll'!lllq" OlN-lIlt-II x"lIin(Z'p1'O,04Z'llIfl
N-lnJlut("-'

I:
r'~lHC' . I' .

'-X1 : lilt: Iltuqth(xllll .\II:)plot(Z,l,ll:


Itt (n,ll(11N)); title (' j nt" N"''l''<'''''~'); xlablll(',,'): ,1Ul.l(ffl'tlp~.\;;.'.l'~'1";

D"liI.'i~\ e.E\~ $ ~itiD"

Nt tdt htrt,

0t*0P ~

'HI/P

t'J

.ubplot(2,1,2); IIt (n,') I


tltll(";::;VIH'fl\llPl"",l

xltltlltl (' 1)'); flab.I('

,'n:')"Jl' "'!~\it;r.,:,r.'J; 00'.'p!lt\l,1e'j:

o 5
0.5

i~~
o

10

"

15

~ '~:~~l
5

10

15

MAT36

Digital Signal Processing

Decimator
Write a program for decimator and plot its magnitude response.

,. . ..
'1.0

s ,-

,. ,1' ,z

~ d~HII;J:IllI"J..'lir:.q):,1 a~. intt!\1Ut

tlioJ';i.ll'

c:learl~ ;
toh,..

N-input (' ~:n.r/?r A-O:M-l;

),~l\(lr,b
j.f",t'JI':t:

I"I!:

t.b'! :~{,qu/?r;\,,!~

)J

l-lnplltl'':':lll'.tt d.", 1l-1I1n(Z 'p1'0.042"n)

f(ll'\'.t'[ !'ur

,1GloIldWnvlill"'''

'I,

+81n 12'p1'0.

on

'n) ;

rdeci"'u Ill, JIll;


I\lbpJ.otIZ, 1,11:

iU-

:11 ~

in 'HI-

...

u- tielel' 1i<t'~UI""t'!d 1,;'1.\ :IU'. P-r.qUClI\t'.-r' I: 11- xlabel('Il'J: ,ll1bel(''itl'p.~1~.ur1~'I:

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-

,-lnterp (~, Ll: .lIbplot(l,l,l); IlIt91(n,ll(l:N)I;


xJKltJ('\\' I; ,JaDe! (, '!I1"f,li'.:;;;It:'); 8u))plot(Z,1,2); lll-O: (NLI-I: 5tt (m,J(1: (N-LIII: t 1t 11 (' ,l',': '!'l';;"1j.~t~~;t ')\It 'Put ,~c:,\e!,,~' lllabel (' I': ); ,laDel (: ""~f,' ':.",,:11" l:

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

...

Sampling Rate Converter


Write a program for sampling rate alteration and plot its magnitude response.
~~'~IJ~~,\~UII~I!m;~"lm~Amn=!W~"~lm{ga'~m'='lIlm="m'~,J,=",~a~!!m"~!I';I) 111111111111.1111

f"

111' .1.
m m 8

Edt Ta.

e.1 T/lllk DItiuIlOesltop""'"

n <Ii'11II', 'Ii 1 \ .,~" v Zcllar,,;)


1",

ft

<>

.> .

'"

f.

(J:iJ '" ~ 111110ltl(... l

...

"[It

,,.. ,8,'lO-

,-

,"

N-Input' I.-input ( !I-input I' ,~"',,"" \"r.,;r'l":': t)!;','n 1l-.1n(2"pl0.042n)+!I1n(2"pl*O.03'Pn); ."


.L'I ,1{,~r,."'''1I1~1'J..\;''l "

."

,-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,'

~Il '~t::l.lU" nel: ); I: VI.btl('"'"!,) ..:':."L.); .

CuI. 1,;'
.. ~mm ... m,;;;

i.

Fig.

52 Sampling Rate Converter

Two Marks Questions and Answers


Chapter 2 Introduction to Signals & Systems
1. Define signals

& 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

Digital Signal Processing

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

The energy of DT signal x( n) over a period -N ~ n ~ +N is given by


Lt E

The power of DT signal x( n) over a period

-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

to its values at wave etc. expressed

Two Marks Questions

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.

Define fundamental period for a periodic DT signal. The fundamental


x(t) =x(t

period

of To a DT signal

x(t) is the smallest

positive
To = 211'.
COo

value of T for which

+ T) or the CT signal exhibits periodically. It is defined as


periodic?

10. Is the signal x(t) = 2cos (3nt) + 7cos(9t) Solution


x(t)

= 2 cos (3m) + 7 cos

(9t) 211' 2 3

co)

=311', then 1i

=-=-=311'
COJ

211'

The given signal is said to be periodic if 1i must be rational.


T2

1i
T2

3
which is irrational.

= 3" x 211'=;;

Hence, the given signal is not periodic.

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

Digital Signal Processing

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)

Let us define x] (n) and x2 (n) as


x] (n) => y][n] x2 (n) => Y2[n]

= Ax}[n]+ = AX2[n]+

B B

Let us define

x3 [n]

such that
x3[n] Y3[n] Y3[n]

= ax] [n] + bX2[n] = =


AX3[n]+ B A[ ax] [n]+ bX2[n]]+ B B ::;:. y] [n] a

Y3[n] =aAx] [n]+ bAx2[n]+

+ bY2[n]

Hence, it is non linear system. Test for time-inva riant Introduce time delay
no

in the input signal,


y][n]

= Ax] (n-no)+

(I)

Introduce time delay

no

in equation (I),
y[nno]

= Ax(n-no)+

(2)

On comparing equation (1) and (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

Two Marks Questions

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

The total energy of the given signal, E

= 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)

= cos 150n t where

w2

= 150n

T =2n =~=~
2

W2

150n 3 2 2

150

11 I 150 -=-x-=T2

50

211 =

3T2

= T = ~ is periodicity of the given signal. 25

15. Find the overall impulse response of the causal system shown in figure below.

y(n)

TQA6

Digital Signal Processing

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

(ii) Step signal


u(t)

u(t) o

0, {I, t;:::O 0

(iii) Impulse signal

J(t) =

( ;t {I0, (=0 0

'

Two Marks Questions

and Answers

TQA7

(iv) Ramp signal


r(t)

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 :#

(ii) energy or power

eU(I+T)

Hence, it is aperiodic (b) x(t) = e-j2rrji Since


roo

= 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

Hence, it is not energy signal.

TQA8

Digital Signal Processing

The condition for power signal is


7'

=,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]

E~ = 00 Hence, it is not energy signal.

Two Marks Questions


T

and Answers

TQA9

p=

7~~T

.u

-!.

j
T
2

T
2

le-iClVl2

dt

P=Lt~fldt T~~T

T 2 T

= T~t~ i[t ]~:c


2

P P~

= r~~ J.. [!.. + !..J Lt T 2 2 =1

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

(a) A signal x(t) is said to be an energy signal if E = "Lt


7~<Xl

r
2

Ix(t)j2 dt is finite, that is,

TQA10

Digital Signal Processing

(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

Hence, it is not an energy signal.


1 Lt T~oo 2

f
0

1 dt
7'

p=

T~oo

Lt

-[tF 0 T

P = T~oo J.. [!.-J Lt T 2

p=It is a power signal.

20. Define and plot the following signals.'


u(l) = 0,

-1'" 2 pulse 0,-2'


r(t) u(t) x(t)

1<0 otherwise n<O n~O I~ 0 I~O Id<L 0,Signal 0,

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

Two Marks Questions

and Answers

TQA11

. otherwise

!!:!l.lnls -~.ltlsa a

n=O t=0 x(t) 012

TQA12

Digital Signal Processing


n",O 1",0 n~O I~O n

B(n) = 0(1)

x(t) DT Signal o(t)

O. O. u < 1 exponential delay Signal o . otherwise u > 1. exponential rise DT Signal n

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,

Two Marks Questions

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)

The output response y(t) indicate the system is an integrator.

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

Digital Signal Processing

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

for all t then the system is called stable system.

(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

24. Is the following system invertible, y(t) Solution


For y(t) = x2(t) y-I(t)=x(t)

= x2(t)?

25. Test whether the system y(n) Solution


i.

= n x(n) is (i) linear (ii) time invariant.

y(n)

= n

x(n)

(1)

The condition for linearity is that for an input signal,


x(n)

= 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.

Two Marks Questions

and Answers

TQA15

ii.

Introduce delay

no

in equation (1) y(n)=nx(n-no)


(3)

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)

Hence given signal is periodic with periodicity I. 27. Given y(n)=x(n)+-x(n-I)+-x(n-2).

I
3

Find whether output signal y(n) is stable or not.

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

Digital Signal Processing

28. Perform addition and multiplication on the given inputs. Solution


x,(t)

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

Two Marks Questions

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

Digital Signal Processing

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

30. Verify whether the systems are stable or not. Solution


(a)

h(n) = bnu(n) The condition for stability is

<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

Apply Bernouli's theorem

..
J t.sint.dt= t.(cost)l~ -l.(-sint)l~
o

= -t cos tl~ Hence, the given system is unstable.

+ sin tl~ = 00

Two Marks Questions and Answers

TQA19

(c)

h(t)=e-i21

u(t)
00 00

Jle-i211 dt=
o
00

Jl dt
0

Jle-21! dt=tl~
o

=00

The given system is unstable. (d) y(n) =


4n-1

u(n - 2) y(n) =
4n-1
00

u(n - 2)

y(n) = L4n-1
n=2

00

y(n)=-L4n 4 n=2

y(n) The system is stable.

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.

(a) (b) (c) (d)

y(t) = x(t) y(t)

+ x(t + 1)

Memory system Memoryless system Memory system Memoryless systems

= x3(t)

y(t) = x(n -1) + x(1- n) y(n) = e./nu(n)

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-

to) + 2(t - to) x(t -

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

Digital Signal Processing

(b)

yen) = x(n)cosam

Introduce time delay to input signal alone


yen) = x(n-

no)cosron

(I)

Now, introduce time delay to output signal also


yen - no) = x(nno) cosro(nno) (2)

On comparing right hand terms of (I) and (2)


y(n)y(n-no)

Hence, the system is time-variant. (c)


yen)

= ex(n) (I)

Introduce time-delay in input signal alone


yen)

= ex(n-no)

Now, introduce time delay in output equation also


yen-no)

= ex(n-no)

(2)

On comparing right hand terms of equations (I) and (2)


yen) = yen-no)

Hence, the system is time-invariant. 33. A pair of sinusoidal signals with common angular frequency is defined below.
xl(n)

= sin 51t'n, x2(n)=.J3cos51t'n.


XI

(a) Specify the condition which the period N of both

(n) and

X2

(n) must satisfy to be periodic.

(b) Evaluate the amplitude and phase, angle of the signaly(n)= xl(n)+x2(n) Solution N= 21t'm

n 'wherem- _. 1,2,3, ...


2
5

Here

n = 57r,
.

N=-.m=-.m
51t'

21t'

Ifm=5, 10, 15,20, . then N= 2, 4,6,8,

(b) The amplitude A and phase angle ofthe We would like to expressy(n)
yen) yen)

signal, yen) =

XI

(n)+ x2(n) is

in the form Acos[On+q,]. Hint cos (A + B) =cosAcosB-sinAsin


A sin(On) sin tJ>

= Acos[nn+tJ>]
=
Acos(nn)costJ>-

B (I)

Two Marks Questions

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,

Therefore, phase of the signal is given by,

,/,

'I'=tan

cos~ -I [sin~]

--

~=tan-l[~]=_~ Similarly, the amplitude of the signal is given by,


A = ~[amplitude

of x] (n)]2 + [amplitude ofx2 (n)]2 =2

=~(1)2+(.J3i The output signal y(n) can be expressed as,

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

will die-down to zero either at - 00 to

00.

So, it cannot be

x(O), where r> I. Prove that system is astable.

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

Digital Signal Processing

Unit step function


u(n)

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

H(Z)= H(Z) = H(Z) _ H(Z)


Z

(1-3.5r'

(3-4rl)

+ 1.5r2)

Z2 -3.5Z

Z(3Z -4)

+ 1.5

Z(3Z -4) (Z -3) (Z -0.5)


(Z - 3)(Z - 0.5)

3Z-4 =-----

H(Z)=~+_B_ Z Z-3

Z-0.5

A = H(Z)x(Z -3)1'Z=3 Z

=2

B = H(Z)x(Z -2.5)1 Z=2.5 = Z


H(Z) 2 1 --=--+-- Z-0.5 Z Z-3 Z Z H(Z) = 2--+-Z-3 Z-0.5
2 1

H(Z)=
Taking inverse transform

1-3Z + 1-0.5r1

hen) By the definition of stability,

= 2(3t u(n) +

(~r

u(n)

00

Ilh(n)l<oo
n=-oo

Two Marks Questions

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)

3-4Z-1 1-3.5Z-1 + 1.5r2

X(Z)

+ 1.5Y(Z)r2

= 3X(Z)-4X(Z)r1

+ 1.5y(n- 2) = 3x(n) - 4x(n-l)

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 .

samples per second.

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

& sufficient condition for causality?

TQA24

Digital Signal Processing

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)

A system is called time-invariant ifits input-output characteristics do not change

= F[x(n), x(n -I), x(n - 2)...]

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)]

relation of a capacitor is v(t)

=- -; 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)
,

, ,,, ,3 , -4 ,2 4 x2(n) 2," x3(n) ~/ 3," -~/' -~/', x1(n)

y(n) = x(n) y(n)={2,

* 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)

Substitute equation (I) in system equation, that is,


y(n+

2)

=a
=A =A

[A xI (n+ 1)+ B x2 (n+ 1)]+b[Ax] [ax] (n+I)+bxl(n+3)]+B[ax2 y](n+2)+BY2(n+2)

Hence, it is linear.

TQA26

Digital Signal Processing

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.

Define convolution integral ofa system y(t) =

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

y(t) = Solution Introduce delay


to to

f x(t) dt
1=0

input alone, that is,


T

y(t) = Introduce delay


to to

f x(t-to)dt
1=0 T

(1)

output equation, that is, y(t-to)=

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

Two Marks Questions

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

Solution The homogeneous equation is,


d2 yet) dt2

+ S dy(t) + 6 yet)
dt

=0

The standard homogeneous

solutions are
Yn(t) = Ce).1 dYn(t)

dt

= CAe).1
= CA
2e).1

d2Yn(t) dt2

Therefore, the homogeneous

solution,
CA 2e).1 + SCAe).1+ 6Ce).1 = 0

Ce).1[ ,1.2 + SA + 6] = 0
,1.2

+SA +6 = 0

The roots of the equation are AI = Therefore, homogeneous

-2 and

,1.2

=-3

solution becomes
Yn(t) = C1e).l(+C2e"21 (2)

The forced solution to the given input signal x(t) = u(t) is


Yp(t)

=C

Therefore, the differential equation becomes


dy~(t)
dt2

+Sdyp(t) dt

+6y

(t)=

dx(t)+x(t) dt

O+SxO+6C=O+1

C=~
Therefore,

(3)

TQA28

Digital Signal Processing

The complete solution is,


y(t) Y () t

= Yp(t)+

Yn(t) (4)

= C]e -21 + C2e -31 +-1 6 = C] +C2

Substitute t = 0,
y(O)

+6
-31)

(5)

Differentiate equation (4) and set t = 0

d:;t) = C] (-2e-21) + C2 (-3e


dy(O) = -2C] - 3C2 dt substitute the initial Conditions in equations (5) and (6),
1 = C, +C2
1=

(6)

+6
8

(7) (8)

-2C] -3C2 7

On solving equations (7) and (8) C, Therefore,


8. Y () t

=- 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.

Solution Apply Kirchhoff's voltage law to the given circuit.


x(t)

= R yet) + L

dy(t) dt

(1)

The homogeneous equation is,


L dy(t)

dt

+ R yet) = 0
= CeA1

(2)

The solution to the homogeneous equation given in (2) is


Yn(t)

(3)

Two Marks Questions and Answers

TQA29

Substitute equation (3) in (2)


L.C)..eA1
CeAt

"

+ 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)

= e-si L.C(-5e-S')+RCe-s, 1 -5LC+RC=


C(-5L+ R) =

C=_l_ R-5L
Therefore, Yp(t) = R-5L The total solution is y(t)

_l_e-s,
R

(5)

= Yn(t)+ Yp(t) --I


L

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

Digital Signal Processing

10. State the properties of convolution. (a) Distributive property


x(n)

* [hi (n)+

~ (n)]

= x(n) * ~ (n)+

x(n)

* ~(n)

(b) Associative
[x(n)

property
(n)

* ~ (n)] * ~

= x(n) * [~(n) * ~

(n)]

(c) Commutative property


hI (n)* ~ (n)

= ~(n) * ~ (n)

Then,
x(n)

* hen) = hen) * x(n)


x(t) h(t)

t----..,
o

11. Given x(t)and h(t) . Findy(t).

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

Two Marks Questions

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.

Two Marks Questions

and Answers

TQA33

14. Find the linear convolution of x(n) Solution


x(n) h(nJ

= {I, 2, 3, 4, 5, 6} with h(n) = {2, - 4, 6, - 8} .

-4
6

-8

y(n)={2,

0, 4, 0, -4, -8, -26, -4, -48}

~
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

Digital Signal Processing

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,

y(n) y(O) y(O)

= 0 (no overlapping of datas) = x( -1) h( -1) + x(O) h(O) + x(1)


h(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)

(iii) For n = I, (iv) For n = 2,

y(1) y(1) y(2)

= x(O) h(O) + x(1) h(1) + x(2) y(2) = 0 + (2 x 2) + (3 xl) = 7


y(3)

(v) Forn=3, (vi) For n > 4,

= x(2)

h(2)

y(3)=3x2=6 y(n)=O :. y(n)

= {I, 4, 7, 6}

Two Marks Questions

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

yen) = {I, 4, 10,19,30,36,35,26,

14, 5}

18. Convolve xU) = e-z/u(t) with h(t) = u(t).


x(t) h(t)

TQA36

Digital Signal Processing

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)

n 20. Find y(n) = x(n) Solution y(n) = 0 for all values of n.

=1
Inl

n=-l
+ x( -n) . Given x(n) = {I-01 for n = 0 and for
>1

Two Marks Questions

and Answers

TQA37

o 21. Find y(n) = x(n) + x( -n) for x(n) = {I . Solution y(n) =

for for

n = Inl= 01and In I > 1

o Inl 1 {2 for n ==0, Inl > 1

22. Find y(n) = x(n + 3). Given Solution

0-1 n = 0, Inl > 2 x(n) = {I n = -1,-2 1,2

0-1 for y(n) = {I for

n = -4, n<-5, n=-3, - 2 n = -I, -5

n>+1

n = 1,2

n=-I,-2
Solution

23. F;nd y(n) ~ x(2n+3). Given x(n) ~ tl

n = 0 and

In! > 2

y(n) =

-I n = -2 0, n=-I {I, otherwise

-2 ~ n~
24. Given x(n)={~ Solution

. ot h erwlse . Find y(n) = x(3n-2).

y(n) =

0, {I,

otherwise for n = 0, 1

25. Find the convolution of x(n)

= anu(n) with h(n) =


0, n~ 0 {I, 0 ~ n ~ 9
h(k)

x(k)

234

234

TQA38

Digital Signal Processing

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

Two Marks Questions

and Answers

TQA39

For n> 9 x(n-k)

-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

26. Find the convolution of the following sequences.


(i) x(n)
x(k)

= 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

There is no overlapping of sequences


-k

-6

-5

-4

-3

-2

-1

TQA-40

Digital Signal Processing

h(n-k)

For (n - 3)~0, y(n) =

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)

* h(n) = h(n) * x(n)


= ~(n)*ht(n) y(n)
x(n)
y(n)

Associative law of convolution [x(n)


x(n)

* fit (n)] * ~ (n) = x(n) * [fit (n) * h;. (n)]


y(n) x(n) h(n) = h1(n) h2(n) --~ y(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 ,

Two Marks Questions

and Answers

TQA41

Synthesis equation of DFT,


1 N-)

x(n)=-

L X(k)eJwn,
n = -1 elsewhere n = -2, 0, I

n=O,I,

... ,N-I

k=O

29. Obtain the convolution of x(n) = Solution


i.e. x(n)={I,

2, 0, 11,

and h(n) = c5(n) -c5 (n -1) +c5 (n - 2) -c5 (n - 3)

2,1, I}; h(n)={I,

-1, 1,-I}

1 1

, , ,, -1 ,, , , ,, -1

The convolution sum y(n) =,x(n)

* , -1-111,,h(n)1 -1 -2 , -1 ,,,,1 , ,,1 -2 ,1, -,2 12


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-

2)+ 2x(n) - x(n - 2)

(I)

The complete solution is sum of natural and forced solutions y(n)

= 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

Digital Signal Processing

The solution to the homogeneous

equation becomes
(3)

Substitute equation (3) in (2)


).,n _7).,n-] ).,n-2[).,2

+ 12).,n-2 =0

-7).,+12 ]=0 ).,2-7).,+12=0


,12

The roots of the equation are The homogeneous solution is

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)

The particular solution to the signal, x(n) = u(n) is K


yp(n)

=K

(6)

Substitute equation (6) in (5)


K-7K+12K=2-1 K='!"
1

Therefore,

yp(n)="6
y(n)

The complete solution,

= Yn (n) + yp(n)
n

y(n)=C)4 Letn=O, y(O) Put n = 1,

+C23

+6

= C)

+ C2 +6

y(l)

= C]4+ = 7y( -1)

C23+"6

y(O) can be obtained by substituting n = 0 in equation (1) y(O) -12y(-2)

+ 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.

Two Marks Questions

and Answers

TQA43

Similary, putn=I, y(l) = 7y(0) y(l)

-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

C _ 35 j - 12 The complete solution is, y () n


10 353n 1 =- I4n +- +12 12 6

Chapter 4
1.

Fourier Series
1
roo

Determine
a_3

the signal 1
a_s

x(t) whose fr~quency 1 1


and
a_7

= 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)

+ a_3e- j3(31r1) + a_2e- j2(31r1)


a4ej4(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

1 1 1 2 = 1+ -cos 3nt + -cos 9nt + -cos 15nt + -cos21nt 2 3 4 11


2.

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

Two Marks Questions and Answers

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-

[~

cosnt dt + J cosnt dt +2 J cosnt dt n ~ ~

I 2 I . 2 Sm nt SIO nt =-nnn -2 (cosnt+ntslOnt)l 0 +--1 2 +2--1 n~ n~

[ {

~} .

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)] 2. ) -;;SInT I . nn]

nn 2 = (nn)2 ( cosT-I ) = (nn)2 2


2 = (nn)2 [ COS (nn)

2 nn nn. nn =;I [ nn2 ( cosT+TSInT-I

+7SIO (nn) -ITSIn (nn)] nn . nn.

nn cosT-I )

TQA46

Digital Signal Processing

21,,+7'

bn

= T f x(t) sin nroot dt


I"

= - f - sin nt dt + f sin nt dt + f 2 sin nt dt rr 0 rr rr rr

I ri2t

2 rr

2rr

1
n
rr

rr rr n2 =-.!.[3-[_1 (sinnt-ntcosnt)]i rr rrn2 = -.!.{2.[sin rr rrn2 =-.!.{2.[sin

+[_ cosnt]rr2 +2[- cosnt]2rr] .


n 2 n '!-[cosnrr - cos nrr]_3-( cos 2rrn - cos nrrl}

n!:

2 2 2 nrr _!!!!.-cosnrro]_

2 2 2 n nrr _ nrr cos nrr]_.!-[(_It

2 n -cos nrr]_3-[I_(_ltJ}

= - --sm - - -cos- --+ rr [2 2 2 n I rrn2 . nrr n I nrr (_I)n =3.


rr I

-cos- - + -(-I) n 2 2 2 I nrr n n

n]

-sm---+-(-I) rrn2 . nrr 2 2 n [2

n I

n]

What is Fourier representation?

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

sin A cos B = .!-[sin(A- B) + sin(A + B) 1 2

2rr

4.

Find the Fourier series of the signal x(t) = f sin2rrfomtcos2rrfont


o 2rr

droot where m and n are integers.

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

= - f sin roo(m - n)t droot + - J sin roo(m + n)t dwot


2
0

2rr

Two Marks Questions

and Answers

TQA47

= ~[COS 2

COomn) n)t ]2rr (m (- 0

+ ~[COS 2

COom n) n)t ]2rr (m ( + + 0

2 = ~[COS(m xU) 5.

(m-n) - n)2n - COSO]

2 (m+n) + ~[COS(m + n)2n

- COSO]

= ~[O]+~[O] 2 2

=0
signal x(t)
X(t)

Find the Fourier

series for the periodic

= t,

O::S;::S;1 and repeats 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

Digital Signal Processing

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

The frequency components are: DC component

"2

and AC component is

cos41l' ft 2 .

Chapter 5
I.
Find the DTFT of x(n) =

Fourier Transform

(~r

u(n)

and plot its spectrum.

Solution

x(n)=(~r

u(n)
00

The DTFT is given by


X(eIW)

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

=------ - jsin (2 - cosw)2


=
J(2-COSW)2 2

IX(eIW)1

+(sinw)2

The phase angle is arg [X (eIW)J = _ tan -I [ 2 -coS(j) ] sin w

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

Digital Signal Processing

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]

Two Marks Questions

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

rier series s time signals es representation.

4.

Determine the impulse response of the continuous-time


d2 y(t) dy(t) --2-+4--+3y(t) dt dt

system described by the differential equation

= --+2x(t) dt

dx(t)

using Fourier transform.

Solution
d2y(t)
~2

+4

dy(t) +3y(t)
~

dx(t) +2x(t)
~

Apply Fourier transform,


(j(J)2 Y(j(v)

+ 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)

B= -3+2 =.!.. (-3 + 1) 2


1 H(jm) 1

= _2_+_2_
)m+ 1 )m+3

The impulse response is given by


h(t)

= ~[e-'u(t) + e-3'u(t)

TQA52

Digital Signal Processing

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.

Solution Calculation of Weightages Stage I: wZ =1


4

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

Input sequence in bit reversal order


xr(n)

= {0.5, 0, 0.5, 0, 0.5, 0, 0.5, O}

-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 (1) = 0.5 + 1.207j

x(2)=0

x (3) = 0.5 + 'P.207

x (4)= 0

x (5) = ~.5 - 12.07

-l
~ o
x(6)=0 l ~
:s:: ,...

o c:
<II CD

x (7) = 0.5 - 1.207j

!!i

o' ::J
<II

l
::J

a.

>
::J
<II

~ ~ en

TQA54

Digital Signal Processing

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

If x(t) and X(jro)

are the periodic signals and its Fourier transform, then the average power of a
00 00

periodic signal is given by

-co

f Ix(tt dt = f x(t) X (t) dt


-co
00

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

Ix{jro )12 dro

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

The Fourier transform of ro(t) is given by


00

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

Two Marks Questions

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)

= {I, 2} and x(n) = {I, 2, I} using DIT-FFT algorithm.

* 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}

X(2) = 4 X(3) X(O) 0 X(1)=-2j2j

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

Digital Signal Processing

2 h(O)= 1 -1 2 -1 W!:i =1 WN =1 0 2 h(1) 2 h(2) = 1

W~ Y(k) = X(k) 0 H(k)

=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

W!:i WN =1 -4+2j -4-2j

"'2

12

8
W1 =J. N

y(n) = 2-{ 4, 16, 20, 8} N


1

=-{4, 16, 20, 8}={1, 4, 5, 2} 4


8. Find the DTFT of h(n) = Solution

(~r

u(n). Also determine its phase and magnitude.

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

Two Marks Questions

and Answers

TQA57

H(e!w)=--1 --e jw 1 -

=---1- 0.2eMagnitude is given by iH(ejW)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

.JI + 0.4 - 0.4 cos w

IH (e!W)I = ---;=====. 1 .J1.4 - O.4cosw Phase is given by ~-IH( e


IW)

= - tan

Real term -1 [Imaginary term] I-0.2cosw -I ( ---0.2sinw

-----

. =-tan ~-- e IH( IW) 9.

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) =

o(n) = Iatn = 0 - jsin w] jsinw


W)2

1-[cosw

o(n-l) = Iatn=I and both are '0' elsewhere

= I-cosw+ IH(ejW)1 = ~(l-

cosw)2 + (sin

= ~I- 2cosw+ cos2 w+sin2 w

TQA58

Digital Signal Processing

Hint
iH(ejW)1

= )4sin2 = 2sin ;

sin2 8 = _1_-_co_s_2_8
2

IH(ejW)1

The phase is given by, iH( efW) =tan ~---

-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)

Substituting equation (2) in (I) = tan-1 {tan [90co 1f co = 90-"2 = 2"-"2

IH(ejW)

;]}

H(eJW) 1

10. Determine Solution

H(eJW)

for y(n)+"4y(n-l)=

x(n)-x(n-I).

Plptthe magnitude and phase response.

y(n)

+- y(n -I) = x(n)4


= X(ejW)-

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)

Magnitude is given by ~(l-cosco)2


+sin2
co

(I+COSCO

r +(sinco r

Two Marks Questions and Answers

fQA59

.Jl +ooS2 (t)-2~sco+sin2


11 -cos + 16 2 OO+-COSOO+ -sm 1 1'2 2 16

co

00

";2 - 2 cos 00
1+ -

Hint
cos2 co + sin2 co = 1

16 2

+ - cos 00

1 (ejOJ)1= .J2(l- 1 (0) H cos 17


-+-COSOO

16 2

Hint

2( 2sin2 16 2

~)

----

1- cos 200

17 1 -+-COSOO

=-

sm

00

1- cos 200 = 2sin2 1- cos 00 = 2 sin2

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)

= tan-1 smoo [.] cos 00 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

Digital Signal Processing

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

1-o.25sinco + 0.25 cos

co ]

2.666 0 IH(eJW)I= 0.636 1.372 2.195 .

2sin w

1 + O.25cosw -o.25sinw)

!H(e)W)=90-W-tan-1( ~~~+ O.5cosw

Magnitude

Spectrum

Phase Spectrum

2.5 2.0 1.5 1.0 0.5


ro

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

Two Marks Questions

and Answers

TQA61

<Xl

<Xl

= L(a.ejrot
1

+ L(a.e-jrot
0

aejro + =------- 1- aejro


a2

1- ae- jro
a [ ejro

aejro + a2

l-a2 =
X(ro)
1-

+ e- jro ] + a2

Leta=0.5

1-2a+a2 = Since 1!' a= X(aJ)1 21!' 0.5 1- 2acos1!' +a2

= 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

Digital Signal Processing

- 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.

13. How can we obtain linear convolution from circular convolution?

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.

Two Marks Questions x(n) h(n)

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}

h(n) = {I, 2, 1,0,0,

5 1 1 12 0 20 2 5 7 7 3 19

is 20, proved. 2, thus 19, 7}

(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

Digital Signal Processing

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

Y(Z) = h(O)X(Z)+ h(1)r1 X(Z)+ It can be realized as shown below.


)((n)

X(Z)+ ... + h(N _l)Z-(N-1) X(Z)

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

N-I -.I{ ~ )k-n = L x(n)e k = 0, I, ... , 7 n=O.


7

For k=O,
Fork=l,

x(O) = L x(n)eO n=O =0+0+1+1+1+0+0+0=3

x(O) =

x(n)e -(
.

~)n

= n:(oO) x(1)e- i( ~) + x(2)e - i( %) + x(3)e +


+x(4)e-.I1t +x(5)e

f:)
-.1.71t

-.1.51t

+x(6)e

-.1.31t

+x(7)e

= -1.707 -1.707 j

Two Marks Questions

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

=)+0.707-0.707)-1 =-0.293+0.293) Fork=4,


7

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

= - )+0.707+0.707)-1 = -0.293 - 0.293) Fork=6,


x(6)

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

=)-0.707+0.707)-1 = -1.707 + 1.707)


x(k)

= {3, -1.707 + 1.707), ), - 0.293 + 0.293), 1, -0.293 - 0.293), - ), -1.707 + 1.707)}

TQA66

Digital Signal Processing

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}

y(n) = x(n) * h(n)


x(1) = 2 2

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

22. What is decimation-in-frequency algorithm. Solution

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 ~

2 samples. The first sequence

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

Two Marks Questions

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)

has values for

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

Digital Signal Processing

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

(n) = {I, I, 2, I}; x2 (n) = {I, 2, 3, 4}.

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.

Determine whether the following systems are LTI.

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)

Let x3(n) = axl (n)+ bX2(n) , then

AX3(n)+B

= A(axl(n)+bx2(n+B

= aAxt(n)+bAx2(n)+
Therefore, the system is non-linear.

B:;tAYt(n)+

Two Marks Questions and Answers (i)

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)

y(n) = x(2n) Let xt(n), x2(n) be two inputs

Y3(n) =x3(2n)

= axt (2n) + bX2(2n)


= ayt(n)+bY2(n) There the system is linear. Introduce a time delay to inputx(n)
Yt

(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)

en :::J C> :::J <C.:... -U

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 (2) =1 x (6) =1 x (5) =1 x(7) =0

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

Two Marks Questions

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]

X(l) = [-0.707 - jO.707]

e}4
[ .3rr]

= lx7 = 7
=[-0.707= 1.336 + jO.082

jO.707] [-0.996+ jO.088]

X(2)

=-j

[/:.2]
}3rr

= - je 2 = - j(0.984 - jO.176)
= -0.176 - jO.984 X(3) =(0.707jO.707) (-0.924jO.383)

= -0.923 + j0.383 X(4)=I'e


13rr.4 4

= l'e3rr}
=1(-1)=-1

}rr.s
X(5) = 0.707 + jO.707.e
4

cos4+ =(0.707+ jO.707) [15n. .

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]

= j [ cos2+ 9n =j[O+ j]=-1

jsm2 . 9n]

TQA72

Digital Signal Processing

= [-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)

j0.499 + 0.499 = 0.998

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

j"n x(n) e --2

= X(O)+x(1) (-j)+x(2) =0+(1) (-j)+2(-I)+3(j) = -2+2j k=2,


3

(-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-

= x(O) + x(1) e =-2-2j :. X(k) 0~n~5

-2 +

3j1!

_ 9j1!n

x(2)e-3j1!

+ x(3) e

= 0+(1) (j) + (2)( -1)+ (3) (- j)

= {6,-2+2j,-2,-2

-2j}

(ii)

x(n) =

0, {I,

otherwise

Two Marks Questions and Answers DTFT,


co

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

27. Find the impulse response of the given difference equation

y(n- 2)- 3y(n -1)+ 2y(n) = x(n -I)


Solution Z-2Y(Z)-3Z-1y(Z)+ 2Y(Z) = Z-IX(Z)

Y(Z)[Z-2 -3Z-1 +2]= Z-IX(Z) H(Z) = Y(Z) X(Z)

Z-l
=

Z- -3Z- 1+2 => system function


2

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 , ~

, ",

:. y(n) = {I, 4, 10, 19, 30, 36,35, 26, 14, 5}

28. Find the Fourier transform of x(n) =


X(eJcon)

co

(~r
-

u(n).

= L
n=->

x(nfe-jcon

= L

.. 2 n=- (I)n

u(n)e-Jwn

TQA74

Digital Signal Processing

I-!T1
29. Find the inverse Z-transform of X(Z)

(l-T I)3(l+2T I' )


Z-}
3Z

IZI > 2

I+TI-2T2

Z-I
3Z =----=----

Z2+Z-2
Z2

Z(Z -I) 3(Z2+Z-2)

=
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

30. Find the convolution of x(n) Solution

= {I, 2, 3, 4, 5,6} y(n) = {2,-4, 6, -8}

. ,, ,

. , ., ,

, ,

."'-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)

* y( n) = {2, 0, 4, 0, - 4, - 8, - 26, - 4, - 48}

Two Marks Questions

and Answers

TQA75

31. What is the need for FFT? Solution


N-I

The direct

evaluation

of OFT using the formula,

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

...y(n) = {24, 22, 24, 30}

TQA76

Digital Signal Processing

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

x(O) = - :L X(k)eO 10 k=O


1

=-[5+0+1+
10

j+O+I+O+I+

j+O]

8+2j 4+j =--=-- 5 10 Forn=

I,
1 9
}1I"k

x(l) = -

10 k=O

:L X(k)e

+1e }211" 1311" S +je S +0+leJ1I"+0+e =}O 5eO+0.eS }11" I[ .

S +je S 1711" 1811"]

= -..!..- + 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]

= -..!..-(5.558- 0.442j) = 0.558-0.0442j 10

Two Marks Questions and Answers

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]

For n =4, 1 x(4)=9 j4nk


S

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

= 1~[5eO +1.ei2n =-"!"-[5+1- j-l-l+ 10

+ jej3n +eiSn +ei7n + jej8n] j]

2 =5

Forn=6, 1 x(6) = -

10 k=O

I
9

j6n k

X(k)e

= 10 5eO+ eJS + jeJs


1 [ 1
.6n

.1811'

+ ej67r +

/-s

.427r

+ jeJ-s

.48n]

= -[5
10

+ 0.309+ 0.95j + 0.309 j + 0.95+ 1+ 0.309+0.95j

+0.309 j + 0.95]

= -"!"-[8.518+ 2.518j] 10 = 0.8518+0.2518j

TQA-78

Digital Signal Processing

Forn =7,
1 9

/"k
5

x(7) :;:; L X(k)e 10 k=O

=10 5eO+1.e
1 [ 1

14"

+je

J~

+e/7"+e
.

/9"

+je

/6" ]

= -[5 -0.809+ 0.588j +0.809 j -0.588-1 +0.809-'- 0.588j -0.809j + 0.588] 10 =


Forn=8,
1 9

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.809- 0.588j - 0.809j -0.588+ 1-0.809-0.588j

-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 + je/-5 +ej9" .18" .27"

+e/-5

.63"

+ je/5

.81"]

= -[5+ 10
= 2
5

0.309-0.95j -0.309j + 0.95 -1-0.309+0.95j

+ 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.

Find the inverse Z-transform of X (z)

(l-r

)(1+2r )

1 '

IZI > 2

Solution

l-.!.rl
X(Z) = 3

(l-rl) X(Z)=_A_+ 1-r1


A

(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

Digital Signal Processing

2.

Find the inverse Z-transform of X (Z) =

I-UTI

+0.9T2
1

. For ROC 0.5 < Z > 1 .

Solution X(Z) =

(l-TI) (l-0.5TI)

A =--+--- B I-T1 1-0.5T1


A =

(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

y[n] - 4y[n -I] + 3y[n Y(Z)-4T'Y(ZJ+3r2y(Z) Y(Z)

2]= x[n] + 2x[n -I]


= X(Z)+2TIX[Z] = X(Z)

[1-4T1 +3T2]
X(Z)

[1+2rl] (l-3T1) (l-rl)


B

Y(Z) = H(Z) = H(Z)=--+-A

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_

Two Marks Questions

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
~

hI(n) = anu(n) * u(n

-I)
~
Z[anu(n)] =
n=O

Let us consider Z-transform of anu(n)

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

Digital Signal Processing

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

The inverse Z-transform


!Ij (n)

= _I_{_(_at 1- a

u(n)+ u(n)}

0. (n) = c5(n- 2) * anu(n)


Zr[8(n-2)] zr[anu(n)]
H2(Z) ,

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)

Take inverse Z-transform y(n) - a1 Y(n -1) - a2Y(n - 2) = ~x(n - 2)

Two Marks Questions

and Answers

TQA83

6.

Determine the system function of the DT system described by the difference equation
1 (i) 1

Solution

y(n) -"2 y(n -I) + 4"y(n Take Z-transform 2

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
]

[1- (0.25 - j0.433)rl

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

(iii) Ifx(n) is of finite duration, then

in the ROC, then all finite values of Z for

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

is in the ROC then all values of Z for which

(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

Digital Signal Processing

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) - 2 cos BY(Z)rl Y(Z) (l-2cosBrl

+ Y(Z)r2

= X(Z)

+r2)=X(Z)
X(Z)

Y(Z) = H(Z)

1-2cosBrl

+r2

9.

Determine the Z-transform of the following


(i)

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

= -Z (Z +I)-Z (Z + 1)2 X(Z)= (Z + 1)2

(ii) x(n) =

(_1)11

cos(

n;)

u(n)

We know that, Z [ rl1 cos n(}u(n) ] = Here r = -I' () = , 3


1r

l-rZ-lcos(} 1-2rr cos(}+r r


1 2

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

Two Marks Questions

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)

Taking Z-transform on both sides,


Y(Z)

= 0.7 [ Z-l Y(Z) + y(-I)


+2X(Z)-

] -

0.1 [Z-2

Y(Z)

+ Z-l y( -I) + y(l)

Z-2 X(Z) + Z-lx(-I)+x(-2)


0.1(Z-2y(Z+ 2X(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)

[0.1Z-2 -0.7Z-1 +IJ=~-Z-I (0.1Z-2 -0.7Z-1 +1)=

2Z-1 Z-I

2Z-2Z-1

(Z -I) (0.1Z-2 - 0.7Z-1 + I)


2(Z2

= =
. 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)

(Z2_0.7Z+0.1) 2(Z + I) = A + B (Z - 0.5) (Z - 0.2) (Z - 0.5) (Z - 0.2)

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

Digital Signal Processing

II.

x(n) :::

Solution

j 3n, I,

n<0 ~

X(Z):::

L x(n)rn
n=---<X:J

00

-I ::: L x(n)rn + Lx(n)rn


00

n=-oo

n=O
00

-I ::: L
n=-oo 00

3n rn

+ Lrn
n=O 00

::: (r1 zt + Lrn L


n=O n=O 00 00

:::1- L(3-1 zt + Lrn

I :::1----+-- I r'z Z ---+--Z-I r1Z-1

n=O

n=O 1m

l-r1z l-r1 l-r1Z-1 I ----+-- l-r1 l-r1Z

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

X(Z)-r1X(Z) ]::: X(Z)[I-r1


Y(Z) X(Z)

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

Two Marks Questions

and Answers

TQA87

13.

Find Z-transform and p lot its ROC. (i) x(n)={Sn


00

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

Z =----- Z Z-S Z-2


ROC: Z > Sand Z > 2

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

ROC :IZI >

TQA88

Digital Signal Processing

(iii) x(n) = {I, 0, 3, -1, 2}. Find the Z-transform. Solution

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(Z) = The OFT is given by,

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

Taking Z-transform Y(Z)-3Z-1Y(Z)-4Z-2y(Z) Y(Z)[1-3Z-1-4Z-2J=X(Z)

= X(Z) +2X(Z)'Z-1
(l+2Z-1) (1)

x(n) =4nu(n) => X(Z) Substitute equation (2) in (1)

Z =-Z-4

(2)

Y(Z)(Z2

Z2 -3Z

Z-4 -4)=~
Y(Z)-

Z (Z+2)

Z2(Z+2) (Z - 4) (Z - 4) (Z Z(Z+2) (Z-4i (Z+I)

+ 1)

Z=
Put Z = 4,

Y(Z)

B +_C_ __ Z_(Z_+_2_)_= _A_ + (Z _4)2 (Z +1) Z -4 (Z _4)2 Z +1 Z(Z +2) = A(Z

-4) (Z

+ 1)+ B(Z + 1) +C(Z _4)2

24=5B 5 B=24

Two Marks Questions

and Answers

TQA89

PutZ=-I,

-1 = 25C
1 C=-25

Comparing Z2 terms I=A+C


A Y(Z)

= 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

26 5 1 y(n)=-25 ( 4)n u(n)+-n ()n u(n)--25 ( -1 )n u(n) 4 24

(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)

Substitute equation (2) in (l)


00

H(rej(J)) =

n=-oo

h(n) (rej(J)rn

(3)

The Fourier transform of h(n) is given by


H(eJW)

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)

is equal to H(Z) evaluate along the unit circle, or


H(ej(J))

= H(Z)lz=eJ'"

TQA90

Digital Signal Processing

. 1+3Z-1 16. Fmd the Z-transform of X(Z) = I+3Z- 1 +2ZSolution X(Z) = X(Z)

for IZI> 2.

(Z +3)Z (Z2 +3Z +2)


Z+3 A B

----z- = Z2 +3Z +2
X(Z) --=----=--+-- Z+3 Z (Z + 2)(Z + I)

Z +2
+2)

Z +1

Z +3 = A(Z +I)+B(Z PutZ = -1, 2=B PutZ = -2,

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

Taking inverse Z-transform, x(n) = -(-2tu(n)+


x(n) = {I, 2, 3}?

17. What is the response of the LSI system with impulse response h(n) = 8(n) + 28(n-I)
Solution

h(n) = 8(n)+ 28(n-I) = {I,2} The Z-transform of h(n) is,


H(Z) = Y(Z) =(1+2Z-1) X(Z) Y(Z) = (1 + 2Z-1)X(Z)
x(n)

(1)

= {I, 2, 3}
X(Z) = I+2r1 +3Z-2 (2)

Substitute equation (2) in (I),

Y(Z) = (1+ 2r1)

(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

Finite Impulse Response Filter

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

Let the frequency samples be choosen at 2n


wK = /ik

where k = 0, I, 2, ...,N-I
Hd(eJaJ) as

:. Sampled frequency response H(k) is related to the desired frequency response


H(k)

= Hd(eJaJ)i", ~__2/r'k
N

k=O,I, ...,N-1

Let H(k) = IH(k)I'eJB(k),


.

where 6(k) = -awlw=21l'.k .


N

For a hnear phase filter. Since

N-I a=-2
6(k)

= - [N-I]2n '/ik

-2-

6(k)=-

7 (N-I)
[N-I]

(I) d, wherek=O,I, ... ,N-l

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

k=-2-, ..,N-I } N-I

TQA92

Digital Signal Processing

For even values of N

8(k) =

-N
{ (N; [N
1

d,

}r(N -I] _ k),

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)

Since h(n) should be real we get. For odd N,

For even N,

Once h(n) is calculated the frequency response 2. Solution

H(ejW)

can be found based of whether N is odd or even.

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:::;

(d) Find h(n) = hd(n)w(n)

-2-'
N-l
2

N-I

(e) Calculate the tilter transfer function

H(Z) = h(O) + Lh(n)[2n+Tn]


n=l

Substitute h(n) found from previous step.

Two Marks Questions

and Answers

TQA93

(t)

To design a causal filter multiply H(Z) by Z 1.

( N-t)
2 N2-1)

:. H(Z) = H(Z) Z-( (g) The frequency response H (ejaJ) the FIR filter is designed.

equation is taken based on whether N is odd or even and frequency


H(eJaJ)

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.

Give the equation specifying Bartlett and Hamming windows.

wB(n)

jl-

N-l'
0, 2(n)

N-l Inl~2

Otherwise

The equation for Hamming window is given by

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

is the phase response

is the angular frequency is a constant phase delay.

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)

0, 10.54+0.46cos( The transfer function of Hanning window is


Wnn(n)=

N-l
0, 10.5+0.5cos(
27T:n),

2
elsewhere Inl ~ N -1

TQA94

Digital Signal Processing

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

H d (n) = 2n -1! e-JWJJ 3


3
1!

-f
1

.
eJwn

dO)
'

=2

-I-f) ej(n-u)w n-1!


3
1!

dO)

2n j(n-a) = _1 [eJ(n-U)W

]) -1! 3

= n(n-a)l r ej(n-U)~ 2j e- j(n-u)~ 1 sin(n -a)~


hd(n)

n(n -a)
sin(n

-a)n - sin(n -a )~
(n-a)n
3 3

ForHPF,

hd(n) =

Sinn-a ) --Sin . (n-a ) . ( 2n n


For BPF,
hd(n)

n(n-a)

For BSF,

hd(n) =

sin(n -a)n - sin(n -a)~ -sin(n -a) 2n . 3 3

n(n-a)

Chapter 8 Infinite Impulse Response filter


1. Obtain the cascade and parallel form realization for the following system.

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

= -O.ly(n -1)+ O.2y(n- 2)+ 3x(n) + 3.6x(n-I)+ 0.6x(n- 2)


= 3X(Z)+3.6rIX(Z)+0.6Z-2 = X(Z)[3+3.6Z-1 +0.6Z-2J X(Z)

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

= 1+ 1.2rl + 0.2r2 I+O.IZ-I -0.2r2


For cascade structure

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

For parallel structure

H(Z) = 1+ 1.2rl + 0.2Z-2

(l+O.2rl) (l-O.lrl) (l+0.2rl) = I+rl I-O.lrl

= (l+rl)

TQA96

Digital Signal Processing

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

Realizing the above expression as a structure

--.
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.

An FIR filter is given by yen) = 2x(n) coefficient.

+ - x(n -I) + - x(n - 2) + - x(n - 3). Find the lattice structure

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)

Two Marks Questions

and Answers

TQA97

!J (n) = !o(n) + K1gO(n-I)


=x(n)+K1x(n-l)

g, (n) = gO(n -1)+ Kdo(n)


= x(n

-1) + K1x(n)

!2 (n) = !J (n) + K2g] (n -I)


= x(n) + K1x(n -I) + K2 [KJx(n = x(n) + K1x(n -I) + K1K2x(n = x(n) + K1x(n -I)
g2 (n)

-I) + x(n - 2)]

-1) + K2x(n - 2)

[I + K2]+ K2x(n - 2)

= K2!J (n) + gl (n -I)


= K2 [x(n)+K1x(n-I)+K)x(n-I)+x(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)+

K3[K2X'(n -I) + K1x(n - 2)(1+ K2) + x(n - 3)] = x(n) + K,x(n


+K1K3x(n

-I) + K,K2x(n -I) + K2x(n - 2)+ K2K3x(n-1)


K3x(n-3) [K]

- 2)+ K1K2K3x(n-2)+

= x(n)+x(n-I) +x(n-2) [K2

+ K1K2 + K2K3]
(1)

+ K1K3 + K1K2K3]+K3x(n-3)

General equation of FIR filter ofIlI order is


3

y(n) = x(n)+

K=l

L am(K)x(n-k)
(2)

=x(n)+a3(1) Comparing (1) and (2)


a3(O)

x(n-I)+a3(2)

x(n-2)+a3(3)

x(n-3)

=1

a3(1) = K,

+ K1K2 +K2K3

=K1[I+K2]+K2K3

TQA98

Digital Signal Processing K2 =u2(2);


K1

K\(1+K2}=U2(1)

u2(1) l+u2(2)

:. U3(1) = U2(1) + U2(2)K3 General equation


um_I(O) um_1 (K)

= I, =

um(m)

Km - K)

um(K) -Um(~)Um(m I-um(m)

[I:::;K:::;

-I]

From equation (I),


K3

= u3(3)

:. u3(1) = u2(1)+u2(2)'u3(3) Comparing the coefficient of x(n - 2) u3 (2) = K2 + K]K3[K2

+ I]

= K2 +K3{K](1+K2)}

= u2 (2) + u3 (3)'u2 (1) Consider the equation


y(n) = 2x(n) + -x(n

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)

Comparing (I) and (2)


2 a) (1)

=5
3

a2(2)="4
1

u3(3) =- =
. 3

K3

Using General equations U


m-] (K)=Um(K)-um(m)um(m-K) I-u;,(m) I:::;K:::;m-1

Here m = 3,
u2(K)= u3(K)-u3(3) u3(3-K)

l-u~(3)

Two Marks Questions

and Answers

TQA99

To find a 2(1), letK= 1


a2(1)

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)

a3 (2) - a3 (3) a3 (1)

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)

In non-recursive difference equation, output depends on past input only. y(n) =

k=O

L bkx(n - k)

TQA100

Digital Signal Processing

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) - forward prediction coefficient

Forward prediction error


i.e.

Ip= x(n) - (n) i.e. the difference


p

betweenx(n) and predicted value ofx(n).

Ip(n) = x(n) + K=I Lan

(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)

= x(n) + a2 (I) x(n-I)+a2(2)

Two Marks Questions

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

What are the advantages of direct form II and cascade structures.

ii.

0 differs from

OJ

in bilinear transformation method first prewarpanalog

n.

o=~tan(~) (c) Calculate the order ofthe filter (analog LPF)


A

N~--- ~
log

log-

LPF and HPF

n,
Op

TQA102

Digital Signal Processing


A

logN where,
1':=(IOOlal'
"C.__
1':_

BPF and BEF

logq.

-lt5
I

= (]00 la, -

t5

Os = Stop band frequency

= Pass band frequency

Or = min{IAI, IBI} and A =

-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]

Where ,'t' () (t)

=-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.

Analysis of Finite Word Length Effect

Using Laplace transform, find the impulse response of an LTI system described by a differential equation
d2

dt2

y(t) _ dy(t) _ 2y(t) dt

= x(t).

Solution

y(t) _ dy(t) _ 2y(t) dt Apply Laplace transform,


d2

dt2

= x(t) = x(s)

s2 Y(s)

s Y(s)

- 2Y(s)

Y(s)[s2 -s-2

]=x(s)

Y(s) = H(s) X(s)

=
s2

-s,-2

The impulse response can be calculated as H(s)=---, (s-2) A

I
(s+l)

=--+-B s-2 s+1


=
S ~ 11'\'=+2

A = (s - 2) H(s)ls=+2

1 1 =-=- 3 2+1 B=(s+l) H(s)ls=_1

= s~2Is=_1
1 =--=-1

-1-2
1 -

3
1

--

H(s)

=_3_+_3 s-2 s+1

The impulse response is given by

TQA104

Digital Signal Processing

. . 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)

2s2 +9s-47 (s+3+ A

)4) (s+3- )4)

=----+---- B (s+3+)4) (s+3-)4)


A

= (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

2(-3+ )4)2 +9(-3+ )4)-47 =--------(-3+ )4+3+ )4)


= -1.5+ )11
X(s) The inverse Laplace is, x(t) 3.

= -1.5- )11 + -1.5+ )11


s+3+)4 s+3-)4

= (-1.5 - )11)e -(3+j4)t u(t) + (-1.5 + )11)e -(3- }4)t u(t)

Draw the direct form-II realization ofthe system described by the differential equation
d2 y(t) ~2

+ 5 dy(t) + 4y(t) = dx(t) .


~ ~ d2

Solution

dt2

y(t)

+ 5 dy(t) + 4y(t) = dx(t)


dt dt
y(t)

Two Marks Questions

and Answers

TQA105

Taking Laplace transform


S2y(S)

+ 5sY(s)
Y(S)[S2

+4Y(s)

= sX(s)
s

+ 5s + 4] = sX(s)
Y(s) X(s)

--=---s2+5s+4

4.

What is the effect of quantization on pole locations?

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 .

truncated to Xr by b number of bits, then the truncation error Xr -x

6. What is the transfer function of a system whose poles are at -0.3 Solution
H(s)

jOA and a zero at - 0.2?

(s + 0.3 + jOA) (s + 0.3 - jOA)

(s+0.2)

Chapter 13 State Variables


l. Find the state variable matrices A, B, C and D for the input-output y(n) = 6y(n -1) + 4y(n- 2)+ x(n)+ 10x(n -1)+ 12x(n-12) . y(n) = 6y(n -1) +4y(n - 2)+ x(n) + 10x(n -1) + 12x(n -12) relation given by the relation

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)

1+ lOr' + 12r2 = 1-6rl-4r2

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)

= x(n)+ 6ql (n)+ 4q2(n)+ 10q,(n)+ 12q2(n)


(3)

y(n) = 16q,(n)+ 16q2(n)+ x(n)

q2(n+l) [q,(n. +1)]=[6 1 0 0 4][I]x(n) y(n) = 16 16]


[

q2(n) [ql (n)]

+[1] x(n)

(5)

Two Marks Questions

and Answers

TQA107

From equation (4) and (5)

A=[~

~lB=[~lC=[16

16];D=[1]

2.

A continuous-time system has the state variable description A = [~ Determine the transfer function.

~ 1]; B = [ ~]; C = [3 1]; D = [2] .

Solution H(s) = C[sI - Arl B + D Let us consider, sf - A (1)

sf - A = sOl [1 = [~

1 0 0]- [2 -1] ~]_[~

~1]

= [S -12 s 1]
[sfArl

= Adj [sf- A] Det [sf- A]


= [s1 s-2 s(s - 2)+ 1 [: s~12] =---s2 -2s+

-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 -~S+1 1] [s2 - 2s + 1 s2-2s+1 _+ __


1_ _

s2 - 2s 1 S2 --;s++ 1] [1]+[2] s2 _-3 + 1+ s2 - 2s + 1][1] + [] 2s 0 2 s-2

[ __

s2-2s+1 3_S

TQA108

Digital Signal Processing

_[ s2-2s+1 3s+1 = 3s+1 i -2s+1 +2

s2-2s+1 s-5

0 ][1]+[2]

3s+1+2(s2 =--------2s+1) s2 - 2s+


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)

Take inverse Laplace transform,


d2

dt2

y(t) _ 2 dy(t) dt

+ y(t) = 2 d2 x(t) _ dx(t) + 3x(t)


dt2

dt

Vous aimerez peut-être aussi