You are on page 1of 101

JAWAHARLALNEHRUTECHNOLOGI

CALUNI
VERSI
TYHYDERABAD
I
IYearB.
Tech.EI
E-ISEM L T/
P/D C
- -
/3/
- 2
(
A30481)BASI
CSI
MULATI
ONLAB
1.Basi
cOper
ati
onsonMat
ri
ces
2.Gener
ati
onofv
ari
oussi
gnal
sandsequences(
Per
iodi
candAper
iodi
c),suchasuni
t
I
mpul
sest
ep,
Squar
e,Sawt
oot
h,Tr
iangul
ar,
Sinusoi
dal
,Ramp,
Sinc.
3.Oper
ati
onson si
gnal
sand sequencessuch asAddi
ti
on,Mul
ti
pli
cat
ion,Scal
i
ng,
Shi
ft
ing,
Fol
ding,
Comput
ati
onofEner
gyandAv
eragePower
.
4.Fi
ndi
ngt
heEv
enandOddpar
tsofSi
gnal/SequenceandRealandi
magi
nar
ypar
tsof
Si
gnal
.
5.Conv
olut
ionbet
weenSi
gnal
sandSequences.
6.Aut
oCor
rel
ati
onandCr
ossCor
rel
ati
onofSi
gnal
sandSequences.
7.Ver
if
icat
ionofLi
near
it
yandTi
meI
nvar
iancePr
oper
ti
esofagi
venCont
inuous/
Di
scr
eteSy
stem.
8.Comput
ati
onofUni
tsampl
e,Uni
tst
epandsi
nusoi
dalr
esponsesoft
hegi
venLTI
sy
stem andv
eri
fyi
ngi
tsPhy
sical
real
i
azabi
l
ityandst
abi
l
itypr
oper
ti
es.
9.Gi
bbsPhenomenon.
10.Fi
ndi
ngt
heFour
ierTr
ansf
orm ofagi
vensi
gnalandpl
ott
ingi
tsmagni
tudeand
phasespect
rum.
11.Wav
efor
m Sy
nthesi
susi
ngLapl
aceTr
ansf
orm.
12.Locat
ingt
heZer
osandPol
esandPl
ott
ingt
hePol
e-Zer
omapsi
nSpl
aneandZ-
Pl
anef
ort
hegi
vent
ransf
erf
unct
ion.
13.Gener
ati
onofGaussi
annoi
se(
RealandCompl
ex)
,Comput
ati
onofi
tsmean,M.
S.
Val
ueandi
tsSkew,
Kur
tosi
sandPSD,
Probabi
l
ityDi
str
ibut
ionFunct
ion.
14.Sampl
i
ngt
heor
em Ver
if
icat
ion.
15.Remov
alofnoi
sebyAut
ocor
rel
ati
on/Cr
osscor
rel
ati
on.
16.Ext
ract
ionofPer
iodi
cSi
gnal
,maskedbynoi
seusi
ngCor
rel
ati
on.
17.Ver
if
icat
ionofWei
ner–Khi
nchi
neRel
ati
ons.
18.Checki
ngaRandom Pr
ocessf
orSt
ati
onar
it
yinWi
desense
BASI
CSI
MULATI
ONLABCOURSEOBJECTI
VE
Theobj
ect
iveoft
hisl
abcour
sei
stomakest
udent
sfami
l
iarwi
thf
eat
uresandt
he
usageoft
hesof
twar
eenv
ironmentOCTAVE.Usi
ngOCTAVEt
heobj
ect
ivesar
e:
 Tol
ear
nbasi
cOper
ati
onsonMat
ri
ces
 Tomodel
gener
ati
onofv
ari
oussi
gnal
s
 Tosi
mul
ateoper
ati
onsonsi
gnal
sandsy
stems.
 Tosi
mul
atev
ari
ousr
andom v
ari
abl
es’
gener
ati
onandpr
ocesses

BASI
CSI
MULATI
ONLABCOURSEOUTCOMES
Af
tergoi
ngt
hrought
hisl
abcour
set
hest
udentwi
l
lbeabl
eto
1.Appl
ysi
gnal
gener
ati
oni
ndi
ff
erentar
eas.
2.Appl
ysi
gnal
oper
ati
onsi
ndi
ff
erentar
easofcommuni
cat
ions.
3.Appl
ytheknowl
edgeofr
andom v
ari
abl
esandpr
ocessesi
nfi
eldsofcommuni
cat
ions.
4.Anal
yzet
hesy
stemsf
orv
ari
ouspr
oper
ti
es.
5.Anal
yset
hev
ari
oussy
stemsbasedonconv
olut
ionandcor
rel
ati
onpr
oper
ti
es.
6.Real
i
sev
ari
ousr
esponseofLTIsy
stemsl
i
keUni
tsampl
e,uni
tst
epandsi
nusoi
dal
r
esponses
7.Anal
yset
her
esponseofsy
stem t
ovar
ioust
ypesofi
nputsi
gnal
s.
8.Anal
yset
hepr
ocesst
her
emov
alofnoi
sef
rom asi
gnal
9.Ver
if
ysampl
i
ngt
heor
em
10.Appl
yLapl
aceandz-
tr
ansf
ormat
ionsi
ndi
ff
erentar
eas.

SOFTWAREREQUI
REMENTS
1.OCTAVE(
GUI
)4.
0.1v
ersi
onandabov
e
Expt
-1 Basi
coper
ati
onsonMat
ri
ces
AI
M:ToGener
ateamat
ri
xandper
for
m basi
coper
ati
ononmat
ri
ces
SOFTWARE:
OCTAVE(
GUI
)4.
0.1&Abov
e.
OPERATI
NGSYSTEM:
Windows7
THEORY:
OCTAVEt
reat
sal
lvar
iabl
esasmat
ri
ces.Vect
orsar
especi
alf
ormsofmat
ri
cesand
cont
ainonl
yoner
oworonecol
umnwher
easscal
arsar
especi
alf
ormsofmat
ri
cesand
cont
ainonl
yoner
owandonecol
umn.
Amat
ri
xwi
thoner
ow i
scal
l
edr
ow v
ect
orandamat
ri
xwi
thsi
ngl
ecol
umni
scal
l
ed
col
umnv
ect
or.
Ext
ract
ingSubmat
ri
x:
Submat
ri
x=mat
ri
x(r
1:r
2,c1:
c2)
Col
_vect
or=mat
ri
x(:
,col
umnnumber
)
r
owv
ect
or=mat
ri
x(:
,rownumber
)
PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
1.PROGRAM:
%Cr
eat
ingacol
umnv
ect
or.Thef
oll
owi
ngar
ety
peddi
rect
lyi
ncommandwi
ndowandout
put
s
ar
eobser
veddi
rect
lyoncommandwi
ndow.
>>col
vec=[
13;
20;
5]
col
vec=
13
20
5
%Cr
eat
ingar
owv
ect
or
>>r
owv
ec=[
123]
r
owv
ec=
123
%Cr
eat
ingamat
ri
x
>>mat
ri
x=[
123;
469;
269]
mat
ri
x=
123
469
269
%Ext
ract
ingsubmat
ri
xfr
om mat
ri
x
>>sub_
mat
ri
x=mat
ri
x(2:
3,2:
3)
sub_
mat
ri
x=
69
69
%ext
ract
ingcol
umnv
ect
orf
rom mat
ri
x
>>col
_vect
or=mat
ri
x(:
,
2)
col
_vect
or=
2
6
6
%ext
ract
ingr
owv
ect
orf
rom mat
ri
x
>>r
ow_
vect
or=mat
ri
x(3,
:
)
r
ow_
vect
or=
269
%cr
eat
ionoft
womat
ri
cesaandb
>>a=[
24-
1;-
219;
-
1-10]
a=2 4 -
1
-
2 1 9
-
1 -
1 0
>>b=[
023;
102;
146]
b=
0 2 3
1 0 2
1 4 6
%mat
ri
xmul
ti
pli
cat
ion
>>x
1=a*
b
x1=
3 0 8
10 32 50
-
1 -
2 -
5
%v
ect
ormul
ti
pli
cat
ion
>>x
2=a.
*b
x2=
0 8 -
3
-
2 0 18
-
1 -
4 0
%mat
ri
xaddi
ti
on
>>x
3=a+b
x3=
2 6 2
-
1 1 11
0 3 6
%mat
ri
xsubt
ract
ion
>>x
4=a-
b
x4=
2 2 -
4
-
3 1 7
-
2 -
5 -
6

%mat
ri
xdi
vi
sion
>>x
5=a/
b
x5=
-
9.0000 -
3.5000 5.
5000
12.
0000 3.
7500 -
5.7500
3.
0000 0.
7500 -
1.7500
%v
ect
ordi
vi
sion
>>x
6=a.
/b
War
ning:
Div
idebyzer
o.
x6=
I
nf2.
0000 -
0.3333
-
2.0000 I
nf4.
5000
-
1.0000 -
0.25000
%i
nver
seofmat
ri
xa
>>x
7=i
nv(
a)
x7=
-
0.4286 -
0.0476-
1.7619
0.
4286 0.
04760.
7619
-
0.1429 0.
0952-
0.4762
%t
ransposeofmat
ri
xa
>>x
8=a'
x8=2 -
2-1
4 1-
1
-
1 9 0
%cubeofmat
ri
xa(poweroft
hemat
ri
x)
>>x
9=a^
3
x9=-
66-
33 120
-
9 -
87-
129
18 3 -
45

%v
ect
orpower3ofmat
ri
xa
>>x
10=a.
^3
x10=
8 64 -
1
-
8 1 729
-
1-1 0
RESULT:
Mat
ri
xoper
ati
onsar
eper
for
medusi
ngOCTAVEsof
twar
e.
VI
VAQUESTI
ONS
1.Whichcommandi susedt ogeneratetransposeofamat r
ix?
Ans:createamat ri
xAandt ype(A)’
.
2.Whichcommandi susedt ogenerateSubmat rixofamatr
ix?
Ans:Sub_matrix=matrix(
r1:r
2,c1:
c2)
3.Whichcommandi susedt ogeneratecolumnmat ri
xofamat ri
x?
Ans:Col_vect
or=mat r
ix(:,columnnumber )
4.Whichcommandi susedt ogeneraterowmat r i
xofamatrix?
Ans:row_vector=matri
x(: ,
rownumber )
5.Whichcommandi susedt ogenerateuppertriangul
armatrixofamat
ri
x?
Ans:tri
u(matr
ix)
Expt
-2:Gener
ati
onofv
ari
oussi
gnal
sandsequences(
Per
iodi
cand
Aper
iodi
c),
suchasuni
tImpul
sest
ep,
Squar
e,Sawt
oot
h,Tr
iangul
ar,
Si
nusoi
dal
,Ramp,
Sinc
AI
M:ToGener
atev
ari
oussi
gnal
sandsequences(
per
iodi
candaper
iodi
c)Suchasr
amp,
I
mpul
se,
uni
tst
ep,
squar
e,sawt
oot
h,t
ri
angul
ar,
sinusoi
dal
andsi
ncsi
gnal
s
SOFTWARE:
OCTAVE(
GUI
)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
I
ftheampl
i
tudeoft
hesi
gnali
sdef
inedatev
eryi
nst
antoft
ime,t
heni
tiscal
l
ed
cont
inuoussi
gnal
.Ift
heampl
i
tudeoft
hesi
gnali
sdef
inedatonl
yatsomei
nst
ant
sof
t
imet
heni
tiscal
l
eddi
scr
etesi
gnal
.
I
fthesi
gnalr
epeat
sit
sel
fatr
egul
ari
nter
val
stheni
tiscal
l
edper
iodi
csi
gnal
.Ot
her
wise
t
heyar
ecal
l
edaper
iodi
csi
gnal
s.
EX:r
amp,
Impul
se,
uni
tst
ep,
sinc-Aper
iodi
csi
gnal
s
Squar
e,sawt
oot
h,t
ri
angul
ar,
sinusoi
dal
–per
iodi
csi
gnal
s.
Af
ewexampl
esofdef
ini
ti
onsofcont
inuoust
imesi
gnal
sar
egi
venbel
ow:
Rampsi
gnal
:
r
(t)
=t whent
>=0
Uni
timpul
sesi
gnal
:
Y(
t)=1 onl
ywhent
=0
=0 ot
herwi
se
Uni
tst
epsi
gnal
:
u(
t)=1 onl
ywhent
>=0
=0 ot
herwi
se
Si
ncsi
gnal
:
G(
x)=(
sinx)
/x
Pl
ott
ingt
hegr
aphsusi
ngOCTAVE:
fxandyar
I etwov
ect
orsoft
hesamel
engt
hthenpl
ot(
x,y
)pl
otsxv
ersusy
.
Forexampl
e,t
oobt
aint aphofy=cos(
hegr x)f
rom –∧t
o∧,
wecanf
ir
stdef
inet
he
v orx
ect

wi
thcomponent
sequal
l
yspacednumber
sbet
ween–∧and∧,
wit
hincr
ement
,say0.
01.
»x=-
pi:
0.01:
pi;
Wepl
acedasemi
col
onatt
heendoft
hei
nputl
i
net
oav
oidseei
ngt
he(
long)out
put
.
Not
ethatt
hesmal
l
estt
hei
ncr
ement
,the“
smoot
her
”thecur
vewi
l
lbe.
Next
,wedef
inet
hev ory
ect
»y
=cos(
x);
(
usi
ngasemi
col
onagai
n)andweaskf
ort
hepl
ot
»pl
ot(
x,y
)
I
tisgoodpr
act
icet
olabel
theaxi
sonagr
aphandi
fappl
i
cabl
eindi
cat
ewhateachaxi
s
r
epr
esent
s.Thi
scanbedonewi
tht
hexl
abel
andy
label
commands.
»xl
abel
('
x'
)
»y
label
('
y=cos(
x)'
)
I
nsi
depar
ent
heses,
andencl
osedwi
thi
nsi
ngl
equot
es,
wet
ypet
het
extt
hatwewi
sht
o
be
di
spl
ayedal hexandyaxi
ongt s,r
espect
ivel
y.Wecoul
dev
enputat
it
leont
opusi
ng
»t
it
le(
'Gr
aphofcosi
nef
rom -
pit
opi
'
)
Var
iousl
i
net
ypes,
plotsy
mbol
sandcol
orscanbeused.I
fthesear
enotspeci
fi
ed(
asi
n
t
he
caseabov
e)OCTAVEwi
l
lassi
gn(
andcy
clet
hrough)t
hedef
aul
tonesasgi
veni
nthe
t
abl
e
bel
ow.
yyel
l
ow.poi
nt
m magent
aoci
rcl
e
ccy
anxx-
mar
k
rr
ed+pl
us
ggr
een-sol
i
d
bbl
ue*st
ar
wwhi
te:
dot
ted
kbl
ack-
.dashdot
-
-dashed
So,
toobt
aint
hesamegr ngr
aphbuti een,
wet
ype
»pl
ot(
x,y
,’
g’
)
wher
ethet
hir
dar
gumenti
ndi
cat
ingt
hecol
or,
appear
swi
thi
nsi
ngl
equot
es.Wecoul
d
geta
dashedl
i
nei eadofasol
nst i
donebyt
ypi
ng
»pl
ot(
x,y
,’
--

)
orev
enacombi
nat
ionofl
i
net
ypeandcol
orsayabl
, uedot
tedl
i
nebyt
ypi
ng
»pl
ot(
x,y
,’
b:’
)
Mul
ti
plecur
vescanappearont
hesamegr
aph.I
fforexampl
ewedef
ineanot
herv
ect
or
»z=si
n(x)
;
wecangetbot
hgr
aphsont
hesameaxi
s,di
sti
ngui
shedbyt
hei
rli
net
ype,
usi
ng
»pl
ot(
x,y
,'
r-
-'
,
x,z,
'
b:'
)
Whenmul
ti
plecur
vesappearont
hesameaxi
s,i
tisagoodi
deat
ocr eal
eat egendt
o
l
abel
anddi
sti
ngui
sht
hem.Thecommandl
egenddoesexact
lyt
his.
»l
egend(
'cos(
x)'
,
'si
n(x)
')
Thet
extt
hatappear
swi
thi
nsi
ngl
equot
esasi
nputt
othi
scommand,
repr
esent
sthe
l
egend
l
abel
s.Wemustbeconsi
stentwi
tht
heor
der
ingoft
het
wocur
ves,
sosi
ncei
nthepl
ot
orcosi
commandweaskedf net
obepl
ott
edbef
oresi
ne,
wemustdot
hesameher
e.
Atanypoi
ntdur
ingaOCTAVEsessi
on,
youcanobt
ainahar
dcopyoft
hecur
rentpl
otby
ei
theri
ssui
ngt
hecommandpr
intatt
heOCTAVEpr
ompt
,orbyusi
ngt
hecommand
menusont
hepl
otwi
ndow.I
naddi
ti
on,
OCTAVEpl
otscanbycopi
edandpast
ed(
as
pi
ctur
es)i
nyourf
avor
it
ewor
dpr
ocessor(
suchasMi
crosof
tWor
d).Thi
scanbe
achi
eved
usi
ngt
heEdi
tmenuont
hef
igur
ewi
ndow.Anot
herni
cef
eat
uret
hatcanbeusedi
n
conj
unct
ionwi
thpl
oti
sthecommandgr
id,
whi
chpl
acesgr
idl
i
nest
othecur
rentaxi
s
(
justl
i
key
ouhav
eongr
aphi
ngpaper
).Ty
pehel
pgr
idf
ormor
einf
ormat
ion.Ot
her
commandsf
ordat
avi
sual
i
zat
iont
hatexi
sti
nOCTAVEi
ncl
udesubpl
otcr
eat
eanar
ray
of(
ti
led)pl
otsi
nthesamewi
ndowl
og-
logpl
otusi
ngl
og-
logscal
essemi
l
ogxpl
ot
usi
ngl
ogscal hex-
eont axi
ssemi
l
ogypl
otusi
ngl
ogscal hey
eont -axi
s
sur
f3-
Dshadedsur
facegr
aph
sur
fl3-
Dshadedsur
facegr
aphwi
thl
i
ght
ing
mesh3-
Dmeshsur
face.
PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:

%gener
ati
onofr
ampsi
gnal
cl
c;
cl
earal
l
;
cl
oseal
l
;
f
s=500;
t
=0:
1/f
s:0.
1;
y
1=t
;
subpl
ot(
2,2,
1);
pl
ot(
t,
y1)
;
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'r
ampsi
gnal
'
);
%gener
ati
onofr
ampsequence
subpl
ot(
2,2,
2);
st
em(
y1)
;
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'r
ampsequence'
);

%gener
ati
onofi
mpul
sesi
gnal
y
2=(
t==0)
;
subpl
ot(
2,2,
3);
pl
ot(
t,
y2)
;
axi
s([
-1101]
)
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'i
mpul
sesi
gnal
'
);
%gener
ati
onofi
mpul
sesequence
subpl
ot(
2,2,
4);
st
em(
y2)
;
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'i
mpul
sesequence'
);
%gener
ati
onofuni
tst
epsi
gnal
n=-
10:
1:10;
y
3=(
n>=0)
;
f
igur
e;
subpl
ot(
2,2,
1);
pl
ot(
n,y
3);
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'uni
tst
epsi
gnal
'
);
%gener
ati
onofuni
tst
epsequence
subpl
ot(
2,2,
2);
st
em(
n,y
3);
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'uni
tst
epsequence'
);

%gener
ati
onofsquar
ewav
esi
gnal
y
4=squar
e(2*
pi*
50*
t);
subpl
ot(
2,2,
3);
pl
ot(
t,
y4)
;
axi
s([
00.
1-22]
);
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'squar
ewav
esi
gnal
'
);
%gener
ati
onofsquar
ewav
esequence
subpl
ot(
2,2,
4);
st
em(
y4)
;
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'squar
ewav
esequence'
);
%gener
ati
onofsawt
oot
hsi
gnal

y
5=sawt
oot
h(2*
pi*
50*
t);
f
igur
e;
subpl
ot(
2,2,
1);
pl
ot(
t,
y5)
;
axi
s([
00.
1-22]
);
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'sawt
oot
hwav
esi
gnal
'
);
%gener
ati
onofsawt
oot
hsequence
subpl
ot(
2,2,
2);
st
em(
y5)
;
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'sawt
oot
hwav
esequence'
);

%gener
ati
onoft
ri
angul
arwav
esi
gnal
y
6=sawt
oot
h(2*
pi*
50*
t,
.5)
;
subpl
ot(
2,2,
3);
pl
ot(
t,
y6)
;
axi
s([
00.
1-22]
);
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'tr
iangul
arwav
esi
gnal
'
);
%gener
ati
onoft
ri
angul
arwav
esequence
subpl
ot(
2,2,
4);
st
em(
y6)
;
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
't
ri
angul
arwav
esequence'
);
%gener
ati
onofsi
nsoi
dal
wav
esi
gnal
y
7=si
n(2*
pi*
50*
t);
f
igur
e;
subpl
ot(
2,2,
1);
pl
ot(
t,
y7)
;
axi
s([
00.
1-22]
);
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'si
nsoi
dal
wav
esi
gnal
'
);
%gener
ati
onofsi
nwav
esequence
subpl
ot(
2,2,
2);
st
em(
y7)
;
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'si
nwav
esequence'
);

%gener
ati
onosi
ncsi
gnal
t
1=l
i
nspace(
-5,
5);
y
8=si
nc(
t1)
;
subpl
ot(
2,2,
3);
pl
ot(
t1,
y8)
;
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'si
ncsi
gnal
'
);
%gener
ati
onofsi
ncsequence
subpl
ot(
2,2,
4);
st
em(
y8)
;
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'si
ncsequence'
);
OUTPUT:
Resul
t:Var
ioussi
gnal
s&sequencesgener
atedusi
ngOCTAVEsof
twar
e.
VI
VAQUESTI
ONS
1.Whi
chcommandi
susedt
ogener
atecont
inuoussi
gnal
s?

Ans:pl
ot

2.Whi
chcommandi
susedt
ogener
atedi
scr
etesi
gnal
s?

Ans:stem
3.Whichprocessconv
ert
scont
inuoussi
gnal
int
odi
scr
ete?

Ans:sampl
i
ng
4.Defi
nesi
ncsi
gnal
?

Ans:i
tisal
soknownassampl
i
ngsi
gnal
.Iti
sdef
inedassi
nx/
x
5.Namesomeaper
iodi
csi
gnal
s?

Ans:r
amp,
Impul
se,
uni
tst
ep
Expt
-3:Perf
ormt heoper
ati
onsonsignal
sandsequencessuchasaddi
ti
on,
mult
ipl
i
cat
ion,scali
ng,
shi
fti
ng,
fol
dingandal
socomput eener
gyandpower

AI
M:Toper
for
mtheoper
ati
onsonsi
gnal
sandsequencessuchasaddi
ti
on,
mul
ti
pli
cat
ion,
scal
i
ng,
shi
ft
ing,
fol
dingandal
socomput
eener
gyandpower
.
SOFTWARE:
OCTAVE(
GUI
)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
Si
gnal
Addi
ti
on
Addi
ti
on:
anyt
wosi
gnal
scanbeaddedt
ofor
m at
hir
dsi
gnal
,
z(
t)=x(
t)+y(
t)

Mul
ti
pli
cat
ion:
Mul
ti
pli
cat
ionoft
wosi
gnal
scanbeobt
ainedbymul
ti
ply
ingt
hei
rval
uesatev
ery
i
nst
ant
s.z(
t)=x(
t)y(
t)

Ti
mer
ever
sal
/Fol
ding:
Ti
mer
ever
sal
ofasi
gnal
x(t
)canbeobt
ainedbyf
oldi
ngt
hesi
gnal
about
t
=0.Y(
t)=y
(-t
)
Si
gnal
Ampl
i
ficat
ion/
Scal
i
ng:
Y(
n)=ax
(n)i
fa<1at
tnuat
ion
a>1ampl
i
ficat
ion
Ti
meshi
ft
ing:
Thet
imeshi
ft
ingofx(
n)obt
ainedbydel
ayoradv
ancet
hesi
gnal
int
imebyusi
ng
y
(n)
=x(
n+k)
I
fki
saposi
ti
venumber
,y(
n)shi
ft
edt
other
ighti
etheshi
ft
ingdel
ayst
hesi
gnal
I
fki
sanegat
ivenumber
,y(
n)i
tget
sshi
ft
edl
eft
.Si
gnal
Shi
ft
ingadv
ancest
hesi
gnal
Ener
gy:
E=sum(
abs(
X).
^2)

Av
eragepower
:
P=(
sum(
abs(
X).
^2)
)/l
engt
h(x)

PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
6.
PROGRAM:
cl
c;
cl
earal
l
;
cl
oseal
l
;
t
=0:
.01:
1;
%gener
ati
ngt
woi
nputsi
gnal
s
x1=si
n(2*
pi*
4*t
);
x2=si
n(2*
pi*
8*t
);
subpl
ot(
2,2,
1);
pl
ot(
t,
x1)
;
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'si
gnal
1:si
newav
eoff
requency4Hz'
);
subpl
ot(
2,2,
2);
pl
ot(
t,
x2)
;
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'si
gnal
2:si
newav
eoff
requency8Hz'
);
%addi
ti
onofsi
gnal
s
y
1=x1+x2;
subpl
ot(
2,2,
3);
pl
ot(
t,
y1)
;
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'r
esul
tantsi
gnal
:
signal
1+si
gnal
2'
);
%mul
ti
pli
cat
ionofsi
gnal
s
y
2=x1.
*x2;
subpl
ot(
2,2,
4);
pl
ot(
t,
y2)
;
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'r
esul
tantsi
gnal
:
dotpr
oductofsi
gnal
1andsi
gnal
2'
);
%scal
i
ngofasi
gnal
1
A=10;
y
3=A*
x1;
f
igur
e;
subpl
ot(
2,2,
1);
pl
ot(
t,
x1)
;
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'si
newav
eoff
requency4Hz'
)
subpl
ot(
2,2,
2);
pl
ot(
t,
y3)
;
xl
abel
('
ti
me'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'ampl
i
fiedi
nputsi
gnal
1')
;
%f
oldi
ngofasi
gnal
1
l
1=l
engt
h(x1)
;
nx=0:
l
1-1;
subpl
ot(
2,2,
3);
pl
ot(
nx,
x1)
;
xl
abel
('
nx'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'si
newav
eoff
requency4Hz'
)
y
4=f
li
plr
(x1)
;
nf
=-f
li
plr
(nx)
;
subpl
ot(
2,2,
4);
pl
ot(
nf,
y4)
;
xl
abel
('
nf'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'f
oldedsi
gnal
'
);
%shi
ft
ingofasi
gnal
f
igur
e;
t
1=0:
.01:
pi;
x3=8*
sin(
2*pi
*2*
t1)
;
subpl
ot(
3,1,
1);
pl
ot(
t1,
x3)
;
xl
abel
('
ti
met
1')
;
y
label
('
ampl
i
tude'
);
t
it
le(
'si
newav
eoff
requency2Hz'
);
subpl
ot(
3,1,
2);
pl
ot(
t1+10,
x3)
;
xl
abel
('
t1+10'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'r
ightshi
ft
edsi
gnal
'
);
subpl
ot(
3,1,
3);
pl
ot(
t1-
10,
x3)
;
xl
abel
('
t1-
10'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'l
eftshi
ft
edsi
gnal
'
);
%oper
ati
onsonsequences
n1=1:
1:9;
s1=[
123058024]
;
f
igur
e;
subpl
ot(
2,2,
1);
st
em(
n1,
s1)
;
xl
abel
('
n1'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'i
nputsequence1'
);
n2=-
2:1:
6;
s2=[
112460536]
;
subpl
ot(
2,2,
2);
st
em(
n2,
s2)
;
xl
abel
('
n2'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'i
nputsequence2'
);
%addi
ti
onofsequences
s3=s1+s2;
subpl
ot(
2,2,
3);
st
em(
n1,
s3)
;
xl
abel
('
n1'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'sum oft
wosequences'
);
%mul
ti
pli
cat
ionofsequences
s4=s1.
*s2;
subpl
ot(
2,2,
4);
st
em(
n1,
s4)
;
xl
abel
('
n1'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'pr
oductoft
wosequences'
);
%scal
i
ngofasequence
f
igur
e;
subpl
ot(
2,2,
1);
st
em(
n1,
s1)
;
xl
abel
('
n1'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'i
nputsequence1'
);
s5=4*
s1;
subpl
ot(
2,2,
2);
st
em(
n1,
s5)
;
xl
abel
('
n1'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'scal
edsequence1'
);

%shi
ft
ingofasequence
subpl
ot(
2,2,
3);
st
em(
n1-
2,s1)
;
xl
abel
('
n1'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'l
eftshi
ft
edsequence1'
);
subpl
ot(
2,2,
4);
st
em(
n1+2,
s1)
;
xl
abel
('
n1'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'r
ightshi
ft
edsequence1'
);
%f
oldi
ngofasequence
l
2=l
engt
h(s1)
;
nx1=0:
l
2-1;
f
igur
e;
subpl
ot(
2,1,
1);
st
em(
nx1,
s1)
;
xl
abel
('
nx1'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'i
nputsequence1'
);
s6=f
li
plr
(s1)
;
nf
2=-
fl
ipl
r(
nx1)
;
subpl
ot(
2,1,
2);
st
em(
nf2,
s6)
;
xl
abel
('
nf2'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'f
oldedsequence1'
);

%pr
ogr
am f
orener
gyofasequence
z1=i
nput
('
ent
ert
hei
nputsequence'
);
e1=sum(
abs(
z1)
.^2)
;
e1
%pr
ogr
am f
orener
gyofasi
gnal
t
=0:
pi:
10*
pi;
z2=cos(
2*pi
*50*
t).
^2;
e2=sum(
abs(
z2)
.^2)
;
%pr
ogr
am f
orpowerofasequence
p1=(
sum(
abs(
z1)
.^2)
)/l
engt
h(z1)
;
%pr
ogr
am f
orpowerofasi
gnal
p2=(
sum(
abs(
z2)
.^2)
)/l
engt
h(z2)
;

OUTPUT:
ent
ert
hei
nputsequence[
1356]
e1=71
e2=4.
0388
p1=17.
750
p2=0.
36716
RESULT:
Var
iousoper
ati
onsonsi
gnal
sandsequencesar
eper
for
med.
VIVAQUESTIONS

1.Whi
chcommandi
susedt
ofol
dasi
gnal
?

Ans:f
li
plr

2.Wr
it
eanequat
ionf
orener
gysi
gnal
?

Ans:
3.Writ
eanequat
ionf
orpowersi
gnal
?

Ans:
4.Namesomepowersi
gnal
?

Ans:itperi
odi
csignal
slikesin,
cosi
neetc.
5.Whichsignal
sareenergysignal
s?Ans:
nonper
iodi
csi
gnal
s
Expt
-4 Tof
indev
enandoddpar
toft
hesi
gnal
andsequenceand
al
sof
indr
eal
andi
magi
nar
ypar
tsofsi
gnal

AI
M:ToFi
ndev
enandoddpar
toft
hesi
gnal
andsequenceandal
sof
indr
eal
and
i
magi
nar
ypar
tsofsi
gnal
.
SOFTWARE:
OCTAVE(
GUI
)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
Ev
enandoddpar
tofasi
gnal
:
Anysi
gnal
x(t
)canbeexpr
essedassum ofev
enandoddcomponent
sIe
X(
t)=xe(
t)+xo(
t)

PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:
cl
c;
cl
oseal
l
;
cl
earal
l
;
%Ev
enandoddpar
tsofasi
gnal
t
=0:
.005:
4*pi
;
x=si
n(t
)+cos(
t);
%x(
t)=si
nt(
t)+cos(
t)
subpl
ot(
2,2,
1)
pl
ot(
t,
x)
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
)
t
it
le(
'i
nputsi
gnal
'
)
y
=si
n(-
t)
+cos(
-t
)%y
=x(
-t
)
subpl
ot(
2,2,
2)
pl
ot(
t,
y)
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
)
t
it
le(
'i
nputsi
gnal
wit
ht=-
t'
)
z=x+y
subpl
ot(
2,2,
3)
pl
ot(
t,
z/2)
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
)
t
it
le(
'ev
enpar
toft
hesi
gnal
'
)
p=x-
y
subpl
ot(
2,2,
4)
pl
ot(
t,
p/2)
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'oddpar
toft
hesi
gnal
'
);
%Ev
enandoddpar
tsofasequence
z=[
0,2+j
*4,
-
3+j
*2,
5-j
*1,
-
2-j
*4,
-
j*3,
0];
n=-
3:3
%pl
ott
ingr
eal
andi
mgi
nar
ypar
tsoft
hesequence
f
igur
e;
subpl
ot(2,
1,
1);
st
em(
n,r
eal
(z)
);
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'r
eal
par
toft
hecompl
exsequence'
);
subpl
ot(2,
1,
2);
st
em(
n,i
mag(
z))
;
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'i
magi
nar
ypar
toft
hecompl
exsequence'
);
%compl
exconj
ugat
eofasi
gnal
zc=conj
(z)
;
zc_
fol
ded=f
li
plr
(zc)
;
zc_
even=.
5*(
z+zc_
fol
ded)
;
zc_
odd=.
5*(
z-zc_
fol
ded)
;
%pl
ott
ingev
enandoddpar
tsoft
hesequence
f
igur
e;
subpl
ot(2,
2,
1);
st
em(
n,r
eal
(zc_
even)
);
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'r
eal
par
toft
heev
ensequence'
);
subpl
ot(2,
2,
2);
st
em(
n,i
mag(
zc_
even)
);
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'i
magi
nar
ypar
toft
heev
ensequence'
);
subpl
ot(2,
2,
3);
st
em(
n,r
eal
(zc_
odd)
);
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'r
eal
par
toft
heoddsequence'
);
subpl
ot(2,
2,
4);
st
em(
n,i
mag(
zc_
odd)
);
xl
abel
('
n'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'i
magi
nar
ypar
toft
heoddsequence'
);
7.
OUTPUT:
RESULT:
Evenandoddpar
toft
hesi
gnal
andsequencei
scomput
ed.
VI
VAQUESTI
ONS

1.Whi
chcommandi
susedt
ofi
ndi
magi
nar
ypar
tofasi
gnal
z?

Ans:i
mag(
z)

2.Wr
it
eanequat
ionev
enpar
tsi
gnal
?

Ans:
3.Wr
it
eanequat
ionoddpar
tsi
gnal
?

Ans:
4.Whi
chcommandi
susedt
ofi
ndconj
ugat
eofasi
gnal
z?

Ans:conj
(z)
5.Expl
ainhowasi
gnal
canbeexpr
essedasanev
enandoddsi
gnal
?

Expt
-5:Pr
ogr
am f
orconv
olut
ionbet
weent
wosi
gnal
sandal
so
bet
weent
wosequences.
AI
M:ToWr
it
ethepr
ogr
am f
orconv
olut
ionbet
weent
wosi
gnal
sandal
sobet
weent
wo
sequences.
SOFTWARE:
OCTAVE.
OPERATI
NGSYSTEM:
Windows7
THEORY:

I
fx(
n)=h(
n)[i
mpul
se)t
henout
puty
(n)i
sknownasi
mpul
ser
esponseoft
he
sy
stem.
x(
n)=δ(
n)
y
(n)
=T[
x(n)
]=h(
n)si
mil
arl
yδ(
n-k)
=h(
n-k)
x(
n)cabr
epr
esent
edaswei
ght
edsum ofi
mpul
sessuchas

y
(n)
= T[
x(n)
]

=
T[
δ(n)
=h(
n)t
henT[δ(
n-k)
]=h(
n-k)
Thusout
putofLTIsy
stem i
sgi
venbywei
ght
edsum oft
ime-
shi
ft
edi
mpul
ser
esponses
Li
nearConv
olut
ioni
nvol
vest
hef
oll
owi
ngoper
ati
ons.
1.Fol
ding
2.Mul
ti
pli
cat
ion
3.Addi
ti
on
4.Shi
ft
ing
Theseoper
ati
onscanber
epr
esent
edbyaMat
hemat
ical
Expr
essi
onasf
oll
ows:
PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:
cl
c;
cl
oseal
l
;
cl
earal
l
;
%pr
ogr
am f
orconv
olut
ionoft
wosequences
x=i
nput
('
ent
eri
nputsequence'
);
h=i
nput
('
ent
eri
mpul
ser
esponse'
);
y
=conv
(x,
h);
subpl
ot(
3,1,
1);
st
em(
x);
xl
abel
('
n'
);
y
label
('
x(n)
')
;
t
it
le(
'i
nputsi
gnal
'
)
subpl
ot(
3,1,
2);
st
em(
h);
xl
abel
('
n'
);
y
label
('
h(n)
')
;
t
it
le(
'i
mpul
ser
esponse'
)
subpl
ot(
3,1,
3);
st
em(
y);
xl
abel
('
n'
);
y
label
('
y(
n)'
);
t
it
le(
'l
i
nearconv
olut
ion'
)
di
sp(
'Ther
esul
tantsi
gnal
is'
);
di
sp(
y)
%pr
ogr
am f
orsi
gnal
conv
olut
ion
t
=0:
0.1:
10;
x1=si
n(2*
pi*
t);
h1=cos(
2*pi
*t)
;
y
1=conv
(x1,
h1)
;
f
igur
e;
subpl
ot(
3,1,
1);
pl
ot(
t,
x1)
;
xl
abel
('
t'
);
y
label
('
x(t
)'
);
t
it
le(
'i
nputsi
gnal
'
)
subpl
ot(
3,1,
2);
pl
ot(
t,
h1)
;
xl
abel
('
t'
);
y
label
('
h(t
)'
);
t
it
le(
'i
mpul
ser
esponse'
)
subpl
ot(
3,1,
3);
Pl
ot(
y1)
;
Xl
abel
('n'
);
Label
('y
(n)
')
;
t
it
le(
'l
i
nearconv
olut
ion'
);
7.
OUTPUT:
ent
eri
nputsequence[
2468]
ent
eri
mpul
ser
esponse[
1396]
Ther
esul
tantsi
gnal
is
2 10 36 74 102 108 48
>>
RESULT:Thust
heconv
olut
ionbet
weensi
gnal
sandsequencesi
scomput
ed.
VI
VAQUESTI
ONS
1.Wr
it
ethef
ormul
aforl
i
nearconv
olut
ion?

Ans:

2.Wr
it
erel
ati
onbet
weeni
nput
,out
put&i
mpul
ser
esponseoft
hesy
stem?

Ans:Y(
t)=x(
t)*
h(t
)

3.I
sconv
olut
ioncommut
ati
ve?
Ans:
yes
4.Li
stt
hest
epsi
nvol
vedi
nli
nearconv
olut
ion?

Ans:Li
nearConv
olut
ioni
nvol
vest
hef
oll
owi
ngoper
ati
ons.
1.Fol
ding
2.Mul
ti
pli
cat
ion
3.Addi
ti
on
4.Shi
ft
ing
5.Li
stanappl
i
cat
ionofconv
olut
ion?
Ans:
tof
indt
her
esponseofanLTIsy
stem
Expt-
6: Progr
am to comput
e Aut o corr
elat
ion and Cr
oss
corr
elat
ionbet
weensi
gnal
sandsequences.
AI
M:ToWr
it
ethepr
ogr
am t
ocomput
eAut
ocor
rel
ati
onandCr
osscor
rel
ati
onbet
ween
si
gnal
sandsequences.
SOFTWARE:
OCTAVE(
GUI
)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
Cor
rel
ati
onsofsequences:
I
tisameasur
eoft
hedegr
eet
owhi
cht
wosequencesar
esi
mil
ar.Gi
vent
wor
eal
-
v
aluedsequencesx(
n)andy
(n)off
ini
teener
gy,
Cor
rel
ati
oni
nvol
vest
hef
oll
owi
ngoper
ati
ons.
1.Shi
ft
ing
2.Mul
ti
pli
cat
ion
3.Addi
ti
on
Theseoper
ati
onscanber
epr
esent
edbyaMat
hemat
ical
Expr
essi
onasf
oll
ows:
Cr
osscor
rel
ati
on
ndexl
Thei iscal
l
edt
heshi
ftorl
agpar
amet
er
Aut
ocor
rel
ati
on
PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:
cl
c;
cl
oseal
l
;
cl
earal
l
;
%t
woi
nputsequences
x=i
nput
('
ent
eri
nputsequence'
);
h=i
nput
('
ent
ert
hei
mpul
sesuquence'
);
subpl
ot(
2,2,
1);
st
em(
x);
xl
abel
('
n'
);
y
label
('
x(n)
')
;
t
it
le(
'i
nputsequence'
);
subpl
ot(
2,2,
2);
st
em(
h);
xl
abel
('
n'
);
y
label
('
h(n)
')
;
t
it
le(
'i
mpul
sesi
gnal
'
);
%cr
osscor
rel
ati
onbet
weent
wosequences
y
=xcor
r(x,
h);
subpl
ot(
2,2,
3);
st
em(
y);
xl
abel
('
n'
);
y
label
('
y(
n)'
);
t
it
le(
'cr
osscor
rel
ati
onbet
weent
wosequences'
);
%aut
ocor
rel
ati
onofi
nputsequence
z=xcor
r(x,
x);
subpl
ot(
2,2,
4);
st
em(
z);
xl
abel
('
n'
);
y
label
('
z(n)
')
;ti
tl
e('
aut
ocor
rel
ati
onofi
nputsequence'
);
%cr
osscor
rel
ati
onbet
weent
wosi
gnal
s
%gener
ati
ngt
woi
nputsi
gnal
s
t
=0:
0.2:
10;
x1=3*
exp(
-2*
t);
h1=exp(
t);
f
igur
e;
subpl
ot(
2,2,
1);
pl
ot(
t,
x1)
;
xl
abel
('
t'
);
y
label
('
x1(
t)'
);
t
it
le(
'i
nputsi
gnal
'
);
subpl
ot(
2,2,
2);
pl
ot(
t,
h1)
;
xl
abel
('
t'
);
y
label
('
h1(
t)'
);
t
it
le(
'i
mpul
sesi
gnal
'
);
%cr
osscor
rel
ati
on
subpl
ot(
2,2,
3);
z1=xcor
r(x1,
h1)
;
pl
ot(
z1)
;
xl
abel
('
t'
);
y
label
('
z1(
t)'
);
t
it
le(
'cr
osscor
rel
ati
on'
);
%aut
ocor
rel
ati
on
subpl
ot(
2,2,
4);
z2=xcor
r(x1,
x1)
;
pl
ot(
z2)
;
xl
abel
('
t'
);
y
label
('
z2(
t)'
);
t
it
le(
'aut
ocor
rel
ati
on'
);

OUTPUT:
ent
eri
nputsequence[
1257]
Ent
ert
hei
mpul
sesequence[
26053]
RESULT:
Aut
ocor
rel
ati
onandCr
osscor
rel
ati
onbet
weensi
gnal
sandsequencesi
scomput
ed.
VI
VAQUESTI
ONS:
1.Def
inecor
rel
ati
on?
Ans:
Iti
sameasur
eoft
hedegr
eet
owhi
cht
wosequencesar
esi
mil
ar
2.Def
inecr
osscor
rel
ati
on?
Ans:
cor
rel
ati
onbet
weent
wodi
ff
erentsi
gnal
s
3.Def
ine&l
i
stt
wopr
oper
ti
esofaut
ocor
rel
ati
on.
Ans:
cor
rel
ati
onofasi
gnal
wit
hit
sel
f
4.Li
stt
wopr
oper
ti
esofcr
osscor
rel
ati
on.
5.Whi
chcommandi
susedt
oev
aluat
ecr
osscor
rel
ati
on?
Ans:
xcor
r

Expt
-7:Ver
if
icat
ionofLi
near
it
yandTi
meI
nvar
iancePr
oper
ti
esof
agi
venCont
inuous/Di
scr
eteSy
stem.
AI
M:
(
a)Ver
if
ytheLi
near
it
yofagi
venDi
scr
eteSy
stem.
(
b)Ver
if
ytheTi
meI
nvar
ianceofagi
venDi
scr
eteSy
stem.
SOFTWARE:
OCTAVE(
GUI
)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
Li
near
it
ypr
oper
ty:
Anysy
stem i
ssai
dtobel
i
neari
fitsat
isf
iest
hesuper
posi
ti
onpr
inci
pal
.
super
posi
ti
onpr
inci
palst
atet
hatResponset
oawei
ght
edsum ofi
nputsi
gnalequal
t
othecor
respondi
ngwei
ght
edsum oft
heout
put
soft
hesy
stem t
oeachoft
he
i
ndi
vi
dual
inputsi
gnal
s.

X(
n)-
--
--
--
--
--
inputsi
gnal
Y(
n)-
--
--
--
--out
putsi
gnal
Y(
n)=T[
x(n)
]
Y1(
n)=T[
X1(
n)]:
Y2(
n)=T[
X2(
n)]
x3=[
aX1(
n)]+b[
X2(
n)]
Y3(
n)=T[
x3(
n)]
=T[
aX1(
n)]+b[
X2(
n)]=aY1(
n)+b[
Y
Leta[
Y1(
n)]
+b[
X2(
n)]=Z3(
n)
PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:
cl
c;
cl
earal
l
;
cl
oseal
l
;
%ent
eri
ngt
woi
nputsequencesandi
mpul
sesequence
x1=i
nput(
'ty
pet
hesampl
esofx1'
);
x2=i
nput(
'ty
pet
hesampl
esofx2'
);
i
f(
lengt
h(x
1)~=l
engt
h(x2)
)
di
sp(
'er
ror
:Lengt
hsofx1andx2ar
edi
ff
erent
')
;
r
etur
n;
end;
h=i
nput(
'ty
pet
hesampl
esofh'
);
%l
engt
hofout
putsequence
N=l
engt
h(x1)+l
engt
h(h)-
1;
di
sp(
'l
engt
hoft
heout
putsi
gnal
wil
lbe'
);
di
sp(
N);
%ent
eri
ngscal
i
ngf
act
ors
a1=i
nput(
'Thescal
efact
ora1i
s')
;
a2=i
nput(
'Thescal
efact
ora2i
s')
;
x=a1*x1+a2*x2;
%r
esponseofxandx1
y
o1=conv
(x,
h);
y
1=conv
(x1,
h);
%scal
edr
esponseofx1
y
1s=a1*y
1;
%r
esponseofx2
y
2=conv
(x2,
h);
%scal
edr
esponseofx2
y
2s=a2*y
2;
y
o2=y
1s+y
2s;
di
sp(
'I
nputsi
gnal
x1i
s')
;di
sp(
x1)
;
di
sp(
'I
nputsi
gnal
x2i
s')
;di
sp(
x2)
;
di
sp(
'Out
putSequencey
o1i
s')
;di
sp(
yo1)
;
di
sp(
'Out
putSequencey
o2i
s')
;di
sp(
yo2)
;
i
f(y
o1==y
o2)
di
sp(
'yo1=y
o2.Hencet
heLTIsy
stem i
sLI
NEAR'
)
end;
OUTPUT:
t
ypet
hesampl
esofx1[
1567]
t
ypet
hesampl
esofx2[
2348]
t
ypet
hesampl
esofh[
2654]
l
engt
hoft
heout
putsi
gnal
wil
lbe7
Thescal
efact
ora1i
s2
Thescal
efact
ora2i
s3
I
nputsi
gnal
x1i
s
1567
I
nputsi
gnal
x2i
s
2348
Out
putSequencey
o1i
s
16 86 202 347 424 286 152
Out
putSequencey
o2i
s
16 86 202 347 424 286 152
y
o1=y
o2.Hencet
heLTIsy
stem i
sLI
NEAR
(
b)TI
MEI
NVARI
ENTSYSTEMS(
TI)
:
Asy
stem i
scal
l
edt
imei
nvar
ianti
fit
sinput–out
putchar
act
eri
sti
csdonotchangewi
th
t
ime
X(
t)-
--
-input:
Y(
t)-
--
out
put
X(
t-
T)-
--
--
del
ayi
nputbyTseconds:
Y(t
-T)-
--
--
-Del
ayedout
putbyTseconds
PROGRAM:
cl
c;
cl
earal
l
;
cl
oseal
l
;
%ent
eri
ngt
woi
nputsequences
x=i
nput
('Ty
pet
hesampl
esofsi
gnal
x(n)'
);
h=i
nput
('Ty
pet
hesampl
esofsi
gnal
h(n)'
);
%or
igi
nal
response
y=conv
(x,
h);
di
sp('
Ent
eraPOSI
TIVEnumberf
ordel
ay'
);
d=i
nput
('Desi
reddel
ayoft
hesi
gnal
is'
);
%del
ayedi
nput
xd=[
zer
os(
1,d)
,x]
;
nxd=0:
lengt
h(xd)
-1;
%del
ayedout
put
y
d=conv
(xd,
h);
ny
d=0:
l
engt
h(y
d)-
1;
di
sp(
'Or
igi
nal
InputSi
gnal
x(n)i
s')
;
di
sp(
x);
di
sp(
'Del
ayedI
nputSi
gnal
xd(
n)i
s')
;
di
sp(
xd)
;
di
sp(
'Or
igi
nal
Out
putSi
gnal
y(n)i
s')
;
di
sp(
y);
di
sp(
'Del
ayedOut
putSi
gnal
yd(
n)i
s')
;
di
sp(
yd)
;
xp=[
x,zer
os(
1,d)
];
subpl
ot(
2,1,
1);
st
em(
nxd,
xp)
;
gr
id;
xl
abel
('Ti
meI
ndexn'
);
y
label
('x(
n)'
);
t
it
le('
Ori
ginal
InputSi
gnal
x(n)'
);
subpl
ot(
2,1,
2);
st
em(
nxd,
xd)
;
gr
id;
xl
abel
('Ti
meI
ndexn'
);
y
label
('xd(
n)'
);
t
it
le('
Del
ayedI
nputSi
gnal
xd(
n)'
);
y
p=[
yzer
os(
1,d)
];
f
igur
e;
subpl
ot(
2,1,
1);
st
em(
nyd,
yp)
;
gr
id;
xl
abel
('Ti
meI
ndexn'
);
y
label
('y
(n)'
);
t
it
le('
Ori
ginal
Out
putSi
gnal
y(n)'
);
subpl
ot(
2,1,
2);
st
em(
nyd,
yd)
;
gr
id;
xl
abel
('Ti
meI
ndexn'
);
y
label
('y
d(n)'
);
t
it
le('
Del
ayedOut
putSi
gnal
yd(
n)'
);
OUTPUT:
Ty
pet
hesampl
esofsi
gnal
x(n)[
2346]
Ty
pet
hesampl
esofsi
gnal
h(n)[
1238]
Ent
eraPOSI
TIVEnumberf
ordel
ay
Desi
reddel
ayoft
hesi
gnal
is5
Or
igi
nal
InputSi
gnal
x(n)i
s
2346
Del
ayedI
nputSi
gnal
xd(
n)i
s
000002346
Or
igi
nal
Out
putSi
gnal
y(n)i
s
2 7 16 39 48 50 48
Del
ayedOut
putSi
gnal
yd(
n)i
s
0 0 0 0 0 2 7 16 39 48 50 48
RESULT:
TheLi
near
it
yandTi
meI
nvar
ianceofagi
venDi
scr
eteSy
stem i
sver
if
ied.
VI
VAQUESTI
ONS
1.Whati
sat
imei
nvar
iantsy
stem?

Ans:Asy
stem i
scal
l
edt
imei
nvar
ianti
fit
sinput–out
putchar
act
eri
sti
csdonot
changewi
tht
ime
2.Wr
it
eanequat
ionf
orcondi
ti
onf
orl
i
near
it
y?

Ans:
3.Whendoy
oucal
lasy
stem l
i
near
?
Ans:
wheni
tsat
isf
iest
hepr
inci
pleofhomogenei
tyandsuper
posi
ti
on.
4.Def
inet
hepr
inci
pleofsuper
sposi
ti
on.

Ans:super
posi
ti
onpr
inci
palst
atet
hatResponset
oawei
ght
edsum ofi
nputsi
gnal
equalt
othecor
respondi
ngwei
ght
edsum oft
heout
put
soft
hesy
stem t
oeachof
t
hei
ndi
vi
dual
inputsi
gnal
s.
5.Gi
veanexampl
eofanLTIsy
stem?

Ans:
fil
ter
Expt
-8:Comput
etheUni
tsampl
e,uni
tst
epandsi
nusoi
dal
r
esponseoft
hegi
venLTIsy
stem andv
eri
fyi
ngi
tsst
abi
l
ity
AI
M:
Comput
etheUni
tsampl
e,uni
tst
epandsi
nusoi
dal
responseoft
hegi
venLTIsy
stem
andv
eri
fyi
ngi
tsst
abi
l
ity
SOFTWARE:
OCTAVE(
GUI
)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
A di
scr
etet
imesy
stem per
for
msanoper
ati
ononani
nputsi
gnalbasedon
pr
edef
inedcr
it
eri
atopr
oduceamodi
fi
edout
putsi
gnal
.Thei
nputsi
gnalx(
n)i
sthe
sy
stem exci
tat
ion,andy
(n)i
sthesy
stem r
esponse.Thet
ransf
orm oper
ati
oni
s
shownas,

I
fthei
nputt
othesy
stem i
suni
timpul
sei
.e.x
(n)=δ(
n)t
hent
heout
putoft
hesy
stem
i
sknownasi
mpul
ser
esponsedenot
edbyh(
n)wher
e,
h(
n)=T[
δ(n)
]
weknowt
hatanyar
bit
rar
ysequencex(
n)canber
epr
esent
edasawei
ght
ed
sum ofdi
scr
etei
mpul
ses.Nowt
hesy
stem r
esponsei
sgi
venby
,

Forl
i
nearsy
stem (
1)r
educest
o
%gi
vendi
ff
erenceequat
iony
(n)
-y(
n-1)
+.9y
(n-
2)=x(
n);

PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:
%gi
vendi
ff
erenceequat
iony
(n)
-y(
n-1)
+.9y
(n-
2)=x(
n);
b=[
1];
a=[
1,-
1,.
9];
n=0:
3:100;
%gener
ati
ngi
mpul
sesi
gnal
x1=(
n==0)
;
%i
mpul
ser
esponse
h1=f
il
ter
(b,
a,
x1)
;
subpl
ot(
3,1,
1);
st
em(
n,h1)
;
xl
abel
('
n'
);
y
label
('
h(n)
')
;ti
tl
e('
i
mpul
ser
esponse'
);
%gener
ati
ngst
epsi
gnal
x2=(
n>0)
;
%st
epr
esponse
s=f
il
ter
(b,
a,
x2)
;
subpl
ot(
3,1,
2);
st
em(
n,s)
;
xl
abel
('
n'
);
y
label
('
s(n)
')
t
it
le(
'st
epr
esponse'
);
%gener
ati
ngsi
nusoi
dal
signal
t
=0:
0.1:
2*pi
;
x3=si
n(t
);
%si
nusoi
dal
response
h2=f
il
ter
(b,
a,
x3)
;
subpl
ot(
3,1,
3);
st
em(
h2)
;
xl
abel
('
n'
);
y
label
('
h(n)
')
;
t
it
le(
'si
nresponse'
);
%v
eri
fi
ngst
abi
l
ity
f
igur
e;
zpl
ane(
b,a)
;
OUTPUT:
8.
RESULT:
TheUni
tsampl
e,uni
tst
epandsi
nusoi
dal
responseoft
hegi
venLTIsy
stem i
s
comput
edandi
tsst
abi
l
ityv
eri
fi
ed.
Henceal
lthepol
esl
i
einsi
det
heuni
tci
rcl
e,sosy
stem i
sst
abl
e.
VI
VAQUESTI
ONS
1.Whati
suni
tsampl
eresponse?

Ans:TheresponseofanLTIsy
stem whent
hegi
veni
nputi
sani
mpul
sesi
gnal
wit
hzer
oinit
ialcondi
ti
ons.

2.Whati
ssi
nusoi
dal
response?

Ans:TheresponseofanLTIsy
stem whent
hegi
veni
nputi
ssi
newav
ewi
thzer
o
i
nit
ial
condi
tions.

3.Whati
suni
tst
epr
esponse?
Ans:Ther
esponseofanLTIsy
stem whent
hegi
veni
nputi
sanuni
tst
epsi
gnal
wit
hzeroi
nit
ial
condi
ti
ons.

4.Whati
stot
alr
esponseofasy
stem?

Ans:i
tist
hesum ofnat
ural
andf
orcedr
esponsesoft
hesy
stem.
5.Wheni
sthesy
stem st
abl
e?

Ans:
whenal
lthepol
esl
i
einsi
det
heuni
tci
rcl
e.
Expt
- Ver
9: if
ytheGi
bbsphenomenon
AI
M:
Ver
if
ytheGi
bbsphenomenon.
SOFTWARE:
OCTAVE(
GNU)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
Gi
bbsphenomenon
The Four
ierser
ies ofa pi
ecewi
se cont
inuousl
ydi
ff
erent
iabl
e per
iodi
cfunct
ion
behav
esataj
umpdi
scont
inui
ty.Thent
heappr
oxi
mat
edf
unct
ionshowsamount
sof
r
ippl
esatt
hepoi
ntsofdi
scont
inui
ty.Thi
sisknownast
heGi
bbsPhenomenon.
Par
ti
alsum oft
heFour
ierser
ieshasl
argeosci
l
lat
ionsneart
hej
ump,whi
chmi
ght
i
ncr
easet
hemaxi
mum oft
hepar
ti
alsum abov
ethatoft
hef
unct
ioni
tsel
f.The
ov
ershootdoesnotdi
eoutast
hef
requencyi
ncr
eases,
butappr
oachesaf
ini
tel
i
mit
TheGi
bbsphenomenoni
nvol
vesbot
hthef
actt
hatFour
iersumsov
ershootata
j
ump di
scont
inui
ty,and t
hatt
hisov
ershootdoesnotdi
eoutast
hef
requency
i
ncr
eases.
PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:
cl
c;
cl
earal
l
;
cl
oseal
l
;
t
=0:
0.1:
(pi
*8)
;
y
=si
n(t
);
subpl
ot(
5,1,
1);
pl
ot(
t,
y);
xl
abel
('
k'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'gi
bbsphenomenon'
);
h=2;
%k=3;
f
ork=3:
2:9
y
=y+si
n(k*
t)/
k;%f
our
ierser
iesofsi
nsi
gnal
subpl
ot(
5,1,
h);
pl
ot(
t,
y);
xl
abel
('
k'
);
y
label
('
ampl
i
tude'
);
h=h+1;
end
OUTPUT:

RESULT:Gi
bbsphenomenoni
sver
if
ied.
VI
VAQUESTI
ONS
1.Def
inegi
bb’
sphenomenon?

Ans:TheFouri
erseri
esofapiecewi seconti
nuouslydi
ff
erent
iabl
eperi
odi
cfunct
ion
behavesataj
umpdiscont
inui
ty.Thent heapproxi
matedfunct
ionshowsamountsof
ri
pplesatt
hepoi
ntsofdi
sconti
nuity

2.Whati
sfour
ierser
ies?

Ans:Ttisusedtot r
ansfor
m per
iodi
csignalsf
rom t
imedomai
ntof
requency
domain.
3.Whatarethediff
erentty
pesoffouri
erseri
es?
Ans:Two.Trigonometri
candexponenti
al
4.Whatt
ypeofequat
ioni
susedi
nthepr
ogr
am?

Ans:r
ecursi
veequati
on
5.Onwhatfacti
sgibbsphenomenonbasedon?

Ans:Fouri
ersumsov er
shootataj umpdi scont
inui
ty,andt
hatt
hisov
ershoot
doesnotdieoutast
hefrequencyi
ncreases.

Expt
- Tof
10: indt
heFour
ierTr
ansf
orm ofagi
vensi
gnal
and
pl
ott
ingi
tsmagni
tudeandphasespect
rum.
AI
M:
Tof
indt
heFour
ierTr
ansf
orm ofagi
vensi
gnal
andpl
ott
ingi
tsmagni
tudeandphase
spect
rum.
SOFTWARE:
OCTAVE(
GNU)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
Four
ierTr
ansf
orm:
TheFour
iert
ransf
orm asf
oll hatƒi
ows.Supposet saf
unct
ionwhi
chi
szer
o
out
sideofsomei
nter
v −L/
al[ 2,L/
2] oranyT≥Lwemayexpandƒi
.Thenf naFour
ier
ser
iesont
hei
nter
val
[−T/
2,T/
2],
wher
ethe"
amount
"oft
hewav
e
e2πi
nx/
Tint
heFour
ierser
iesofƒi
sgi
venby

Bydef
ini
ti
onFour
ierTr
ansf
orm ofsi
gnal
f(t
)isdef
inedas

I
ver
seFour
ierTr
ansf
orm ofsi
gnal
F(w)i
sdef
inedas

PROCEDURE:
-
 OpenMATLAB
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow

PROGRAM:
cl
c;
cl
earal
l
;
cl
oseal
l
;
f
s=1000;
N=1024;
%lengt
hoff
ftsequence
t
=[0:
N-1]
*(1/
fs)
;
%i
nputsi
gnal
x=0.
8*cos(
2*pi
*100*
t);
subpl
ot(
3,1,
1);
pl
ot(
t,
x);
axi
s([
00.
05-
11]
);
gr
id;
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'i
nputsi
gnal
'
);
%magni
tudespect
rum
x1=f
ft(
x);
k=0:
N-1;
Xmag=abs(
x1)
;
subpl
ot(
3,1,
2);
pl
ot(
k,Xmag)
;
gr
id;
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
t
it
le(
'magni
tudeoff
ftsi
gnal
'
)

%phasespect
rum
Xphase=angl
e(x1)
*(180/
pi)
;
subpl
ot(
3,1,
3);
pl
ot(
k,Xphase)
;
gr
id;
xl
abel
('
t'
);
y
label
('
angl
eindegr
ees'
);
t
it
le(
'phaseoff
ftsi
gnal
'
);

OUTPUT:
RESULT:
Magni
tudeandphasespect
rum ofFFTofagi
vensi
gnal
ispl
ott
ed.

VI
VAQUESTI
ONS
1.Def
inef
our
iert
ransf
orm?

Ans:I
tisat
echni
queusedt
oconv
ertasi
gnalf
rom t
imedomai
ntof
requency
domai
n.

2.Whati
sDFT?

Ans:Di
scr
eteFour
ierTr
ansf
orm usedt
ofi
ndF.
Tofdi
scr
etesi
gnal
s
3.Whati
sFFT?
Ans:
iti
sfastFour
iert
ransf
ormt
hatcomput
esDFTwi
thl
essnumberof
comput
ati
onsf
orcompl
exf
unct
ions
4.Whatar
etheal
gor
it
hmsusedf
orFFT?

Ans:Deci
mat
ioni
nTI
MEanddeci
mat
ioni
nFREQUENCY
5.Whi
chcommandi
susedt
ocomput
efastf
our
iert
ransf
orm?

Ans:
fft

Expt
-11:l
ocat
ingpol
esandzer
osandpl
ott
ingpol
e-zer
omapsi
ns-
pl
aneandz-
planef
ort
hegi
vent
ransf
erf
unct
ion
AI
M:
Wr
it
ethepr
ogr
am f
orl
ocat
ingpol
esandzer
osandpl
ott
ingpol
e-zer
omapsi
ns-
pl
aneandz-
planef
ort
hegi
vent
ransf
erf
unct
ion.
SOFTWARE:
OCTAVE(
GUI
)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
Z-
tr
ansf
orms
TheZ-
tr
ansf
orm,
li
kemanyot
heri
ntegr
alt
ransf
orms,
canbedef
inedasei
ther
aone-
sidedort
wo-
sidedt
ransf
orm.
Bi
l
ater
alZ-
tr
ansf
orm
Thebi
l
ater
alort
wo-
sidedZ-
tr
ansf
orm ofadi
scr
ete-
ti
mesi x[
gnal n]i
sthef
unct
ion
X(
z)def
inedas

Uni
l
ater
alZ-
tr
ansf
orm
Al
ter
nat
ivel
y,i ex[
ncaseswher n]i
sdef
inedonl
yforn≥0,
thesi
ngl
e-si
dedor
uni
l
ater
alZ-
tr
ansf
ormi
sdef
inedas

I
nsi
gnal
processi
ng,
thi
sdef
ini
ti
oni
susedwhent
hesi
gnal
iscausal
.

Ther
oot
soft
heequat
ionP(
z)=0cor
respondt
othe'
zer
os'
ofX(
z)
Ther
oot
soft
heequat
ionQ(
z)=0cor
respondt
othe'
pol
es'
ofX(
z)
PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:
cl
c;
cl
earal
l
;
cl
oseal
l
;
%ent
ert
henumer
atoranddenamenat
orcof
fi
cient
sinsquar
ebr
acket
s
num=i
nput
('
ent
ert
henumer
atorcof
fi
cient
s')
;
den=i
nput
('
ent
ert
hedenamenat
orcof
fi
cient
s')
;
%f
indt
het
ransf
erf
unct
ionusi
ngbui
l
t-i
nfunct
ion'
fi
lt
'
H=f
il
t(
num,
den)
%f
indl
ocat
ionsofzer
os
z=zer
o(H)
;
di
sp(
'zer
osar
eat'
);
di
sp(
z);
%f
indr
esi
dues,
pol
elocat
ionsandgai
nconst
antofH(
z)
[
rpk]
=resi
duez(
num,
den)
;
di
sp(
'pol
esar
eat'
);
di
sp(
p);
%pl
ott
hepol
ezer
omapi
nz-
plane
zpl
ane(
num,
den)
;
t
it
le(
'pol
e-zer
omapofLTIsy
stem i
nz-
plane'
);

%pl
oe-
zer
opl
oti
ns-
plane
H1=t
f(num,
den)%f
indt
ransf
erf
unct
ionH(
s)
[
p1,
z1]
=pz
map(
H1)
;%f
indt
hel
ocat
ionsofpol
esandzer
os
di
sp(
'pol
esarat'
);
disp(
p1)
;
di
sp(
'zer
osarat'
);
disp(
z1)
;
f
igur
e;
%pl
ott
hepol
e-zer
omapi
ns-
plane
pz
map(
H1)
;
t
it
le(
'pol
e-zer
omapofLTIsy
stem i
ns-
plane'
);
OUTPUT:
ent
ert
henumer
atorcof
fi
cient
s[1-
143.
5]
ent
ert
hedenamenat
orcof
fi
cient
s[23-
2.56]
Tr
ansf
erf
unct
ion'
H'f
rom i
nput'
u1'
toout
put.
..
1-z^
-1+4z^
-2+3.
5z^
-3
y
1:-
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-
2+3z^
-1-2.
5z^
-2+6z^
-3
Sampl
i
ngt
ime:
unspeci
fi
ed
Di
scr
ete-
ti
memodel
.
zer
osar
eat
0.
84023+2.
10654i
0.
84023-2.
10654i
-
0.68047+0.
00000i
pol
esar
eat
0.
49370-0.
98099i
0.
49370+0.
98099i
-
2.48741-0.
00000i

Tr
ansf
erf
unct
ion'
H1'
from i
nput'
u1'
toout
put.
..
s^
3-s^
2+4s+3.
5
y
1:-
--
--
--
--
--
--
--
--
--
--
--
--
2s^
3+3s^
2-2.
5s+6
Cont
inuous-
ti
memodel
.
pol
esarat
-
2.48741+0.
00000i
0.
49370+0.
98099i
0.
49370-0.
98099i
zer
osarat
0.
84023+2.
10654i
0.
84023-2.
10654i
-
0.68047+0.
00000i
>>
RESULT:
Pol
e-zer
omapsar
epl
ott
edi
ns-
planeandz-
planef
ort
hegi
vent
ransf
er
f
unct
ion.
VI
VAQUESTI
ONS
1)Whati
stheuseoff
il
tcommand?
A)DSPOr
ient
edSpeci
fi
cat
ionofdi
scr
etet
ransf
erf
unct
ion.
2)Whati
stheuseofzer
ocommand?
A)Zer
ocomput
est
het
ransmi
ssi
onzer
osofLTIsy
stem.
3)Whati
stheuseofzpl
anecommand?
A:
Zpl
aneusedt
opl
otzer
osandpol
esi
nuni
tci
rcl
eref
erence.
4)Whatt
heuseofpzmapcommand?
A)Pzmapcomput
espol
esandzer
osi
nLTIsy
stem andpl
ott
hem i
ncompl
expl
ane.
5)Whathappeni
fthepol
esoft
ransf
erf
unct
ionl
i
einsi
dei
nuni
tci
rcl
e?
A)Sy
stem r
emai
nsst
abl
e.

Expt
-12:Ver
if
icat
ionofsampl
i
ngt
heor
em
AI
M:
Tov
eri
fyt
hesampl
i
ngt
heor
em.
SOFTWARE:
OCTAVE(
GUI
)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
Sampl
i
ngTheor
em:
Abandl
i
mit
edsi
gnal
canber
econst
ruct
edexact
lyi
fiti
ssampl
edatar
ateatl
east
t
wicet
hemaxi
mum f
requencycomponenti
nit
."Fi
gur
e1showsasi
gnal
g(t
)thati
s
bandl
i
mit
ed.

Fi
gur
e1:
Spect
rum ofbandl
i
mit
edsi
gnal
g(t
)
Themaxi
mum f
requencycomponentofg(
t)i
sfm.Tor
ecov
ert
hesi
gnal
g(t
)exact
ly
f
rom i
tssampl
esi
thast
obesampl
edatar
atef
s≥2f
m.
Themi
nimum r
equi
redsampl
i
ngr
atef
s=2f
miscal
l
ed'
Nyqui
str
ate
Pr
oof
:Letg(
t)beabandl
i
mit
edsi
gnal
whosebandwi
dthi
sfm(
wm =2πf
m).
Fi
gur
e2:
(a)Or
igi
nal
signal
g(t
)(b)Spect
rum G(
w)
δ(
t)i
sthesampl
i
ngsi
gnal
wit
hfs=1/
T>2f
m.

Fi
gur
e3:
(a)sampl
i
ngsi
gnal
δ(t
)(b)Spect
rum δ(
w)
Fi
gur
e4:
(a)sampl
edsi
gnal
gs(
t)(
b)Spect
rum Gs(
w)

Tor
ecov
ert
heor
igi
nal
signal
G(w)
:Fi
l
terwi
thaGat
efunct
ion,
H2wm(
w)ofwi
dth2wm
Scal
eitbyT.

Fi
gur
e5:
Recov
eryofsi
gnal
byf
il
ter
ingwi
thaf
it
erofwi
dth2wm

Al
i
asi
ngws<2wm

Fi
gur
e6:
Ali
asi
ngduet
oinadequat
esampl
i
ng

Al
i
asi
ngl
eadst
odi
stor
ti
oni
nrecov
eredsi
gnal
.Thi
sist
her
easonwhysampl
i
ng
f
requencyshoul
dbeat
leastt
wicet
hebandwi
dthoft
hesi
gnal
.
Ov
ersampl
i
ngws>2wm
Thi
scondi
ti
onav
oidsal
i
asi
ng.

Fi
gur
e7:
Over
sampl
edsi
gnal
-av
oidsal
i
asi
ng
PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:
Cl
c;
Cl
earal
l
;
Cl
oseal
l
;
t
=-10:
.
01:
10;
T=4;
f
m=1/
T;
x=cos(
2*pi
*fm*
t);
subpl
ot(
2,2,
1);
pl
ot(
t,
x);
xl
abel
('
ti
me'
);
y
label
('
x(t
)'
);
t
it
le(
'cont
inoust
imesi
gnal
'
);
gr
id;
n1=-
4:1:
4;
f
s1=1.
6*f
m;f
s2=2*
fm;
f
s3=8*
fm;
x1=cos(
2*pi
*fm/
fs1*
n1)
;
subpl
ot(
2,2,
2);
st
em(
n1,
x1)
;
xl
abel
('
ti
me'
);
y
label
('
x(n)
')
;
t
it
le(
'di
scr
etet
imesi
gnal
wit
hfs<2f
m')
;
hol
don;
subpl
ot(
2,2,
2);
pl
ot(
n1,
x1)
;
gr
id;
n2=-
5:1:
5;
x2=cos(
2*pi
*fm/
fs2*
n2)
;
subpl
ot(
2,2,
3);
st
em(
n2,
x2)
;
xl
abel
('
ti
me'
);
y
label
('
x(n)
')
;
t
it
le(
'di
scr
etet
imesi
gnal
wit
hfs=2f
m')
;
hol
don;
subpl
ot(
2,2,
3);
pl
ot(
n2,
x2)
gr
id;
n3=-
20:
1:20;
x3=cos(
2*pi
*fm/
fs3*
n3)
;
subpl
ot(
2,2,
4);
st
em(
n3,
x3)
;
xl
abel
('
ti
me'
);
y
label
('
x(n)
')
;
t
it
le(
'di
scr
etet
imesi
gnal
wit
hfs>2f
m')
hol
don;
subpl
ot(
2,2,
4);
pl
ot(
n3,
x3)
gr
id;
OUTPUT:

RESULT:
Sampl
i
ngt
heor
em i
sver
if
ied.
VI
VAQUESTI
ONS
1)Def
inesampl
i
ng?

A)Sampli
ngi
samet hodofstudyi
ngf
rom afewselect
edit
ems,
insteadoft
he
ent
ir
ebignumberofuni
ts.Thesmal
lsel
ecti
oniscall
edsample.

2)Wher
eweusesampl
i
ngt
heor
em t
echni
que?

A)Sampl
i
ngt
heor
em t
echni
quei
susedi
nanl
ogt
odi
git
alconv
ert
er.

3)Whati
sthecondi
ti
onf
orAl
i
asi
ng?

A)Ali
si
ngleadstodi
stor
ti
oninrecover
edsignal
thi
sist
hereasonwhysampl
i
ng
fr
equencyshoul
dbeatleastt
wicethebandwidt
hofthesi
gnal.

Fs>2f
m.

4)Whati
stheuseofhol
donoper
ati
on?

A)I
twi
l
lhol
dst
hecur
rentgr
aph.

5)Di
ff
erentt
ypesofsampl
i
ngt
echni
que?

A)I
mpul
sesampl
i
ng,
nat
ural
sampl
i
ng,
fl
att
opsampl
i
nget
c….
.
Expt
-13:TheRemov
alofnoi
sebyusi
ngaut
ocor
rel
ati
on
AI
M:
Towr
it
eapr
ogr
am f
ort
heRemov
alofnoi
sebyusi
ngaut
ocor
rel
ati
on.
SOFTWARE:
OCTAVE(
GNU)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
Det
ect
ionofaper
iodi
csi
gnal
maskedbyr
andom noi
sei
sofgr
eat
i
mpor
tance.
Thenoi
sesi
gnal
encount
eredi
npr
act
icei
sasi
gnal
wit
hrandom
ampl
i
tudev
ari
ati
ons.Asi
gnal
isuncor
rel
atedwi
thanyper
iodi
csi
gnal
.Ifs(
t)
i
saper
iodi
csi
gnal
andn(
t)i
sanoi
sesi
gnal
then

Qsn(
T)=cr
osscor
rel
ati
onf
unct
ionofs(
t)andn(
t)ThenQsn(
T)=0
Det
ect
ionofnoi
sebyAut
o-Cor
rel
ati
on:
S(
t)=Per
iodi
cSi
gnal
(Tr
ansmi
tt
ed),
mixedwi
thanoi
sesi
gnal
n(t
).
Thenf
(t)i
srecei
vedsi
gnal
is[
s(t)+n(
t)]
LetQf
f(t
)=Aut
oCor
rel
ati
onFunct
ionoff
(t)
Qss(
t)=Aut
oCor
rel
ati
onFunct
ionofS(
t)
Qnn(
t)=Aut
oCor
rel
ati
onFunct
ionofn(
t)
=Qss(
T)+Qnn(
T)+Qsn(
T)+Qns(
T)
Theper
iodi
csi
gnal
s(t
)andnoi
sesi
gnal
n(t
)ar
euncor
rel
ated
Qsn(
t)=Qns(
t)=0;
ThenQf
f(t
)=Qss(
t)+Qnn(
t)

TheAut
ocor
rel
ati
onf
unct
ionofaper
iodi
csi
gnal
isper
iodi
coft
hesame
f
requencyandt
heAut
ocor
rel
ati
onf
unct
ionofanonper
iodi
csi
gnal
ist
ends
t
ozer
oforl
argev
alueofTsi
nces(
t)i
saper
iodi
csi
gnal
andn(
t)i
snon
per
iodi
csi
gnal
soQss(
T)i
saper
iodi
cwher
easaQnn(
T)becomessmal
lfor
l
argev
aluesofTTher
efor
eforsuf
fi
cient
lyl
argev
aluesofTQf
f(T)i
sequal
t
oQss(
T).
PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:
cl
c;
cl
earal
l
;
cl
oseal
l
;
t
=0:
0.2:
pi*
8;
%i
nputsi
gnal
s=si
n(t
);
subpl
ot(
6,1,
1);
pl
ot(
s);
t
it
le(
'si
gnal
s')
;
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%gener
ati
ngnoi
se
n=r
andn(
[1126]
);
%noi
sysi
gnal
f
=s+n;
subpl
ot(
6,1,
2)
pl
ot(
f);
t
it
le(
'si
gnal
f=s+n'
);
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%aucor
rel
ati
onofi
nputsi
gnal
as=xcor
r(s,
s);
subpl
ot(
6,1,
3);
pl
ot(
as)
;
t
it
le(
'aut
ocor
rel
ati
onofs'
);
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%aucor
rel
ati
onofnoi
sesi
gnal
an=xcor
r(n,
n);
subpl
ot(
6,1,
4)
pl
ot(
an)
;
t
it
le(
'aut
ocor
rel
ati
onofn'
);
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%aucor
rel
ati
onoft
ransmi
tt
edsi
gnal
cf
f=xcor
r(f
,f
);
subpl
ot(
6,1,
5)
pl
ot(
cff
);
t
it
le(
'aut
ocor
rel
ati
onoff
')
;
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%aucor
rel
ati
onofr
ecei
vedsi
gnal
hh=as+an;
subpl
ot(
6,1,
6)
pl
ot(
hh)
;
t
it
le(
'addi
ti
onofas+an'
);
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);

OUTPUT:

RESULT:
Thust
henoi
sei
sremov
edbyusi
ngaut
ocor
rel
ati
on.
VI
VAQUESTI
ONS
1)Def
ineaut
ocor
rel
ati
on?

A)"
Autocorr
elat
ion"isusedtocompareasi
gnalwi
thati
me-del
ayedv er
sionofitself
.
..
.impl
icat
ed autocorr
elat
ion 
asapot
ent
ial
l
yimpor
tantpar
tof 
signalprocessing 
.

2)Whati
stheuseofxcor
roper
ati
on?

A)Xcor
rpr
oducesanest
imat
ionoft
hecor
rel
ati
onbet
weent
wor
andom sequences.

3)I
stheaut
ocor
rel
ati
oni
scommut
ati
ve?

A)No.

4)Cor
rel
ati
onbet
weenper
iodi
candper
iodi
csi
gnal
is?

A)zer
o.

5)Li
stoneappl
i
cat
ionf
orcor
rel
ati
on?

A)Remov
alofnoi
sei
nfi
l
ter
s.
Expt
-14:Ext
ract
ionofper
iodi
csi
gnal
usi
ngcor
rel
ati
on
AI
M:
Towr
it
eapr
ogr
am f
orext
ract
ionofper
iodi
csi
gnal
usi
ngcor
rel
ati
on.
SOFTWARE:
OCTAVE(
GNU)4.
0.1.
OPERATI
NGSYSTEM:
Windows7
THEORY:
Asi
gnal
ismaskedbynoi
secanbedet
ect
edei
therbycor
rel
ati
ont
echni
ques
orbyf
il
ter
ing.Act
ual
l
y,t
het
wot
echni
quesar
eequi
val
ent
.Thecor
rel
ati
on
t
echni
quei
sameasur
eofext
ract
ionofagi
vensi
gnal
int
het
imedomai
n
wher
easf
il
ter
ingachi
evesexact
lyt
hesamer
esul
tsi
nfr
equencydomai
n.
PROCEDURE:
-
 OpenOCTAVE
 OpennewM-
fi
le
 Ty
pet
hepr
ogr
am
 Sav
eincur
rentdi
rect
orywi
th.
m ext
ensi
on
 Compi
l
eandRunt
hepr
ogr
am
 Fort
heout
putseecommandwi
ndow/
Figur
ewi
ndow
PROGRAM:
cl
earal
l
;
cl
oseal
l
;
cl
c;
t
=0:
0.1:
pi*
4;
%i
nputsi
gnal
1
s=si
n(t
);
subpl
ot(
7,1,
1)
pl
ot(
s);
t
it
le(
'si
gnal
s')
;
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%i
nputsi
gnal
2
c=cos(
t);
subpl
ot(
7,1,
2)
pl
ot(
c);
t
it
le(
'si
gnal
c')
;
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%gener
ati
ngnoi
sesi
gnal
n=r
andn(
[1126]
);
%si
gnal
+noi
se
f
=s+n;
subpl
ot(
7,1,
3);
pl
ot(
f);
t
it
le(
'si
gnal
f=s+n'
);
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%cr
osscor
rel
ati
onofsi
gnal
1&si
gnal
2
asc=xcor
r(s,
c);
subpl
ot(
7,1,
4)
pl
ot(
asc)
;
t
it
le(
'cor
rel
ati
onofsandc'
);
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%cr
osscor
rel
ati
onofnoi
se&si
gnal
2
anc=xcor
r(n,
c);
subpl
ot(
7,1,
5)
pl
ot(
anc)
;
t
it
le(
'cor
rel
ati
onofnandc'
);
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%cr
osscor
rel
ati
onoff
&si
gnal
2
cf
c=xcor
r(f
,c)
;
subpl
ot(
7,1,
6)
pl
ot(
cfc)
;
t
it
le(
'cor
rel
ati
onoffandc'
);
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
%ext
ract
ingper
iodi
csi
gnal
hh=asc+anc;
subpl
ot(
7,1,
7)
pl
ot(
hh)
;
t
it
le(
'addi
ti
onofsc+nc'
);
xl
abel
('
t'
);
y
label
('
ampl
i
tude'
);
OUTPUT:

RESULT:
ThusPer
iodi
csi
gnal
isext
ract
edbyusi
ngcor
rel
ati
on.
VI
VAQUESTI
ONS:
1)Whati
stheuseoft
hist
echni
que?

A)Thi
stechni
quei
susedt
omeasur
eofext
ract
ionofagi
vensi
gnal
int
het
ime
domain.
2)Def
inecor
rel
ati
on?

A)Amut
ual
rel
ati
onshi
porconnect
ionbet
weent
woormor
ethi
ngs.

3)Def
inecr
osscor
rel
ati
on?

A)Crosscor
rel
ati
onismeasur
eofsi
mil
ari
tyoft
woser
iesasaf
unct
ionoft
hel
agof
onerel
ati
vetotheot
her
.

4)Wr
it
edownt
hef
ormul
aet
oev
aluat
ecr
osscor
rel
ati
on?

wher
e   
denot
est
he 
compl
exconj
ugat
e of
  and  
i
sthel
ag.

5)Def
inenoi
se?

A)Noise i
sunwantedelect
ri
cal
orel
ect
romagnet
icener
gyt
hatdegr
adest
hequal
i
ty
of
 signalanddata.

Expt
-15:GENERATI
ONOFGAUSSI
ANNOI
SE
AI
M:
Wr
it
ethepr
ogr
am f
orgener
ati
onofGaussi
annoi
seandcomput
ati
onofi
tsmean,
meansquar
eval
ue,
skew,
kur
tosi
sandpr
obabi
l
itydi
str
ibut
ionf
unct
ion.

SOFTWAREREQUI
RED:
OCTAVE(
GNU)4.
0.1.
PROGRAM:
cl
c;
cl
earal
l
;
cl
oseal
l
;
%gener
atesf
ir
stsetof2000sampl
esofGaussi
andi
str
ibut
ed
r
andom number
s
x1=r
andn(
1,2000)
;
%gener
atessecondsetof2000sampl
esofGaussi
andi
str
ibut
edr
andom number
s
x2=r
andn(
1,2000)
;
%pl
ott
hej
ointdi
str
ibut
ionofbot
htheset
susi
ngdot
.
pl
ot(
x1,
x2,
'
.'
);
t
it
le(
'scat
terpl
otofgaussi
andi
str
ibut
edr
andom number
s')
;
%gener
atest
woset
sof2000sampl
esofuni
for
m di
str
ibut
ed
r
andom number
s
x3=r
and(
1,2000)
;
x4=r
and(
1,2000)
;
f
igur
e;
pl
ot(
x3,
x4,
'
.'
);
t
it
le(
'scat
terpl
otofuni
for
m di
str
ibut
edr
andom number
s')
;
f
igur
e;
subpl
ot(
2,1,
1);

%pl
ott
hehi
stogr
am gr
aphofx2
hi
st(
x2)
;
t
it
le(
'gaussi
andi
str
ibut
ion'
);
subpl
ot(
2,1,
2);
%pl
ott
hehi
stogr
am gr
aphofx4
hi
st(
x4)
;
t
it
le(
'uni
for
m di
str
ibut
ion'
);
y
mu=mean(
x2)
y
msq=sum(
x2.
^2)
/l
engt
h(x2)
y
sigma=st
d(x2)
y
var
=var
(x2)
y
skew=skewness(
x2)
y
kur
t=kur
tosi
s(x2)
OUTPUT:
y
mu=0.
061601
y
msq=1.
0060
y
sigma=1.
0014
y
var=1.
0027
y
skew=0.
0020865
y
kur
t=3.
1027
RESULT:
ThusGaussi
annoi
sei
sgener
atedandi
tsv
ari
ouschar
act
eri
sti
csar
ecal
cul
ated
usi
ngOCTAVE.
VI
VAQUESTI
ONS:
1.Whati
sGaussi
annoi
se?

2.Whati
sPr
inci
pleofGaussi
annoi
se?

3.HowcanGaussi
annoi
seber
educed?

4.Expl
aint
hecommandofC.
hist
?

5.Def
ineGaussi
andi
str
ibut
ionf
unct
ion?

You might also like