0 ratings0% found this document useful (0 votes) 57 views30 pagesSignal System Experiment File
an practical file or experiments of signal and system
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
2
| B INDEX
Me,
S.No. Name of the eRraen Date Page No,
\rtevduction te MA:
JTLAR
\Rasic plotting of
signals
Time and Amplitud
Hans formations
convolution of gi
signe’
calculating fourier
lk Z—feans form using
MATLAB
eo)
6-\4
IS -\B
19-21
2A ~-aS}Experiment L
Objut } ddroduchion to MATLAB
(©) To difiae amd ust veruabl and fumchion in MATLAB
©) To dif and un Varlors makruices amd polynomials
any MAT LAG
© To study vawous MATLAB arth mehc opirator
amd rrothematy achon
@ To cuat ond ust m- fr
Peunry i MATURB o> a programming lamqunge daueatect
by Math Work Lk ataned owt ob a motuie
lena bcatedy um ton lesbna programed
wad Gim@li MATLAB dy a foul quinahin Ieghleet
PrEguamming languags and datrrachiae envirommd for
numutcal computation , visuatizahion and programming
TE alimo mathiy mami pubrhon, plotting of qurchoo and dots
dirnplimentabion of algoritim tration oh ua sinkinh aces
In MATLAB emuinon mink , eumyvariabl do an array
Variable can bt dipiad um MATLAB om YH pollrwsery wos
Ke 3) Ae dahiniong X and uci Wablaing +t wikia vate
Ke AqUtlIG) ‘7, dufiming X amd amitablatng Eb urith am
expuasion
The clean commond dalits AU Con Hue pect {ced ) varwabh,
fem the rin DIY,
Lue.Fon exam ple
wo: (72@ 9°? wy;
Column Veer
fo dulimit she cloned
pemieaaan ne
e (1 @, 93 to5 tty
ing Mat)
Creaking x
malnin isa pudimemtonat annaty
oh number «
La MATLAB a motr'» bo eneatid Ly entry cachMATLAB En Se amyfll Sie
PATER B Enutron ment
Lemm amd im dng 1 When eur MATLAB ty cimvopet, He maim
wendew called command usindow Jr
ecBwalicl . IM command windene airplays dH commanch
Bees ee and a UKE Whine Cor ronol cae entire
and an exreuttd instantaneously
Command History Windeo We casio lof. tint of oll 28
command that ant enti at He
Command usindw Okese command Atmain tn Hu Lot
whl ebay ane dubctid Any command maz bt exatil ty
Adeching amd double ticking it with hs mount
Derkspect | § werkepncs Os @ collection ohatl x
vorwabl thot hove bem 4 ted so fan
tn He cere MATLAB session and phew Hur dak tybt
ond Aire AU the command erculid from Command
‘inde amd aU the script fils exsuted from ire
Gmmandk idimdow shore commen Werle space , $0 they
Com shone aU the vanable
eee OLN een, OM scucoruat clictony ane
combsn all tht tiles ame peldir
Pied bn he event dlirechimany . To nan ans 4clu
wh mak ein be tn the curund cltrechimary or on the
SMM iT tinta
MATLAB allows hun bite tube of, anthemahicn opunabion
+ Matus auitremahe ppinahin
+ Annay antthomaha operahon
eck k
aka anithemahe opinahon an same an chifppned sm Uinta
4 ol
as Array oprration ane exetlid element dey domed
Beth om ont dimenuomal and muthiclimen uimnal anay,
Te martix opurator ard Conan optrators ane diffput
Aitprunbiatd fy the pouicd()) yrnbel Hw euen , as Hat
add Hon amd aichaknachion Opinahen Ja borme {yor rabuices
amd ammo, tht opraten in same for both Cann
ie ppllnaing table gine muet dureniphon of He opialer
Speaton Banentphion
i Addthion on umanuy plus A+B odds th vabess
Akosud im variable AandB: A and & must
thowt the dome size, unless one in 0 renlar
A Acalan cam bt odded by a makuiy ob amy Mie
Substrachion an unary minus A-—8 subtracts
wht value oh B fron A+ Pand® must bout te
Dome w2e umlerss one in q Acatan A Acalan
Com bt aubbiachd bIm Cc matniy of amy
Ae
* Matrix mulhelicahion C= AAG
a Apnoy mulhplcahion AX % cis He clument by clemecd
Product ohtme annay A and B- /@
/ Sask on matnip suid divider off
noughsi4 the sane 1 B® iynilh) Manu
preecast BIA
\ Bockslane on maby lbp Mion / Up He
Aquane maby + ANG mrp V4 Ss whe
as inva 4p , exerbh it % Compdid dm &
dcbfprunk wary
n Matniy prurn X70 x ty rhe promot
oh Pp a sealon
a Mokniy transpose Al do tre Uncon dyppede
thowpost of Ae
Punehion fon Anithewaho
Punehion Duscuiphion
uplis Cay Unansy pls wncrnanrinds bey fos
Omrpunt &
plus Ca,b) Wide, Ada Card)
uminus (4) Unany minis, duveamnundls buy tes
amount
EEE Ci, b) Minus pfu «- b
fets 04.5)
Aarons mul ply | satin o% &
albes& 6970) Pabuy mulhplicahon ; uum othrebivi'de (ery b)
TH ciatele Cay b)
Poun (a,b)
MPpowwn Ca, b)
C= arb;
ds a-b
e@= afb
f> 9/b
9= o\b
ey 1-3
Bice 3);
Zam
@
fighd asnay div igon vekuun alb
Solve the aysturn oflinean ea”
x= B fonx
Amiay pow; netuun a%b
Matnis pow , vuhuun a” b,
MATLAB ollmo Gating, ho Kmds of prognrarn pe -
+ Souipty oe fun ane program felis al om entealt'on
in
yr tondle aintes of command
wide you an to baberite toguthiy - Script donat
Orb unpubl and do net rtum output . They oprale
on dale un the urrkspaes,@
fumehion : fumehion brant aloo Proprarm fier write mm
ex lerwon — Rumchion com acerbht inputs ord
rebum out — Sackennal variable ant local by tus fumehion
SLUM AUMUND opnanon fasckin putermed | a using
MRTLAB ond wenutlt toss, been beg gn shee
Command window:
Cucauhion '-
1) Progharn rusk be nile carefully booed error
2). Prognan cam nein be savech ad dtandrad freien narmt_Expeniment_No-- 02
[Object :
Basic Plotting of signals
2) To study Vonious MATLAB common
And three dimensional plots
by Write a MATLAB program to plot the
uous time and discrete time signals.
4) Steb Function
fi) Impulse Function
iii) Exponential Function
lv) Ramp Function
Vv) Sine Function.
Theory:
A) Nanious commands creating a-D blots:
ds for creating T°
following conti
The most ba-
ste and perhaps most useful command fox producing a aD
plot fs
Plot ( xvalues, yvalues, “style- option’)
Where, xvalue and yvalues ane vectors containin
| co-ordinates of points on the Jxabb and the style opt-
jon argument that specifies the colon, the Line style, and
he point-manker style. All three style options can be she.
Cified together. Thus fos two Column vectoss x and y each
of length n-
the % and
ersus 2 with a Solfd tine.
Plot (ty) — plots qv
th a dashed Line
plop (2-9, --') > Plots y versus % wi
plot (x) — plots the elements of against +here va index.
Legend:
The legend commond produces a boxed legend on a
plot, the legend commond js quit versatile, It can take
several optionad axguments. The most cemmonty used foam of
tne Command ase listed here:
il ll¥
legend Usbiing!, string2, ---)— produces legend using the ve
fo string, stings, -- Ete. oa i
legend ( Linestyen, stufngts---) —» shecifies the lines tyle of ect
bet:
legend t--> pos) a Gag the leqand outside the blot
frome if Pos=-1 and inside if
legend off a
~ deletes the legend from the plot.
es oe Once a plot fs genercted,
Myou can change cthe axes Vimits with the axis command:
axis (Lxmin xmox ymin ymax)
Example:
GxISCL-S to 2 229);
axy(-s to 2 2243 axistaxy);
Gomes loll) ayi= [2 22); axis fax ay); |
The axis command may thus be Used +o Zoom in on a bes |
Hicwlan section of the plot on +e Zoom out.
Line: |
The line {5 a low-level grabhics command used by the
Blot command +o genevate Lines.
[Linebedeta, ydate, Papamites Nome, Ponametey Vales)
Nanious commands fon erecting 3-p lots!
ATLAB provid
extensive facitities fon visudiging B-D- data, Mane ae
Basic Commands fon the 3-d blots
DNOAe Wea I) “style= option’) |
[Viet s
The viewing angle of the observer is sheci fied by
the Command
View (azimuth, elevation)Where arimuth and elevation ane angles specified Fr de big
The avtmuthal fs the tation about the 2- ois ee ae
UN ter clockwise from the negative yroxis , and the & is
fs the Vertical’ angle measured positive above the *4-P
bY 4) Step Function:
The Step function fs an {portant
Signal used fon analysis of many systems. The steb
function ts that type of elementy function which exists
Only for positive time and is zero for negative time - Ht
fs equivalent -fo apply a signal eohose amplitude oo
ddenty changes and remains constant forever aftes abpuh
cation»
Continuous —time uni} steb Function»
Steb function utty fs defined as :
1 fort %e
EYE =
© foxtio
The discrete- time unit
The continuous unit
Stef sequence utn) fs defined as:
nzo
meg oon
° fornde
fi) Iropulse Fune-Hon s i
The unit fmbulse function fs the mo-
8t widely used elementary function wed fh the analysis
of signals and Systems: The fmpulse function is defined
as too tybes:
Continuous-time Unit Imbulte function :
The continuous -4ime
unit Fmpulse funclion sit), also called Dirac detta function.\t fs deffned ax |
f Sit dt = 4
4 for t=°
fort 4°
{Discrete = fme fmpulse Function :
i ‘ The discrete- time fmbulsé
function sin), alto casted unit sample sequence » {s defined
a:
1 forn=o
Un) =
$9 vn for n tO
Hil) Exponential’ Function:
Continuous - time real _exbonential signed : ,
A combinuous - time
teok exbonential Signed bas the general fom as
a
xity= AC
Where @ and A ane neal
Discrete - time onential sequence :
The diserefe- time |
reo exponential sequince a” is defined as: |
xtn)= a for ald
Sid) =
iv Ramp. Function’ |
The continuous ~ time
unit romp function (+) fs that function which stats at
t=0 and fnerease> Nineculy with Hime and fs defined as
4 for t%e
vit) = { |
|
|
Oo forts
ris tult),Cll
[Discrefe - Mrne unt} lamb sequence vin)!
Unit ramp sequence ony fy deffned os
n for nzo
oka
vO)
VY) Sine Function:
Sinusoidal confinuous -tirne signal: ;
si : , A continuous ~ time
Inusridadl signal (nm its most genes form is given by
KI) = A Sin (cot +
where, ny
A= Amplitude
wo= Angulan frequency fo gadions
d= phase angle fo aadians
Discrete ~+ime sinusoldad sequsnce:
idol sequence is given by
xin) = A sintwnt >)
Where,
A= Amplitude
w= Ping Ulla freq vency
$= Phase angle
no x fnteger
MATLAB Program &- Grab:
Ye continuous Time unit steb function
4= -§:0.01:5;
steb= [zeros (1,500), ones (ty So1)};
subplot (3,214);
plot (ti Steb)s
xlabed (Time ¥);
YY lobes (* Amplitude’) ;
title (Unit Step Function’);
oxis(E-le 10 -0-5 1.53);
the discrete ~ time
The discrete-time sinusoTT —
Je Discrete Time Unit Steb Fun ction | sequence
e108 3) lo
Step = [zeros (110), ones (Uu))s
Subblot (Se2) 2);
Stem (n, step);
Xlabet \" piscrete Time n’);
label U* Amblitude’) ;
title [Unit Step Sequince’);
laxis({{-le }o 0 1.2]); |
fis Continuous Time Unit Impulse function
t= 1: 0.00431;
frnpulse = [reros( tr lo00), ones (111), TEPOS L 1,1000) 1;
“> Subplot (3,213) 5
blot Lt, impulse);
title’ Unit Impulse signal’):
xlabed ("Time t')s
NY label l* Amplitude’);
loxis(TA + 0 1.53);
Impulse
+. Discrete Time unit sequence
Dao
fropulse = [ Zerost 110), Ones( hit), Terosths lo) \4,
pomp [svoplot (3124)>
Btem(m im pulse) 5
Xlabet (“ discret] Time n°),
y Jaber (‘Amplitude’);
Litle U* Unit Impulse Sequence)»
laxis LE-10 Lo © adds
Ife Continuous Time Exponentiad function
4 = 010-001: S3
aay
x, = 5% exp (oft);
subplot (3, 2,5>5 plet Ct xt)s
i tet Exbonentiag Signal’);
label (‘Time t’), Ylabed (‘Amplitude’);% Discrete Time ExbonentioW Sequonce
N=ort:10,
Exponential = expiry;
Subblot (3,2, 6)5 stem[O,exponentiad) ;
Slobel (° Discrete Time n°); ylabet Amplitude’) ;
ttle ("Exponential Sequence’);
‘+ Continuows Time Unit Ramp Function
t=O! O01. Gs
‘Yamp* t 5
Subplot (312135 plot { +) amp);
label (Time t's Yiabet (“Amplitude )s
idle [Unit Ramp function’);
+ Discrete +me Unit Ramp Sequence
Nt ordiio
Yamp=n;
Subplot (3, 2,2) 5 Stem[n, ramp);
Fe \Diserete Time mn’); Yiabel lt’ Amplitude):
tel" Unit Ramp Sequence’) ;
* Continuous Time Sinusoidal Function
=~ 0-05: 0.001: 0-08,
f= 100;
a> 2;
Yt= a*¥ sin(a* pi*£* bt);
Subplot (3:213)5 plot(ti Yt) 5
Hitlel* Sinuscided Signal’),
ylobet (Time t') ¥ tabet (‘Amplitude’);
b/s Discrete Time Sinusoidal Sequence
nz 0:20.08: 53
a= 2a0;
fetes
yre Of sin (a pi* f*):
subplot (8) 14) Stem[ nid;
lable (“Discrete Time n'y, Yiabel (Amplifude')s
title "Discrete Time sinusoidal Siqnad’):i
“3
ont 3
ost *
coe
ye we ee
.
soy
uf
es
“souanbes esindiay yun ‘Teubis asindua yun
cameo : rs,
Parra ee eet ee
otetetcie se
T
li]
| i Re
0
| 3 so8
: :
44 + wat eas
q
‘eouenb™s dais UN 7 ‘uonoung dag aun bchvow,
soo roo coo 200 100 0 190 mo wo ror soo(Object: i
: Time and Amplitude Fransfoomation Lifude scat
IWite @ MATLAB program te perform aU ven signal
Ng» time ~scading and time shifting on O 4
cory :
mblitude - Scaling: e
The amplitude scaling ong ce |
uous — time signal xtty can be represented by
yey) = Ax)
luthere A fs a constant
[Time - Scaling!
Time scaling may be time expansion
ox time compression. the time scaling of a signad xy)
can be aceorplished by replacing + by ney te ab: |t
can be expressed as:
|
Tme - Shifting * |
The Hime - shifting of 0 Continuous
IsignoQ x(t) can be represented by
|
yup = x(4-T)
ATLAB Program & Grabh:
te Sinusoidal Signa’
+=-0:051 0.001: 0.05;
£ = 100;
a:
yr> Sin(2* pix fi* ty;
Subblot (3,219; plot( ti Y's
title(“Sinusoida® Signat”);Klabel (Time ts Ylabetl “Amp!
> Amplitude Scaling
HE=-0-05! 0.001: 0:08;
§ = L003
ae ;
NU= oF sinc a* pi® ¢¥ £);
Subblot( 3,2, 2):
blotlt, sys),
Kittel Amblifude Scaling Sinusoidad Signal) *
Klabe® U Time $"):
Niabe® (‘Amplitude’);
tle Sinusoidal Signa’
£= -0-0S! 0.001: 0.055
f=too;
ae
N= oF sinc a® pi*® £* 4);
Subblet = (3,23); plot | Ee YNs
title (* Sinusvidag Signe’):
klabed (‘Time +") ; ylaber L* Arab litude’) >
fle Time scaling
t= -0-65.0-001! 0.085
f=1003
azts
yi a* sin( a® pitg* ty:
subplot (3,214) ; plot LS"t, Yd)
title (Time Scaling Sinusoidal Signed’);
ylobegl® Time 4')4 Ylabeets Amplitude’,
HJo Sinusoided Signal
= -0-:0§: 0-001: 0.05’
f= Loo,
az ty
Niz ot sin (a7 pik ft);Subblot (3: 215)5 plot (4, Yds eae
Xlabel U Time 4°); Ylabeb Amplitude’);
Hs Time Shifting
t=- 0:05! 0.001: 0.05;
= Loo:
CS
Miz aFsinca® pix ety:
Subblot4 (3,246); plot (4-5), 91) 5
Ele Th ne Shif Hing Sinusoidal Signek”)s
labent “Time +’): Ylabed (* Amplitude’)Experiment No-- of @
Object:
Convolution of given signals Write o eee
Program to Obtain linean convolution of the given 21
quences
exbress, sabe ation {s a mothematicol oberation used to
No i au
ins: mpm selation between input and outbut of an
5 \t relates inbut, ourtbut and impulse resbon
Ciro. Wit system as
pa ase ee
GUD = Wi * hLt)
Where ytt) = outbut of LTI
Alt) = Fnpat of LTI
hit) = Impulse resbonse of LTT
There ane too types of convolutions:
2) Continuous Convolution
nou
Ylo= xID *¥ hit
2
yt) = f xtty hle-D at
eo
b) Discrete Convolution:
Yen) = Wen) x hE)
yen = 2 XW) bin-k)
peo
MATLAB Proqvam wabh:
= fnbut [Enter Sequences’ )5
h = input( * Entes Sequancer™?;
Nx= lengthexds |
Nb= lengihlh);
Ny= NxtNh-Ls
newy= Lx erst ls NY-Nx)1;
Inewh= Lh ters (1, Ny-Nh)]5
for =O Ny-4— @
Sum = 0;
fon kzotn
Sum = Sum +t newx (ketl)* newh (n-k ts
end
Seiya = Sum),
end
Nero. 14 Needs
Subblot (3, 11);
Stem (Nx, x);
title tt xtny’);
Qxist Tmincnxy =
pheoid:mh- a; |
Subplot (3,4, 295
Stem(h, h)s,
Aitlet hen)? 45
Axis CL min (nh) —0-S™Max(nh)
Dy = MINCDX) +t mininhd: max
Subblot (3) 1, 325
steminy. yd;
xlabet U discrete time n'):
Ylabell “amplitude’);
titlet® gens’);
axis (LT min(MY)- 0S max(ny)to.s oO Maxtyst 2);
disply);
OS Maxinx)+0.5 6 ma xO) +1) 5
tos bo maxth)+17):
%) tmax(nb):ment No-- oS ®
Object:
Calculation of transfoams using MATLAB
I) Calculate and
Signal.
bY Caleutote
Theory:
) Fourien hansform:
Rtt) can be
Plot Fouwler teansfosmn of a given
Founien transform of a function
and plot 2- teantform of a given signal
defined as
xl) aa’, Xl)
= 5
Xtey= f xtt) See dt |
ae
Xl) represents the frequency spechum ef xt+) and Is
Called the shectal density {function
tHtence, Xt) fs calded -the fourtes rans form of a sig.
Dal xck).
Joverse fourier transformation can be exbressed as
oe"
ety = F [xls]
a .
ae jet
abt) = nee dt
ee bilaterad on to sided z-transform
of a discrete ~ time signod On a gequince Ltn) js defi. |
i l 0 E
nedees xtD wen 7”
20
Where z 1s Called the Comblex variable. |then,
The one- sided 09 Unilalesa? z- transfor i
defined Oh
aed ‘
xis FE xen 7% |
Tee
Calculation:
Q), Fourie Teansfoum :
Given xy = ooh urs
ulty= ey Oe
oy fone?
+
4 Se
gota ode
=o
o a jut
xrwys fF xu eat =
=o
FP _ cat) wt)
{i *o dt
lw) =
°
xt) =
atjo
ee
atje
_ *
abt
b) Founien Transfoom'
Given .
iiecigian uin= S19e0 » few h 70
Be. fos NCO
. a i z
K(2y © 2 Lsinton vim) =F sinan 2”
Ging
a e -¢€ -—n
xID= af ) mm
fee 2 tiny?
eee)"
‘ © Ae
oe x zz &
n=o
poc|z\r7iMATLAB Progyam & Graph :
0) Fousien Transform :
einput signal xt)
T= ek (~ 2% b),* heavi side (4)5
Subblot (x;
tithe fnbut Signos’);
le fourier transfoxm
dish (“the founien transfoom of ait) 18795
X= founien cxy
X= Simplifyts
(I Frequincy response
Subplo¢ (31112)
€ zplot (abs(x));
Htle(* Magnitude response of fouries transfosm’),
subplot ( 3,1, 3)5
ezplot (atan (Limaytxy)/ Lreat(%))))
fhitle (“phase resbonse bf fouries transform’),
b)Z- Tx om!
‘TeGenexotion of 2- transform of the Sequence
Syms ‘a b Wo n;
dish (the Sequence xc) fs");
x1£ Sin ( wWO* nH)
x] = Tteans (x1), dish the B- trans form of xt4en) is’):
y= Simplify x!)
Out but +
the sequence xi¢n) {5
xL =
Sin ( nt two)
the 2- trans fowm of d1Cn) is
yic
(2% sincwo))/ (2°2- eostwoytz +4)_Expotiment 6 ®
check 9 cai. HATERS’ fregam * Pet wasnibics ang
Thessy 8-
4, X(gwor ie Ft
Kjos i nn a
4 combrige Aru Zigral X's
Pike 2 ee do | ak ID
ar
0d
pe (Ue * Ls) me
ra ys Ww db & Ombiuay Spector
SJ VS dew phase Abecum .frequen 3
Be ot Vin § lotf\eo 3
PM an) Co” Rit Hoots
ae Bin (2 Fi
ye fipcns
m= obs ly 3
P= um worap (amgte Cyd)§
Fe (02 legth Qo7d3” too) levgth (x95
Bupier (2,995 + Piet (4m) 5
Yr ( “Pes. Mogrituds” 3
eee Gas) % ,
Yloue ( Prove [egies 1 )5
pir (41 9% Bolts 5
gidons
Kebbel ( freyirncy [ael);