+ All Categories
Home > Documents > Electrical Technology and Basic Simulation Laboratory1

Electrical Technology and Basic Simulation Laboratory1

Date post: 28-Feb-2018
Category:
Upload: kishore-kumar
View: 219 times
Download: 0 times
Share this document with a friend

of 104

Transcript
  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    1/104

    RAVINDRA COLLEGE OF ENGINEERING

    FOR WOMEN

    Lab Manual

    ELECTRICAL TECHNOLOGY AND BASIC SIMULATION LABORATORY

    Vision of the Dea!t"ent

    To impart quality technical eucation an molin! electronic" an communication en!ineer" #ith

    pro$e""ional competence% ethic" an !lo&al outloo' &y &uilin! "tron! teachin! an re"earch

    en(ironment

    Mission of the Dea!t"ent#

    To train Electronics & Communication Engineering graduates to meet future globalchallenges.

    To motivate the students to take up research leading to multidisciplinary innovative

    projects.

    To produce future leaders with cohesive teamwork in electronics engineeringapplications.

    To air entrepreneurial skill amongst students for overall societal upliftment.

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    2/104

    $!o%!a" E&u'ational Ob(e'ti)es#

    The )ro!ramme Eucational o&*ecti(e" +)EO", o$ the uner !rauate pro!ramme in Electronic"

    an Communication En!ineerin! at G- )ullaiah Colle!e o$ En!ineerin! an Technolo!y%.urnool are to prepare the !rauate" to po""e"" the a&ility to

    $EO *+

    Apply the principle" o$ &a"ic en!ineerin! "cience" in per$ormin! pro$e""ional ta"'" in

    Electronic" an Communication En!ineerin! an to e(elop a#arene"" on "ocietal concern"-

    $EO *,

    Demon"trate pro&lem/"ol(in! a&ilitie" that permit to contri&ute in a (ariety o$ "i!nal proce""in!%

    e"i!n o$ circuitry an acaemic career"-

    $EO *-

    Thri(e in i(er"e% !lo&al% an multii"ciplinary en(ironment" #ith team "pirit $or "ucce""$ul

    completion an mana!ement o$ electronic pro*ect"-

    $EO *.

    )articipate in li$elon!/learnin! acti(itie" to enhance pro$e""ional an ethical e(elopment-

    $!o%!a" Out'o"es#

    Engineering Graduates will be able to:

    PO1 Engineering knowledge 'pply the knowledge of mathematics scienceengineering fundamentals and an engineering speciali(ation to the solution ofcomple) engineering problems.

    PO2 Problem Analysis *dentify formulate review research literature andanaly(e comple) engineering problems reaching substantiated conclusions using

    +rst principles of mathematics natural sciences and engineering sciences. PO3 Design/ Development o solutions Design solutions for comple)

    engineering problems and design system components or processes that meet thespeci+ed needs with appropriate consideration for the public health and safety thecultural society and environmental considerations.

    PO! "ondu#t investigations o #omple$ problems ,se research-basedknowledge and research methods including design of e)periments analysis andinterpretation of data and synthesis of the information to provide valid conclusions.

    PO% &odern tool usage Create select and apply appropriate techniuesresources modern engineering and *T tools including prediction and modelling tocomple) engineering activities with an understanding of the limitations.

    PO' ()e engineer and so#iety 'pply reasoning informed by the conte)tualknowledge to assess societal health safety legal and cultural issues and theconseuent responsibilities relevant to the professional engineering practice.

    PO* Environment and +ustainability ,nderstand the impact of theprofessional engineering solutions in societal and environmental conte)ts anddemonstrate the knowledge of and need for sustainable development.

    PO, Et)i#s 'pply ethical principles and commit to professional ethics and

    responsibilities and norms of the engineering practice.

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    3/104

    PO- .ndividual and team work /unction e0ectively as an individual and as a

    member or leader in diverse teams and in multidisciplinary settings.

    PO1 "ommuni#ation Communicate e0ectively on comple) engineeringactivities with the engineering community and with society at large such as beingable to comprehend and write e0ective reports and design documentation makee0ective presentations and give and receive clear instructions.

    PO11 Pro0e#t management and nan#e Demonstrate knowledge and

    understanding of the engineering and management principles and apply these toone1s own work as a member and leader in a team to manage projects and inmultidisciplinary environments.

    PO12 ielong learning !ecogni(e the need for and have the preparation andability to engage in independent and life-long learning in the broadest conte)t oftechnological change.

    $!o%!a" Se'ifi' Out'o"es /$SO0s1

    Engineering 2raduates will be able to

    $SO +# Apply the principle" o$ Electronic"% Analo! an Di!ital 0y"tem" in the potential $iel"o$ Con"umer Electronic"% Meical an De$ence-

    $SO ,# Get pro$oun 'no#le!e in Communication"% 0i!nal an Ima!e )roce""in! alon! #ith

    pro!rammin! 1 "imulation tool" $or re"earch a(ancement-

    $SO -# Apply the pro!rammin! concept" o$ VL0I% Microproce""or"% Microcontroller"% an

    Em&ee 0y"tem" in Real Time application"-

    $SO .# Communicate e$$ecti(ely in (er&al% #ritten $orm an !roup relate acti(itie" #ith

    ethical an "ocial re"pon"i&ility-

    Cou!se Out'o"es#

    Analy2e the !eneration Variou" 0i!nal" an 0equence" in MATLA3% incluin! the operation"

    on 0i!nal" an 0equence"- Determine the Con(olution an Correlation &et#een 0i!nal" an "equence"-

    Veri$ication o$ Linearity an Time In(ariance )ropertie" o$ a !i(en Continuou"4Di"crete

    0y"tem-

    Analy2e the Fourier Tran"$orm o$ a !i(en "i!nal an plottin! it" ma!nitue an pha"e "pectrum-

    5ner"tan the Wa(e$orm 0ynthe"i" u"in! Laplace Tran"$orm-

    Veri$ication o$ Weiner/.hinchine Relation" an 0amplin! Theorem-

    2A3AHARLAL NEHRU TECHNOLOGICAL UNIVERSITY ANANTA$UR

    II B4Te'h4 I*Se" /ECE1 L C

    . ,

    /+5A6,-671 ELECTRICAL TECHNOLOGY AND BASIC SIMULATION LABORATORY

    $ART*A

    6- Ma!neti2ation Characteri"tic" o$ D-C-0hunt Generator- Determination o$ Critical Fiel

    Re"i"tance-

    7- 0#in&urne8" Te"t on DC 0hunt Machine +)reetermination o$ E$$iciency o$ a Gi(en DC

    0hunt Machine Wor'in! a" Motor an Generator,-

    9- 3ra'e Te"t on DC 0hunt Motor- Determination o$ )er$ormance Characteri"tic"-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    4/104

    :- OC 1 0C Te"t" on 0in!le/)ha"e Tran"$ormer +)reetermination o$ E$$iciency an

    Re!ulation at Gi(en )o#er Factor" an Determination o$ Equi(alent Circuit,-

    ;- Loa Te"t on 0in!le )ha"e Tran"$ormer-

    $ART*BList of E8e!i"ents#6- Generation o$ Variou" "i!nal" an 0equence" +)erioic an Aperioic,% 0uch a" 5nit

    Impul"e% 5nit 0tep% 0quare% 0a# Tooth% Trian!ular% 0inu"oial% Ramp% 0inc-

    7- Operation" on 0i!nal" an 0equence" "uch a" Aition% Multiplication% 0calin!% 0hi$tin!%

    Folin!% Computation o$ Ener!y an A(era!e )o#er-

    9- Con(olution &et#een 0i!nal" an 0equence"-

    :- Autocorrelation an Cro"" correlation &et#een 0i!nal" an 0equence"-;- Veri$ication o$ Linearity an Time In(ariance )ropertie" o$ a Gi(en Continuou" 4

    Di"crete 0y"tem-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    5/104

    $ART*A

    Ele't!i'al Te'hnolo%9 Labo!ato!9

    Cou!se Out'o"es

    Determine the ma!neti2ation characteri"tic" o$ DC "hunt !enerator alon! #ith etermination

    o$ Critical Fiel Re"i"tance )reetermine the e$$iciency o$ DC "hunt machine #or'in! a" motor an !enerator alon!

    #ith conuction o$ &ra'e te"t on DC "hunt motor )er$orm the OC an 0C te"t" on "in!le pha"e tran"$ormer alon! #ith the conuction o$ loa

    te"t on the tran"$ormer

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    6/104

    /+5A6,-671 ELECTRICAL TECHNOLOGY AND BASIC SIMULATION LABORATORY

    $ART*A

    6- Ma!neti2ation Characteri"tic" o$ D-C-0hunt Generator- Determination o$ Critical Fiel

    Re"i"tance-

    7- 0#in&urne8" Te"t on DC 0hunt Machine +)reetermination o$ E$$iciency o$ a Gi(en DC

    0hunt Machine Wor'in! a" Motor an Generator,-

    9- 3ra'e Te"t on DC 0hunt Motor- Determination o$ )er$ormance Characteri"tic"-

    :- OC 1 0C Te"t" on 0in!le/)ha"e Tran"$ormer +)reetermination o$ E$$iciency an

    Re!ulation at Gi(en )o#er Factor" an Determination o$ Equi(alent Circuit,-

    ;- Loa Te"t on 0in!le )ha"e Tran"$ormer-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    7/104

    3. 4'2$ET*5'T*6$ C7'!'CTE!*8T*C8 6/ DC. 87,$T 2E$E!'T6!

    Ai"#*

    To etermine the ma!neti2ation characteri"tic +O-C-C, o$ the !i(en DC "hunt Generator

    an to $in out the critical $iel re"i"tance an critical "pee-Aa!atus Re;ui!e*

    6-Voltmeter + / 9V,MC 7NO

    7- Ammeter + B 7-;A, MC 6NO

    9- Rheo"tat 9;% 6-7A 7NO

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    8/104

    :- Tachometer +/6%,rpm 6NO

    Na"e late &etails#*

    Ci!'uit &ia%!a"#*

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    9/104

    $!o'e&u!e#

    6- Ma'e the connection" a" per the circuit ia!ram-

    ,4 Initiall9 - Decrea"e the $iel current in "tep" an note o#n the open circuit (olta!e"

    @-- 0#itch o$$ the "upply &y openin! the D)0T "#itch-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    10/104

    Tabula! 'olu"n#*

    Mo&el %!ah#*

    Dept of ECE !CE" #$%

    3hile in'!easin% If 3hile &e'!easin% If

    If /a"1 E6/)olts1 Ef/)olts1 If /a"1 E6 /)olts1 Ef/)olts1

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    11/104

    Sa"le Cal'ulations#*

    From the !raph"

    The critical $iel re"i"tance "lope o$ the line

    Rc Eo 4 I$ ohm"

    NCN+AC4A3,

    Where NC critical "pee

    N 0pee at !i(en O-C-C

    Result# *

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    12/104

    2. SWINBURNES TEST ON A DC SHUNT MACHINE

    Ai"/

    To conuct 0#in&urne8" te"t on a !i(en c "hunt machine an to preetermine

    6-It8" e$$iciency #hen actin! a" a !enerator

    7-It8" e$$iciency #hen actin! a" a motor

    Aa!atus Re;ui!e&/

    Voltmeter +/9V, MC 6NO

    Ammeter +/7A, MC 7NO

    Rheo"tat 9; % 6-7A 6NO

    "#itch 0)0T 6NO

    Tachometer +/6%,rpm 6NO

    Na"e late &etails#*

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    13/104

    Ci!'uit &ia%!a"/

    +a, No/Loa Te"t/

    b1 To fin& Ra#*

    $!o'e&u!e/

    6- Ma'e the connection" a" per the circuit ia!ram-

    ,4 Initiall9

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    14/104

    ;-- Open the 0)0T "#itch acro"" the ammeter an note o#n the (oltmeter an ammeter reain!"-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    15/104

    #cH Ia7Ra +i4p,,6

    Mo&el %!ah#*Dra# the !raph &et#een output po#er on ?/a?i" an e$$iciency on y/a?i" a" "ho#n

    &elo#-

    CALCULATIONS#

    Con"tant lo""e" #c VI B Ia7 Ra

    Con"tant lo""e" #c V + IaH I$ ,BIa7 Ra

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    16/104

    E4#ien#y w)en running as a &otor:

    .a 5 . 6 .

    Input V IL

    Armature cu lo"" Ia7 Ra

    Con"tant lo""e" #c

    Total lo""e" Ia7 RaH #c

    Output input / lo""e" ++o4p,4+i4p,,6

    Effi'ien'9 =hen !unnin% as a Gene!ato!

    Ia IL HI$

    Output V IL

    Armature cu lo"" Ia7 Ra

    Con"tant lo""e" #c

    Total lo""e" Ia7 RaH #c

    Input Output H lo""e"

    ++o4p,4+i4p,,6

    Result#*

    -4 BRA?E TEST ON DC SHUNT MOTOR

    Ai"/

    To conuct 3ra'e te"t on c "hunt motor an to ra# the per$ormance cur(e" o$ the motor-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    17/104

    Aa!atus Re;ui!e&/

    6- Ammeter +/7A, MC 6NO

    7- Voltmeter +/9V, MC 6NO

    9- Rheo"tat 9;9% 6-=A 6NO

    :- Tachometer +/6%, R)M 6NO

    Na"elate &etails#*

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    18/104

    Ci!'uit &ia%!a"#*

    $!o'e&u!e#*

    6- Ma'e the connection" a" per the circuit ia!ram-

    ,4 Initiall9

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    19/104

    Mo&el %!ah#*Dra# the !raph &et#een output po#er on ?/a?i" an "pee % torque% e$$iciency 1

    loa current are on y/a?i" a" "ho#n &elo#-

    Tabula! 'olu"ns#*

    Volta!e

    +(olt",

    Current

    +amp,

    0pee

    +rpm,

    i4pVI

    +#att",

    06

    .!

    07

    .!

    Torque

    +0607, r @->6

    +N/m,

    o4p

    7JNT4

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    20/104

    Result#*

    .4 O4C AND S4C TESTS ON +*$H TRANS@ORMER

    Aim:

    +4 To etermine the equi(alent circuit &y conuctin! open circuit an "hort circuit te"t"-

    ,4 To preetermine the e$$iciency an re!ulation o$ "in!le pha"e tran"$ormer an ra# output

    (er"u" e$$iciency !raph

    Apparatus Required:

    6- 0in!le )ha"e Tran"$ormer- 7 .VA % 79466; V -

    7- Autotran"$ormer 79 V4 +/7=, V-

    9- Ammeter" /7 A MI 6No

    /6A MI 6No

    :- Voltmeter" /9 VMI 6No

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    21/104

    +/9, V/MI 6No

    ;- Wattmeter B 6;V% 7A L)F 6No

    =;V% 6A% 5)F 6No

    Name plate details:

    Circuit diagram:

    Open circuit test:

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    22/104

    Short circuit test :

    Procedure#

    i1 Open circuit test:

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    23/104

    6- Ma'e the connection" a" per the circuit ia!ram-

    7- Variac "houl &e 'ept in 2ero po"ition &e$ore "#itchin! ON the "upply-

    9- 3y (aryin! auto tran"$ormer% apply rate (olta!e to the lo# (olta!e #inin! +LV,-

    :- Note o#n the reain!" o$ (oltmeter% ammeter 1 #attmeter-

    ;- 3rin! (ariac +auto/tran"$ormer, to 2ero po"ition-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    24/104

    To calculate regulation at full load:

    Mo&el %!ah#

    Dept of ECE !CE" #$%

    LOAD COS O$

    V,I, COS

    Cu

    losses

    /$C1

    I!on

    losses

    /$i1

    Total losses

    $t $i $C

    I$

    O$Losses

    F /o4i1+66

    Cos I,R6, Cos I, 6,Sin

    Re%ulation

    La%

    Lea&

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    25/104

    SAMPL CALC!LAT"ONS:

    @!o" OC test

    Iron lo""e" W VICo"

    Wor'in! component o$ no loa current IW ICo"

    Ma!neti"in! component o$ no loa current I I 0in

    R V4IW ohm"

    V4Iohm"

    @!o" SC test#

    Copper lo""e" W0C I0C7R6 #att"

    Equi(alent re"i"tance re$erre to primary #inin! R6 W0C 4 I0C7 ohm"

    Equi(alent impeance re$erre to primary #inin! 6 V0C 4 I0C ohm"

    Equi(alent reactance re$erre to primary #inin! 6 +67

    /R6

    7, ohm"

    Equi(alent re"i"tance re$erre to "econary #inin! R7 R6 '7 ohm"

    Where ' V74V6

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    26/104

    Equi(alent reactance re$erre to "econary #inin! 7 6 '7 ohm"

    Re!ulation +I7R7 Co"H I7 70in, 6 +For la!!in!,

    V6

    + I7R7 Co"/ I7 70in, 6 +For leain!,

    V6

    Equivalent circuit:-

    Result

    Equi(alent circuitan e$$iciency o$ a "in!le pha"e tran"$ormerare etermine an output ("-

    e$$iciency !raph i" plotte &y conuctin! oc an "c te"t" on a !i(en "in!le pha"e tran"$ormer

    Wo Gi(e" the iron lo"" #att"-

    W"c Gi(e" copper lo"" at $ull loa #att"-

    54 LOAD TEST ON +*$HASE TRANS@ORMER

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    27/104

    Ai"#

    To etermine the e$$iciency an re!ulation o$ a "in!le pha"e tran"$ormer &y conuctin! loa

    te"t-

    A$$ARATUS#

    NAME $LATE DETAILS#

    $ROCEDURE#

    6, Connect the circuit a" "ho#n in the circuit ia!ram-

    7, Rate (olta!e i" applie to the tran"$ormer- 9, All the reain!" o$ (oltmeter"% ammeter" 1 #attmeter8" are note-

    :, Loa i" increa"e in "tep" &y maintainin! V6con"tant% till the "econary

    rate current i" o&taine-

    Ci!'uit Dia%!a"#

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    28/104

    OBSERVATIONS#

    LOAD TEST:

    V1 V2 I1 I2 InputPower

    OutputPower

    %Regulation

    MODEL GRAPHS:

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    29/104

    RESULT#

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    30/104

    $ART*B

    BASIC SIMULATION LABORATORY

    List of E8e!i"ents

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    31/104

    6- Generation o$ Variou" "i!nal" an 0equence" +)erioic an Aperioic,% 0uch a" 5nit

    Impul"e% 5nit 0tep% 0quare% 0a# Tooth% Trian!ular% 0inu"oial% Ramp% 0inc-

    7- Operation" on 0i!nal" an 0equence" "uch a" Aition% Multiplication% 0calin!% 0hi$tin!%

    Folin!% Computation o$ Ener!y an A(era!e )o#er-

    9- Con(olution &et#een 0i!nal" an 0equence"-

    :- Autocorrelation an Cro"" correlation &et#een 0i!nal" an 0equence"-

    ;- Veri$ication o$ Linearity an Time In(ariance )ropertie" o$ a Gi(en Continuou" 4

    Di"crete 0y"tem-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    32/104

    Si"ulationi" the imitation o$ the operation o$ a real/#orl proce"" or "y"tem o(er time-

    The act o$ "imulatin! "omethin! $ir"t require" that a moel &e e(elopeP thi" moel repre"ent" the

    'ey characteri"tic" or &eha(ior"4$unction" o$ the "electe phy"ical or a&"tract "y"tem or proce""- The

    moel repre"ent" the "y"tem it"el$% #herea" the "imulation repre"ent" the operation o$ the "y"tem

    o(er time-

    0imulation i" u"e in many conte?t"% "uch a" "imulation o$technolo!y$or per$ormance

    optimi2ation% "a$ety en!ineerin!% te"tin!% trainin!% eucation% an (ieo !ame"- O$ten% computer

    e?periment"are u"e to "tuy "imulation moel"- 0imulation i" al"o u"e #ith "cienti$ic

    moelin!o$ natural "y"tem" or human "y"tem" to !ain in"i!ht into their $unctionin!- 0imulation can

    &e u"e to "ho# the e(entual real e$$ect" o$ alternati(e conition" an cour"e" o$ action- 0imulation

    i" al"o u"e #hen the real "y"tem cannot &e en!a!e% &ecau"e it may not &e acce""i&le% or it may &e

    an!erou" or unaccepta&le to en!a!e% or it i" &ein! e"i!ne &ut not yet &uilt% or it may "imply not

    e?i"t-

    HISTORY OVERVIE3 O@ MATLAB#

    MATLA3 $ull $orm i" Mat!i8 labo!ato!9J

    MATLAB+"atri? laboratory, i" a numerical computin!en(ironment an $ourth/!eneration

    pro!rammin! lan!ua!e-

    In(ente in the year 6@= &y Cle(e Moler% an #a" moi$ie &y Qac' little an 0te(e

    &an!ert-

    Math #or'" #a" "tarte in 6@>:-

    MATLA3 i" ori!inally e"i!ne to pro(ie "tuent8" acce"" to LIN)AC. 1 EI0)AC.

    #ithout learnin! FORTRAN-

    MATLA3 i" numerical computin! en(ironment an pro!rammin! lan!ua!e% u"e $or

    applie mathematic"-

    MATLA3 #a" $ir"t aopte &y control e"i!n en!ineer" an "prea to many other omain"P

    it i" particularly u"e in eucation $iel an Inu"try40cienti$ic4Military application"-

    MATLA3 &e!an #ith > $unction"% no# it ha" o(er > $unction"P MATLA3 en!ineer"

    incorporate the LA)AC.% 3LA0 li&rarie"% em&ein! the "tate o$ the art "o$t#are $or

    matri? computation-

    Dept of ECE !CE" #$%

    http://en.wikipedia.org/wiki/Functionhttp://en.wikipedia.org/wiki/Technologyhttp://en.wikipedia.org/wiki/Technologyhttp://en.wikipedia.org/wiki/Safety_engineeringhttp://en.wikipedia.org/wiki/Experimenthttp://en.wikipedia.org/wiki/Traininghttp://en.wikipedia.org/wiki/Educationhttp://en.wikipedia.org/wiki/Video_gamehttp://en.wikipedia.org/wiki/Computer_experimenthttp://en.wikipedia.org/wiki/Computer_experimenthttp://en.wikipedia.org/wiki/Scientific_modellinghttp://en.wikipedia.org/wiki/Scientific_modellinghttp://en.wikipedia.org/wiki/Numerical_analysishttp://en.wikipedia.org/wiki/Fourth-generation_programming_languagehttp://en.wikipedia.org/wiki/Fourth-generation_programming_languagehttp://en.wikipedia.org/wiki/Functionhttp://en.wikipedia.org/wiki/Technologyhttp://en.wikipedia.org/wiki/Safety_engineeringhttp://en.wikipedia.org/wiki/Experimenthttp://en.wikipedia.org/wiki/Traininghttp://en.wikipedia.org/wiki/Educationhttp://en.wikipedia.org/wiki/Video_gamehttp://en.wikipedia.org/wiki/Computer_experimenthttp://en.wikipedia.org/wiki/Computer_experimenthttp://en.wikipedia.org/wiki/Scientific_modellinghttp://en.wikipedia.org/wiki/Scientific_modellinghttp://en.wikipedia.org/wiki/Numerical_analysishttp://en.wikipedia.org/wiki/Fourth-generation_programming_languagehttp://en.wikipedia.org/wiki/Fourth-generation_programming_language
  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    33/104

    MATLA3 toay ha" million" o$ u"er" an a "tanar tool in &oth pro$e""ional an acaemic

    u"e-

    MATLA3 ha" in&uilt TOOL3OE0 + Control 0y"tem"% Communication"% Neural

    Net#or'"% Ima!e/proce""in!% 0i!nal )roce""in!% 3ioin$ormatic"etc-%,

    MATLA3 ha" a G5I &a"e "imulation tool +0IM5LIN.,-

    MATLA3 i" a hi!h per$ormance lan!ua!e $or technical computin!% it inte!rate"

    computation% (i"uali2ation an pro!rammin! in an ea"y to u"e en(ironment #here pro&lem"

    an "olution" are e?pre""e in $amiliar mathematical notation-

    MATLA3 i" u"e in Math an Computation% Al!orithm e(elopment% Data acqui"ition%

    Moelin!% 0imulation % )rototypin!% Data analy"i" e?ploration (i"uali2ation% 0cienti$ic

    an en!ineerin! !raphic"% Application e(elopment-

    MATLA3 i" interacti(e "y"tem #ho"e &a"ic ata element i" an array that oe" not require

    imen"ionin!- Thi" allo#" "ol(in! many technical computin! pro&lem"% e"pecially tho"e

    #ith matri? an (ector $ormulation"% in a $raction o$ the time it #oul ta'e to #rite a

    pro!ram in a "calar non/interacti(e lan!ua!e "uch a" C or Fortran-

    MATLA3 "y"tem i" technically calle an interpreter% #hich mean" that each "tatement

    pre"ente to the comman line i" tran"late into lan!ua!e the computer uner"tan &etter

    an then immeiately carrie out-

    MATLA3 i" ca"e/"en"iti(e% #hich mean" that a H 3 i" not the "ame a" a H &- The MATLA3

    prompt +S, in comman #ino# i" #here the comman" are entere-

    Mat la& i" capa&le to interpret an e(aluate the numerical matrice" e?pre""ion" a"

    a, Directly $rom 'ey&oar in comman #ino#

    &, Or on $orm o$ "equence" o$ e?pre""ion" #hich are "a(e in a te?t $ile% calle m/$ile an e?ecute

    it in comman #ino#-

    c, Or more rarely on $orm &inary $ile #hich i" calle me?/$ile" or $ile o$ e?ten"ion -me? !enerate

    $rom a C compiler

    $!o'e&u!e to oen MATLAB#6- Open the MATLA3% &y ou&le clic'in! the icon on e"'top-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    34/104

    7- 3elo# #ino# i" launche #ith e$ault layout-

    9- The De$ault Layout con"i"t" o$ three part"- They are

    A, Comman #ino#%

    3, Comman hi"tory%

    C, Current irectory4Wor'"pace% re"p- a" "ho#n &elo#

    a, Comman #ino# Kere #e enter the comman" at the prompt "ym&ol

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    35/104

    &, Comman hi"tory Thi" #ino# repre"ent" pre(iou"ly entere comman" at comman prompt

    c, Current irectory4Wor'"pace

    The Current irectory #ino# i"playe the li"t o$ all the $ile" an $oler" uner the current

    irectory% #hich happen" to &e the #or'8 "u&/irectory% &y e$ault% uner the MATLA3 root

    irectory- 0ince the MATLA38 irectory #ill normally &e in the har i"' C 4 in your "y"tem%

    #here all the application "o$t#are pac'a!e" are "tore% you "houl ne(er u"e the e$ault irectory

    $or "a(in! your MATLA3 File"-

    Wor'"pace repre"ent" all the (aria&le" that are eclare in Comman Wino#-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    36/104

    VARIA3LE0 A (aria&le i" a name that i" a""i!ne to a (alue "tore in the computer8" memory-

    The (aria&le name" in MATLA3 mu"t &e!in #ith a letter% an they may &e $ollo#e &y any

    com&ination o$ letter"% i!it"% an uner"core"-

    E)RE00ION0 AND 0TATEMENT0 An e?pre""ion may con"i"t o$ num&er"% (aria&le name" an

    "ome pre/e$ine $unction" "uch a" "in% co"% lo! etc-% arithmetic operator" "uch a" H%/%4 etc-%

    relational operator" "uch a" U% etc-% an "ome "pecial character" "uch a" "pace% + "emicolon% etc-%

    E(aluation o$ the e?pre""ion prouce" a matri?-

    MATLAB has 6 relational operators to a!e coparisons "et#een varia"les. These are

    # is less than

    #$ is less than or equal to

    % is greater than

    %$ is greater than or equal to

    $$ is equal to

    &$ is not equal toT9i'al 'o""an&s#

    6- #ho"7- #ho

    9- clear

    :- quit;- "a(e $ilename B $ilename-mat

    - help

    Built in @un'tions#'( Scalar )unctions:

    Certain MATLA3 $unction" are e""entially u"e on "calar"% &ut operate element/#i"e #hen applie

    to a matri? +or (ector,- They are "ummari2e &elo#-

    6- "in / tri!onometric "ine7- co" / tri!onometric co"ine

    9- tan / tri!onometric tan!ent

    :- a"in / tri!onometric in(er"e "ine +arc"ine,;- aco" / tri!onometric in(er"e co"ine +arcco"ine,

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    37/104

    *( +ector )unctions:

    Other MATLA3 $unction" operate e""entially on (ector" returnin! a "calar (alue- 0ome o$ the"e

    $unction" are !i(en &elo#-6- ma?/ lar!e"t component !et the ro# in #hich the ma?imum element lie"

    7- min /"malle"t component

    9- len!th /len!th o$ a (ector:- "ort /"ort in a"cenin! orer

    ;- "um/ "um o$ element"

    - norm/ norm o$ matri? +6/norm% 7/norm% Y /norm,@- con /conition num&er in the 7/norm

    6- lu /L5 $actori2ation

    66- qr /ZR $actori2ation67- chol/ Chole"'y ecompo"ition

    69- "( /"in!ular (alue ecompo"ition

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    38/104

    VERSIONS O@ MATLAB

    Release history

    Ve!sionRelease

    na"eNu"be! Bun&le& 2VM Yea! Release Date Notes

    MATLA3

    6-6@>:

    MATLA3 7 6@>=

    MATLA3

    9-;6@@

    Ran onM0/DO0&ut require at lea"t

    a9> 6@@< Decem&er% 6@@< 5ni$ie relea"e" acro"" all plat$orm"-

    MATLA3

    ;-6

    Volume @ 6@@= May% 6@@=

    Dept of ECE !CE" #$%

    http://en.wikipedia.org/wiki/MS-DOShttp://en.wikipedia.org/wiki/MS-DOShttp://en.wikipedia.org/wiki/MS-DOShttp://en.wikipedia.org/wiki/Intel_80386http://en.wikipedia.org/wiki/Intel_80386http://en.wikipedia.org/wiki/Intel_80386http://en.wikipedia.org/wiki/X87#80387http://en.wikipedia.org/wiki/X87#80387http://en.wikipedia.org/wiki/Windows_3.1xhttp://en.wikipedia.org/wiki/Windows_3.1xhttp://en.wikipedia.org/wiki/Windows_3.1xhttp://en.wikipedia.org/wiki/Math_coprocessorhttp://en.wikipedia.org/wiki/Math_coprocessorhttp://en.wikipedia.org/wiki/MS-DOShttp://en.wikipedia.org/wiki/Intel_80386http://en.wikipedia.org/wiki/X87#80387http://en.wikipedia.org/wiki/Windows_3.1xhttp://en.wikipedia.org/wiki/Math_coprocessor
  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    39/104

    MATLA3

    ;-6-6R@-6

    MATLA3;-7

    R6

    6@@>

    March% 6@@>

    MATLA3

    ;-7-6R6-6

    MATLA3

    ;-9R66

    6@@@

    Qanuary% 6@@@

    MATLA3

    ;-9-6R66-6 No(em&er% 6@@@

    MATLA3

    7 No(em&er% 7Fir"t relea"e #ith &unle Qa(a Virtual

    Machine +QVM,-

    MATLA3

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    40/104

    MATLA3

    =--6R6:0)6 Octo&er% 7:

    MATLA3=--:

    R6:0)7 6-;-

    7;

    March =% 7;

    MATLA3

    =-6R6:0)9 6-;- 0eptem&er 6% 7;

    MATLA3

    =-7R7

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    41/104

    MATLA3

    =-@-6R7@&0)6 6-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    42/104

    E$ERIMENT*6+

    TITLE# GENERATION O@ VARIOUS SIGNALS SEKUENCES

    AIM# +A,- To !enerate (ariou" "i!nal" "uch a" 5nit impul"e% 5nit "tep% 0quare% 0a# tooth%

    Trian!ular% 0inu"oial% Ramp% 0inc Function- +3,- To !enerate (ariou" "equence" "uch a" 5nit impul"e% 5nit "tep% 0quare% 0a# tooth%

    Trian!ular% 0inu"oial% Ramp% 0inc Function-

    A$$ARATUS# Computer loae #ith Wino#" ) MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-

    7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor

    :- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey

    ;- Clic' on Run 3utton )re"ent on the Eitor #ino# or )re"" F; .ey;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    43/104

    ?7 P

    ? ?6-+t,H?7-+tU,P !enerate unit ramp "i!nal

    $i!ure+9,Pplot+t%?,P plot the !enerate ramp "i!nal

    ?la&el+\t\,P yla&el+\?+t,\,P title+\ Ramp 0i!nal\,P

    **********************!e'tan%ula! ulse************

    t6/6-66

    a=rectpul"+t646,

    $i!ure+:,%plot+t6%a=,% !ri on%a?i"+X/6 6 /7 7,

    ?la&el+\time\,

    yla&el+\ma!nitue\,

    title+\rectan!ular pul"e\,

    ******************** t!ian%ula! ulse***************t7/6-66

    a>tripul"+t7,$i!ure+;,%plot+t7%a>,% !ri on

    title+\trian!ular pul"e\,

    ?la&el+\time\,yla&el+\ma!nitue\,

    *************** Sin' Si%nal**********************

    ? "inc+t,P !enerate "inc "i!nal

    $i!ure+

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    44/104

    T7P

    ?lin"pace+%;T%6,P

    y6min+-;%mo+?%T,4T,Py7min+-;%6/mo+?%T,4T,P

    $i!ure+6,%plot+?%y6Hy7,%!ri on

    ?la&el+\time\,yla&el+\ma!nitue\,

    title+\perioic trian!le #a(e\,

    OUT$UT#

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    45/104

    RESULT# In thi" e?periment (ariou" "i!nal" "uch a" 5nit impul"e% 5nit "tep% 0quare% 0a# tooth%Trian!ular% 0inu"oial% Ramp% 0inc/$unction% u"in! MATLA3 i" one-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    46/104

    /B1 $ROGRAM#

    t=-20: 1:20

    %--------------------Unit Impulse---------------------%

    x=[zeros(1,20), 1,zeros(1,20)] %generate Unit Impulse Signal

    igure(1), stem(t,x)! % plot t"e generate# Unit Impulse Signal

    xla$el(t)! &la$el(x(t))! title(Unit impulse Signal)!

    %------------------ Unit Step signal------------------%

    &=[zeros(1,20), 1,ones(1,20)]

    %&=[zeros(1,20),ones(20,1)] %generate Unit Step Signal

    igure(2)! stem(t,&)! %'lot t"e generate# unit step signal

    xla$el(t)! &la$el(x(t))! title(Unit Step Signal)!

    %---------------------- amp Signal------------------%

    x1 = t!

    x2 = 0!

    x = x1*(t+=0)x2*(t0)! %generate unit ramp signal

    igure(.)!stem(t,x)! % plot t"e generate# ramp signal

    xla$el(t)! &la$el(x(t))! title( amp Signal)!

    %----------------------re/tangular pulse------------%

    t1=-10:01:10

    a=re/tpuls(t110)

    igure(),stem(t1,a), gri# on,axis([-10 10 -2 2])

    xla$el(time)

    &la$el(magnitu#e)

    title(re/tangular pulse)

    %-------------------- triangular pulse---------------%

    t2=-10:01:10

    a3=tripuls(t2)

    igure(4),stem(t2,a3), gri# on

    title(triangular pulse)

    xla$el(time)

    &la$el(magnitu#e)

    %--------------- Sin/ Signal----------------------%

    x = linspa/e(-4,4)!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    47/104

    & = sin/(x)!

    igure(5)!stem(x,&)

    xla$el(time)!

    &la$el(amplitu#e)!

    title(sin/un/tion)!

    %-----------------Sinusoi#al Signal----------------%

    6 = 20! %#e/lare time perio#

    7 = 16! %/ompute re8uen/&

    x = sin(2*pi*7*t)! %generate sinusoi#al signal

    igure()!stem(t,x)! % plot t"e generate# sinusoi#al signal

    xla$el(t)! &la$el(x(t))! title(sinusoi#al Signal)!

    %---------------- Sa9toot" signal-----------------%

    s = 1000!

    t = 0:1s:14!

    x = sa9toot"(2*pi*40*t)! %generate sa9toot" signal

    igure(3)!stem(t,x)! axis([0 02 -1 1])! %plot t"e generate# sa9toot" signal

    xla$el(t)! &la$el(x(t))! title(sa9toot" Signal)!

    %----------------- s8uare signal---------------------%

    t=(0:001:10)!

    s89a;e=s8uare(*pi*t)! %generate s8uare signal

    igure(

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    48/104

    Output:

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    49/104

    RESULT# In thi" e?periment (ariou" "equence" "uch a" 5nit impul"e% 5nit "tep% 0quare% 0a#tooth% Trian!ular% 0inu"oial% Ramp% 0inc/$unction% u"in! MATLA3 i" one-

    A$$LICATIONS#

    The "a#tooth an "quare #a(e" are the mo"t common "tartin! point" u"e to create "oun"

    #ith "u&tracti(e analo! an (irtual analo! mu"ic "ynthe"i2er"4 The "a#tooth #a(e i" the $orm o$ the(ertical an hori2ontal e$lection "i!nal" u"e to !enerate a ra"ter on CRT/&a"e tele(i"ion or

    monitor "creen"- O"cillo"cope" al"o u"e a "a#tooth #a(e $or their hori2ontal e$lection% thou!h they

    typically u"e electro"tatic e$lection-On the #a(e\" ]ramp]% the ma!netic $iel prouce &y thee$lection yo'e ra!" the electron &eam acro"" the $ace o$ the CRT% creatin! a "can line-

    On the #a(e\" ]cli$$]% the ma!netic $iel "uenly collap"e"% cau"in! the electron &eam to

    return to it" re"tin! po"ition a" quic'ly a" po""i&le- The (olta!e applie to the e$lection yo'e i"a*u"te &y (ariou" mean" +tran"$ormer"% capacitor"% center/tappe #inin!", "o that the hal$/#ay

    (olta!e on the "a#tooth\" cli$$ i" at the 2ero mar'% meanin! that a ne!ati(e (olta!e #ill cau"e

    e$lection in one irection% an a po"iti(e (olta!e e$lection in the otherP thu"% a center/mountee$lection yo'e can u"e the #hole "creen area to epict a trace- Frequency i" 6;-=9: 'K2 on NT0C%

    6;-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    50/104

    E$ERIMENT*6,

    TITLE# O$ERATIONS ON SIGNALS SEKUENCES COM$UTATION O@ ENERGY

    AVERAGE $O3ER

    AIM# +A, To per$orm (ariou" operation" on "i!nal" "uch a" aition% multiplication% "u&traction%

    time/"hi$tin!% $olin! on "i!nal" an compute ener!y an po#er o$ "i!nal"- +3, To per$orm (ariou" operation" on "equence" "uch a" aition% multiplication% "u&traction%

    time/"hi$tin!% $olin! on "i!nal" an compute ener!y an po#er o$ "i!nal"

    A$$ARATUS# Computer loae #ith Wino#" )

    MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-

    7- Open the Matla& Eitor &y u"in! File Ta& ///

    Ne#///

    M/File on the Menu-9- Write the pro!ram in Matla& Eitor

    :- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey

    ;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    51/104

    title+\7 K2 "ine #a(e\,

    yla&el+\Amplitue\,

    plot the "umme "ine #a(e" in the &ottom panel

    "u&plot+:%6%9, Pplot+t% "6H"7,

    title+\0umme "ine #a(e"\,

    yla&el+\Amplitue\,

    ?la&el+\Time +",\,

    ?mult"6-"7P

    "u&plot+:%6%:,Pplot+?mult,P

    title+\multiplication\,P

    yla&el+\Amplitue\,

    ?la&el+\Time +",\,

    Amplitue "calin!

    t X-66P inepenent +time, (aria&le

    A >P amplitue

    $6 7P create a 7 K2 "ine #a(e la"tin! 6 "ec

    "6 A"in+7pi$6t,P

    "u&plot+9%6%6,

    plot+"6,P

    ?la&el+\t\,P

    yla&el+\amplitue\,P

    title+\input "i!nal\,P

    "77"6P

    "u&plot+9%6%7,

    plot+"7,P

    ?la&el+\t\,P

    yla&el+\amplitue\,P

    title+\ampli$ie input "i!nal\,P

    "9"647P

    "u&plot+9%6%9,

    plot+"9,P

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    52/104

    ?la&el+\t\,P

    yla&el+\amplitue\,P

    title+\attenuate input "i!nal\,P

    Time "calin!

    t X-;piP inepenent +time, (aria&le

    A >P amplitue

    $6 7P create a 7 K2 "ine #a(e la"tin! 6 "ec

    "6 A"in+7pi$6t,P

    "u&plot+9%6%6,plot+"6,P

    ?la&el+\t\,P

    yla&el+\amplitue\,P

    title +\"ine "i!nal\,

    "7A"in+77pi$6t,P "calin! &y a:

    "u&plot+9%6%7,

    plot+"7,P

    ?la&el+\t\,P

    yla&el+\amplitue\,P

    title +\"cale "ine "i!nal #ith a:\,

    "9A"in+-;pi$6t,P "calin! &y a64:

    "u&plot+9%6%9,P

    plot+"9,P

    ?la&el+\t\,P

    yla&el+\amplitue\,P

    title +\"cale "ine "i!nal #ith a64:\,P

    ////////////////////time "hi$tin!///////////////

    clc

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    53/104

    clear all

    clo"e all

    t X-6piP inepenent +time, (aria&le

    A >P amplitue

    $6 7P

    "6 A"in+7pi$6t,P

    "u&plot+9%6%6,

    plot+t%"6,

    ?la&el+\t\,P

    yla&el+\amplitue\,P

    title+\input "i!nal\,

    "u&plot+9%6%7,

    plot+tH6%"6,

    ?la&el+\t\,P

    yla&el+\amplitue\,P

    title+\ri!ht "hi$te "i!nal\,

    "u&plot+9%6%9,

    plot+t/6%"6,

    ?la&el+\t\,P

    yla&el+\amplitue\,P

    title+\le$t "hi$te "i!nal\,

    ////////////////////Folin!+Time re(er"al, ///////////////

    Folin! $or "i!nal

    clc

    clo"e all

    clear all

    t X-66P inepenent +time, (aria&le

    A >P amplitue

    $6 7P create a 7 K2 "ine #a(e la"tin! 6 "ec

    ? A"in+7pi$6t,P

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    54/104

    l?len!th+?,P

    n?l?/6P

    ?$$liplr+?,P

    n$/$liplr+n?,P

    "u&plot+7%6%6,P

    plot+n?%?,P

    ?la&el+\n?\,P

    yla&el+\amplitue,\,P

    title+\ori!inal "i!nal\,P

    "u&plot+7%6%7,P

    plot+n$%?$,P

    ?la&el+\n$\,P

    yla&el+\amplitue\,P

    title+\$ole "i!nal\,P

    ///////////////////computation o$ ener!y an po#er///////////////?6"in+6pit,PTo6

    ?"q?-^7P

    E trap2+t%?"q,P

    ) E4+7To,Pi"p+X\ Ener!y% E \% num7"tr+E,%\ Qoule"\,P

    i"p+X\ )o#er% ) \% num7"tr+),%\ Watt"\,P

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    55/104

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    56/104

    /B1$ROGRAM#%'rogram or a##ition an# multipli/ation o signals

    t = [0:01:1]! % in#epen#ent (time) ;aria$le

    = 3! % amplitu#e

    1 = 1!

    s1 = *sin(2*pi*1*t)! % /reate a 1 >z sine 9a;e

    2 = 2!

    s2 = *sin(2*pi*2*t)! % /reate a 2 >z sine 9a;e

    igure

    su$plot(,1,1)

    stem(t, s1)

    title(1 >z sine 9a;e)

    &la$el(mplitu#e)

    %plot t"e >z sine 9a;e in t"e mi##le panel

    su$plot(,1,2) !stem(t, s2)

    title(2 >z sine 9a;e)

    &la$el(mplitu#e)

    %plot t"e summe# sine 9a;es in t"e $ottom panel

    su$plot(,1,.) !stem(t, s1s2)

    title(Summe# sine 9a;es)

    &la$el(mplitu#e)

    xla$el(6ime (s))

    xmult=s1*s2!

    su$plot(,1,)!stem(xmult)!

    title(multipli/ation)!

    &la$el(mplitu#e)

    xla$el(6ime (s))

    % mplitu#e s/aling

    t = [0:01:1]! % in#epen#ent (time) ;aria$le

    = 3! % amplitu#e

    1 = 2! % /reate a 2 >z sine 9a;e lasting 1 se/

    s1 = *sin(2*pi*1*t)!

    su$plot(.,1,1)

    stem(s1)!

    xla$el(t)!

    &la$el(amplitu#e)!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    57/104

    title(input signal)!

    s2=2*s1!

    su$plot(.,1,2)

    stem(s2)!

    xla$el(t)!

    &la$el(amplitu#e)!

    title(ampliie# input signal)!

    s.=s12!

    su$plot(.,1,.)

    stem(s.)!

    xla$el(t)!

    &la$el(amplitu#e)!

    title(attenuate# input signal)!

    % 6ime s/aling

    t = [0:04:pi]! % in#epen#ent (time) ;aria$le

    = 3! % amplitu#e

    1 = 2! % /reate a 2 >z sine 9a;e lasting 1 se/

    s1 = *sin(2*pi*1*t)!

    su$plot(.,1,1)

    stem(s1)!

    xla$el(t)!

    &la$el(amplitu#e)!title (sine signal)

    s2=*sin(2*2*pi*1*t)! % s/aling $& a=

    su$plot(.,1,2)

    stem(s2)!

    xla$el(t)!

    &la$el(amplitu#e)!

    title (s/ale# sine signal 9it" a=)

    s.=*sin(4*pi*1*t)! % s/aling $& a=1

    su$plot(.,1,.)!stem(s.)!

    xla$el(t)!

    &la$el(amplitu#e)!

    title (s/ale# sine signal 9it" a=1)

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    58/104

    %--------------------time s"iting---------------%/l/

    /lear all

    /lose all

    t = [0:01:pi]! % in#epen#ent (time) ;aria$le

    = 3! % amplitu#e

    1 = 2!

    s1 = *sin(2*pi*1*t)!

    su$plot(.,1,1)

    stem(t,s1)

    xla$el(t)!

    &la$el(amplitu#e)!

    title(input signal)

    su$plot(.,1,2)

    stem(t10,s1)

    xla$el(t)!

    &la$el(amplitu#e)!

    title(rig"t s"ite# signal)

    su$plot(.,1,.)

    stem(t-10,s1)

    xla$el(t)!

    &la$el(amplitu#e)!

    title(let s"ite# signal)!

    %--operation on se8uen/es ?it" input #is/rete ;alues---%

    /lear all!

    x=[1,2,1,2,1,.,2]!

    @1=lengt"(x)!

    n=0:1:@1-1!

    su$plot(.,.,1),stem(n,x)!

    xla$el(n)!&la$el(x)!

    title(input se8uen/e x(n))!

    &=2*x!su$plot(.,.,2),stem(n,&)!

    xla$el(n)!&la$el(&)!

    title(multipl& se8uen/e &(n)=2*x(n))!

    &1=x.!

    su$plot(.,.,.),stem(n,&1)!

    title(#i;i#e# se8uen/e &1=x.)!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    59/104

    n1=-(@1-1):1:0!

    x1=[2,.,1,2,1,2,1]!

    &2=x1!

    su$plot(.,.,),stem(n1,&2)!

    title(time re;ersal or ol#e# se8uen/e &2=x(-n))!

    &.=x10!

    su$plot(.,.,4),stem(n,&.)!

    title(a##ition operation to x(n))!

    x2=[1,2,1,2,1,.,2]!

    @2=lengt"(x2)!

    n2=0:1:@2-1!

    su$plot(.,.,5),stem(n2-2,x2)!

    xla$el(n)!&la$el(x)!

    title(s"ite# #ela&e# input se8uen/e x(n-2))!

    x.=[1,2,1,2,1,.,2]!

    @.=lengt"(x.)!

    n.=0:@2-1!

    su$plot(.,.,),stem(n.2,x.)!

    xla$el(n)!&la$el(x)!

    title(s"ite# a#;an/e# input se8uen/e x(n2))!

    x=[1,2,.,,4]!

    n4=lengt"(x)!

    A=x*x!

    su$plot(.,.,2),stem(A)!

    title(input se8uen/e)!

    su$plot(.,.,3)!stem(A)!

    title(energ&)!

    p=norm(A)B2lengt"(x)!

    su$plot(.,.,

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    60/104

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    61/104

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    62/104

    RESULT# # Variou" operation" "uch a" aition% multiplication% "u&traction% time/"hi$tin!%Folin! on "i!nal" an compute ener!y an po#er o$ "i!nal" 1 0equence" u"in! Matla& i" one-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    63/104

    E$ERIMENT*6-

    TITLE# CONVOLUTION BET3EEN SIGNALS SEKUENCES

    AIM# Write a Matla& pro!ram $or con(olution &et#een "i!nal" an "equence"-

    A$$ARATUS# Computer loae #ith Wino#" ) MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-

    7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor:- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey

    ;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey

    ;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    64/104

    OUT$UT#

    6=0200!t=-1:001:1!x=sin(2*pi*t6)!su$plot(2,2,1),plot(t,x)!title(input signal)!t1=t-1!"=sin(2*pi*t16)!su$plot(2,2,2),plot(t1,")!title(impulse response signal)!&=/on;(x,")!su$plot(2,2,.)!plot(&)!title(/on;ol;e# signal)!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    65/104

    *******************CONVOLUTION BET3EEN SEKUENCES*********************

    /lear all!x=[1,2,1,2,1,.,2]!@1=lengt"(x)!n=0:1:@1-1!su$plot(2,2,1),stem(n,x)!xla$el(n),&la$el(x(n))!title(input se8uen/e x(n))!"=[1,-1,2,-2,1,1]!@2=lengt"(")!n1=0:1:@2-1!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    66/104

    su$plot(2,2,2),stem(n1,")!xla$el(n)!&la$el("(n))!title(impulse signal "(n))!&=/on;(x,")!n2=0:1:@1@2-2!su$plot(2,1,2),stem(n2,&)!xla$el(n),&la$el(&(n))!title(/on;olution o 2 se8uen/es x(n) an# "(n))!

    RESULT# Con(olution &et#een "i!nal" 1 "equence" i" one u"in!

    Matla&-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    67/104

    E$ERIMENT4 6.

    TITLE# AUTOCORRELATION CROSS CORRELATION BET3EEN SIGNALS

    SEKUENCES

    AIM# Write a matla& pro!ram $or autocorrelation 1 cro"" correlation &et#een "i!nal" 1

    "equence"

    A$$ARATUS# Computer loae #ith Wino#" )

    MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-

    7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor

    :- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey

    ;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    68/104

    OUT$UT#

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    69/104

    /////////////////////Auto Correlation o$ t#o 0i!nal"/////////////////////////

    @=102!

    1=1!7s=200!n=0:@-1!

    x=sin(2*pi*1*n7s)

    t=[1:@]*(17s)!

    su$plot(2,1,1)!

    plot(t,x)!

    title(sin9a;e o re8uen/& 1000"z(7s=300"z))!

    xla$el(time[s])!

    &la$el(amplitu#e)!

    gri#!xx=x/orr(x)!

    su$plot(2,1,2)!

    plot(xx)!

    title(auto /orrelation o sin9a;e)!

    xla$el(lags)!&la$el(auto/orrelation)!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    70/104

    %auto /orrelation o a se8uen/e

    /lear all!

    x=[1,2,.,,4]!

    #isp(x ;alues are)!

    &=x/orr(x,x)!

    su$plot(2,1,1),stem(x)!

    title(input se8uen/e)!

    xla$el(a(n)-------------+)!

    &la$el(amplitu#e)!

    su$plot(2,1,2)!stem(&)!

    title(output se8uen/e)!

    xla$el(/(n)-----+)!

    &la$el(amplitu#e)!

    #isp(t"e result is)!&

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    71/104

    y

    Column" 6 throu!h =;- 6:- 7

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    72/104

    su$plot(1,.,.)!stem(z)!

    title(output se8uen/e)!

    xla$el(/(n)-----+)!

    &la$el(amplitu#e)!#isp(t"e result is)!

    output:

    z =

    1.0000 7.0000 17.0000 28.0000 41.0000 48.0000

    30.0000 13.0000 10.0000

    /////////////////////Auto Correlation o$ a t#o 0i!nal"/////////////////////////clear allP

    clo"e allP

    clcP

    t -67P

    a co"+7 pi t,Pre" ?corr7+a,P

    "u&plot+7%7%6,Pplot+a,P

    ?la&el+\//// 0ample"\,P

    yla&el+\//// Amplitue\,Ptitle+\Input "i!nal+6,\,P

    "u&plot+7%7%X9%:,P

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    73/104

    plot+re",P

    ?la&el+\//// 0ample"\,P

    yla&el+\//// Amplitue\,Ptitle+\Output 0i!nal\,P

    OUT$UT#

    RESULT# Autocorrelation an cro""/correlation &et#een "i!nal" 1 "equence" i" one u"in! Matla&

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    74/104

    E$ERIMENT*65

    TITLE# VERI@ICATION O@ LINEARITY AND TIME INVARIANCE $RO$ERTIES O@

    SYSTEM

    AIM# Write a matla& pro!ram $or (eri$ication o$ linearity an time in(ariance propertie"

    o$ "y"tem-A$$ARATUS# Computer loae #ith Wino#" )

    MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-

    7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor

    :- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey

    ;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    75/104

    su$plot(.,.,5)!plot(n,&1#)!title(#ela&e# &1#(n),[&1(n-20)])!x2#=[zeros(1,20),x2(1:@-20)]!su$plot(.,.,)!plot(n,x2#)!gri#!title(#ela&e# x2#(n),[x2(n-20)])!&2#=x2#!su$plot(.,.,3)!plot(n,&2#)!gri#!title(#ela&e# &2#(n),[&2(n-20)])!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    76/104

    $ROGRAM#

    x1=input(enter irst input se8uen/e)!x2=input(enter se/on# input se8uen/e)!&1=x1!&2=x2!

    i[(x1x2)==(&1&2)] #isp(gi;en se8uen/e is a##iti;e)!else #isp(gi;en se8uen/e is non a##iti;e)!en#C=input(enter s/aling ;alue o C)!&.=C*x1!&=C*x2!i((C*x1C*x2)==(C*&1C*&2)) #isp(gi;en se8uen/e is "omegene)!else #isp(gi;en se8uen/e is not "omegene)!en#%%%%%%%%@1=lengt"(x1)!n=0:1:@1-1!su$plot(.,.,1)!stem(n,x1)!xla$el(n),&la$el(x)!title(irst input se8uen/e x1[n])!@2=lengt"(x2)!m=0:1:@2-1!su$plot(.,.,2)!stem(m,x2)!xla$el(m),&la$el(x)!title(se/on# input se8uen/e x2[n])!x1#=[zeros(1,2),x1(1:@1-2)]!su$plot(.,.,.),stem(n,x1#)!xla$el(n-2),&la$el(x1[n-2])!title(#ela&e# input se8uen/e x1[n-2])!

    @.=lengt"(x1)!n1=0:1:@.-1!su$plot(.,.,)!stem(n1,&1)!xla$el(n1),&la$el(&1)!title(irst output se8uen/e &1[n])!&1#=[zeros(1,2),&1(1:@.-2)]!su$plot(.,.,4),stem(n1,&1#)!xla$el(n-2),&la$el(&1[n-2])!@=lengt"(&2)!n2=0:1:@-1!su$plot(.,.,5)!stem(n2,&2)!xla$el(n2),&la$el(&2)!title(se/on# output se8uen/e &2[n])!&2#=[zeros(1,2),&1(1:@-2)]!su$plot(.,.,),stem(n2,&2#)!xla$el(n-2),&la$el(&2[n-2])!title(se/on# #ela&e# input se8uen/e &1[n-2])!%%%%%%%%%%%%%%su$plot(.,.,3),stem(n1,&.)!xla$el(n1),&la$el(&.)!title(output se8uen/e &.=C*x1)!su$plot(.,.,

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    77/104

    title(output se8uen/e &=C*x2)!%%%%%%%%%%%%%i(x1#==&1#) #isp(gi;en se8uen/e is an linear time in;arient s&stem)!else #isp(gi;en se8uen/e is not a linear time in;arient s&stem)!en#

    RESULT# Veri$ication o$ linearity an time in(ariance propertie" o$ "y"tem i" one u"in!Matla&-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    78/104

    $ROGRAM#t/6-66P

    y6"in+t,P

    y7co"+t,P

    "u&plot+676,%plot+t%y6,%title+\"ine#a(e\,P!ri on"u&plot+677,%plot+t%y7,%title+\co"#a(e\,P!ri on

    ////////////////////linearity property///////////////

    y97y6Py:9y7P

    y;y9Hy:P

    yt-y:P

    y@y=Hy>P

    e+y

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    79/104

    RESULT# Veri$ication o$ linearity an time in(ariance propertie" o$ "y"tem i" one u"in! Matla&-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    80/104

    E$ERIMENT*>

    TITLE# @INDING THE @OURIER TRANS@ORM O@ A GIVEN SIGNAL AND $LOTTING

    ITS MAGNITUDE AND $HASE S$ECTRUM

    AIM# Write a matla& pro!ram $or $inin! the Fourier Tran"$orm o$ a !i(en "i!nal an

    plot it" Ma!nitue an pha"e "pectrum-A$$ARATUS# Computer loae #ith Wino#" )

    MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-

    7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor

    :- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey

    ;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    81/104

    OUT$UT#

    RESULT# Fourier Tran"$orm o$ a !i(en "i!nal an plot o$ Ma!nitue an pha"e "pectrum i" oneu"in! MATLA3-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    82/104

    E$ERIMENT*7

    TITLE#3a)e fo!" S9nthesis usin% Lala'e T!ansfo!"

    Ai"# Write a matla& pro!ram $or Wa(e $orm 0ynthe"i" u"in! Laplace tran"$ormA$$ARATUS# Computer loae #ith Wino#" )

    MATLA3 =-7 "o$t#are-

    -

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-

    7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor

    :- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey

    ;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    83/104

    E$ERIMENT*:TITLE# GENERATION O@ GAUSSIAN NOISE COM$UTATION O@ ITS MEAN

    M4S4VALUES AND ITS S?E3?URTOSIS AND $SD $ROBABILITY DISTRIBUTION

    @UNCTION

    AIM# Write a matla& pro!ram $or !eneration o$ Gau""ian noi"e% an computation o$ it" mean% mean "quare (alue"% an it" p"% pro&a&ility i"tri&ution $unction-

    -

    A$$ARATUS# Computer loae #ith Wino#" ) MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-

    7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor:- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey

    ;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey

    ;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    84/104

    x=-10:10!

    p#uniorm=unip#(x,-4,4)!

    su$plot(.,.,1)!plot(x,p#uniorm)!

    title(uniorm pro$a$ilit& un/tion)!

    x1=-14:01:24!

    mu=.!

    sigma=!

    p#normal=normp#(x1,mu,sigma)!

    su$plot(.,.,2)!plot(x1,p#normal)!

    title(normal pro$al$ilit& un/tion)!

    p#uniorm1=ran#(1,10000)!

    su$plot(.,.,.)!"ist(p#uniorm1)!

    title(uniorm pro$a$ilit& "istogram)!

    su$plot(.,.,)!"ist(p#uniorm1,100)!

    title(uniorm pro$a$ilit& ,100$in "istogram)!

    p#mean=4!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    85/104

    p#st#=!

    p#normalss=ran#n(1,10000)*(p#st#p#mean)!

    su$plot(.,.,4)!"ist(p#normalss)!

    title(normal #istru$ution 9it" mean=4,st#=)!

    su$plot(.,.,5)!"ist(p#normalss,100)!

    title(normal #istru$ution 9it" mean=4,st#=)!

    x=ran#n([4 ])

    C=Curtosis(x)!

    C1=sCe9ness(x)!

    su$plot(.,.,1)!stem(C)!

    title(sCe9)!

    su$plot(.,.,2)!stem(C)!

    title(Curtosis)!

    %mean

    x=normrn#(0,1,100,4)!

    x$ar=(mean(x))!

    su$plot(.,.,.)!stem(x$ar)!

    title(mean)!

    %me#ian

    xo##=1:4!

    mo##=me#ian(xo##)

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    86/104

    su$plot(.,.,)!stem(mo##)!

    title(o## me#ian)!

    xe;en=1:!

    me;en=me#ian(xe;en)

    su$plot(.,.,4)!stem(me;en)!

    x=normrn#(0,1,100,5)!

    title(e;en me#ian)!

    %stan#er# #e;iation

    &=st#(x)

    su$plot(.,.,5)!stem(&)!

    title(stan#ar# #e;iation)!

    [n,p]=size(x)!

    x=x-ones(n,1)*mean(x)!

    &=x*x(n-1)!

    title(stan#ar# #e;iation)!

    %/orrelation

    x=ran#n(.0,)!

    x(:,)=sum(x,2)!

    [r,p]=/orr/oe(x)

    su$plot(.,.,)!stem([r,p])!

    title(/orrelation)!

    [i,D]=in#(p004)!

    [i,D]

    %;arien/e

    x=[-1 1]!

    9=[1 .]

    ;1=;ar(x)!

    su$plot(.,.,3)!stem(;1)!

    title(;arien/e)!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    87/104

    7s=1000!t=0:17s:1!E=lengt"(t)!9=ran#n(1,E)!x=/os(2*pi*200*t)9!"=spe/trum9el/"!ps#(",x,7s,7s)!

    RESULT# Generation o$ Gau""ian noi"e% an computation o$ it" mean% mean "quare (alue"%an it" "'e#%Curtosisan p"% pro&a&ility i"tri&ution $unction i" one &y u"in! Matla&-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    88/104

    E$ERIMENT*

    TITLE# VERI@ICATION O@ SAM$LING THEOREM

    AIM# Write a matla& pro!ram $or (eri$ication o$ "amplin! theorem-

    -

    A$$ARATUS# Computer loae #ith Wino#" ) MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor

    :- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey

    ;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    89/104

    $ROGRAM#/lear all!t=-4:00001:4!71=.!72=2.!x=/os(2*pi*71*t)/os(2*pi*72*t)!igure(1)!plot(t,x)!axis([-0 0 -2 2])!xla$el(time t in se/)!&la$el(x(t))!title(/ontinuous time signal )!7s1=1*72!ts1=17s1!

    n1=-0:ts1:0!xs1=/os(2*pi*71*n1)/os(2*pi*72*n1)!igure(2)!stem(n1,xs1)!"ol# on!plot(t,x,r:)!axis([-0 0 -2 2])!"ol# oxla$el(time sample(n))!&la$el(amplitu#e)!title(#is/rete time signal)!legen#(7s27max)!7s2=2*72!ts2=17s2!n2=-0:ts2:0!xs2=/os(2*pi*71*n2)/os(2*pi*72*n2)!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    90/104

    igure(.)!stem(n2,xs2)!"ol#!plot(t,x,r:)!axis([-0 0 -2 2])!"ol# oxla$el(time sample(n))!&la$el(amplitu#e)!title(#is/rete time signal)!legen#(7s=27max)!7s.=*72!ts.=17s.!n.=-0:ts.:0!xs.=/os(2*pi*71*n.)/os(2*pi*72*n.)!igure()!stem(n.,xs.)!"ol#!plot(t,x,r:)!axis([-0 0 -2 2])!"ol# oxla$el(time sample(n))!&la$el(amplitu#e)!title(#is/rete time signal)!legen#(7s+27max)!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    91/104

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    92/104

    %program to ;eri& sampling t"eorem/lear all!t=-100:001:100!m=002!x=/os(2*pi*t*m)!su$plot(2,2,1)!plot(t,x)!xla$el(time in se/)!&la$el(x(t))!

    title(/ontinuous signal)!s1=002!n=-2:2!x1=/os(2*pi*m*ns1)!su$plot(2,2,2)!stem(n,x1)!"ol# on!su$plot(2,2,2)!plot(n,x1,:)!title(#is/rete time signal x(n) 9it" s2m)!xla$el(n)!&la$el(x(n))!s2=00!n1=-:!x2=/os(2*pi*m*n1s2)!

    su$plot(2,2,.)!stem(n1,x2)!"ol# on!su$plot(2,2,.)!plot(n1,x2,:)!title(#is/rete time signal x(n) 9it" s=2m)!xla$el(n)!&la$el(x(n))!n2=-40:40!s.=04!x.=/os(2*pi*m*n2s.)!su$plot(2,2,)!stem(n2,x.)!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    93/104

    "ol# on!su$plot(2,2,)!plot(n2,x.,:)!title(#is/rete time signal x(n) 9it" s+2m)!xla$el(n)!&la$el(x(n))!

    RESULT# 0amplin! theorem (eri$ication i" one &y u"in! Matla&-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    94/104

    E$ERIMENT#+6

    TITLE#Re"o)al of noise b9 Auto'o!!elation an& '!oss 'o!!elation

    AIM# Write a matla& pro!ram $or remo(al o$ noi"e &y autocorrelation 1 cro"" correlation-

    -

    A$$ARATUS# Computer loae #ith Wino#" ) MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-

    7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor:- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey

    ;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey

    ;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    95/104

    OUT$UT#

    $ROGRAM#@=102!1=1!7s=100!n=0:@-1!x=sin(2*pi*1*n7s)!su$plot(.,1,1)!plot(x)!title(pure sine 9a;e)!gri#!x1=x(10*ran#n(1,@))!su$plot(.,1,2)!

    plot(x1)!title(pure sine9a;e noise)!gri#!xx=x/orr(x,x1)!su$plot(.,1,.)!plot(xx)!title(auto /orrelation xx)!

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    96/104

    OUT$UT#

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    97/104

    $ROGRAM#clcP

    ///////////!enerate "inu"oial "i!nal/////////////////////////t-66P

    ? "in+7pit,P !enerate "inu"oial "i!nal

    $i!ure%plot+t%?,Ptitle+\"inu"oial "i!nal\,

    ///////////!enerate !au""ian noi"e/////////////////////////

    _ WGN+6% 76% 6% \comple?\,P_ WGN+6% 66% 6% \real\,P

    ///////////!enerate +"inu"oialHnoi"e, "i!nal/////////////////////////

    ?H_P$i!ure+7,%plot+t%,%title+\"inu"oial "i!nalH!au""ian noi"e\,

    " ?corr7+?%,P

    $i!ure+9,%plot+",%title+\E?traction o$ "inu"oial "i!nal\,P

    OUT$UT#

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    98/104

    RESULT#Remo(al o$ noi"e &y autocorrelation 1 cro"" correlation i" one &y u"in! Matla&-

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    99/104

    E$ERIMENT*++

    TITLE# IM$ULSE RES$ONSE O@ A RAISED COSINE @ILTER

    AIM# Write a matla& pro!ram $or impul"e re"pon"e o$ rai"e co"ine $ilter

    -

    A$$ARATUS# Computer loae #ith Wino#" ) MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-

    7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor:- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey

    ;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey

    ;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    100/104

    $ROGRAM#

    %parametres

    #ela&=.!

    #ataF=20!

    =04!

    7s=3!7#=1!

    'ropG=0!

    %generate ran#om #ata at time 0,17#,27#

    x=ran#sr/(#ataF,1,[],124)!

    tx=['ropG:'ropG#ataF-1]7#!

    %plot #ata

    stem(tx,x)!

    xla$el(time)!&la$el(amplitu#e)!

    %set axisHla$els

    axis([0 .0 -14 14])!

    OUT$UT#

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    101/104

    $ROGRAM#clcP

    t/6-66P

    ////////////////////5nit Impul"e/////////////////////?66P

    ?7P

    ? ?6-+t,P !enerate 5nit Impul"e 0i!nal

    "u&plot+676,% plot+?,P plot the !enerate 5nit Impul"e 0i!nal?la&el+\t\,P yla&el+\?+t,\,P title+\5nit impul"e 0i!nal\,P

    //////////////impul"e re"pon"e o$ rai"e co"ine $ilter///////////

    y rco"$lt+?%6%>%\$ir\,P 0ame a" ori!inal e?ample

    y rco"$lt+?%6%>%\$ir4"qrt\,P FIR "quare/root RC $ilter y rco"$lt+?%6%>%\iir\,P IIR rai"e co"ine $ilter

    y rco"$lt+?%6%>%\iir4"qrt\,P IIR "quare/root RC $ilter y rco"$lt+?%6%>%\$ir\,P

    "u&plot+677,%plot+y,

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    102/104

    OUT$UT#

    RESULT# Impul"e re"pon"e o$ Rai"e co"ine $ilter i" one &y u"in! Matla&-

    E$ERIMENT*+,

    Dept of ECE !CE" #$%

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    103/104

    TITLE# CHEC?ING A RANDOM $ROCESS @OR STATIONARITY IN 3IDE SENSE

    AIM# Write a matla& pro!ram $or chec'in! o$ Wie 0en"e 0tationary-

    A$$ARATUS# Computer loae #ith Wino#" )

    MATLA3 =-7 "o$t#are-

    $ROCEDURE#

    6- Open the Matla& "o$t#are &y ou&le clic'in! the icon on e"'top-7- Open the Matla& Eitor &y u"in! File Ta& ///Ne#///M/File on the Menu-

    9- Write the pro!ram in Matla& Eitor

    :- Clic' on "a(e $rom File ta& or pre"" CtrlH0 .ey;- Clic' on Run 3utton )re"ent on the Eitor Wino# or )re"" F; .ey

    ;- )er$orm error chec' i$ any% #hich i" i"playe on the Comman #ino# an Moi$y i$ any-

  • 7/25/2019 Electrical Technology and Basic Simulation Laboratory1

    104/104

    E1=mean(1)!

    su$plot(.,.,)!stem(E1)!

    title( mean o lippe# se8uen/e)!

    OUT$UT#

    RESULT# Chec'in! o$ Wie 0en"e 0tationary pro!ram i" one &y u"in! Matla&


Recommended