experiment no 3.pdf
TRANSCRIPT
-
8/14/2019 Experiment No 3.pdf
1/13
00
TECHNOLOGICALUNIVERSITYOFTHEPHILIPPINES
COLLEGEOFENGINEERING
ELECTRONICSENGINEERINGDEPARTMENT
EXPERIMENTNO.3AMMATLAB&ACTUALEXPERIMENTATION
GROUPLEADER:
VILLALUNA,JASONA.
MEMBERS:
ALBA,YUGELRUDOLF
NOMIL,DIANAS.
MONJE,MANOLITOJR.G.
BSESE4B
OCTOBER16, 2013
ENGR.JOHNWILLIAMORILLO
INSTRUCTOR
-
8/14/2019 Experiment No 3.pdf
2/13
EXPERIMENT3: AMMATLAB&ACTUALEXPERIMENTATION
I. OBJECTIVESThemainobjectivesofthisexperimentare:
1. Thegainaclearerunderstandingaboutdoublesidebandsuppressedcarrier(DSBSC)andamplitudemodulation.
2. Tolearnhowtosimulatemodulation/demodulationsystemforDSBSCandAmusingMATLABforsyntheticandrealsignals(suchasspeech).
II. PRELABWORK1. Readtherelevantmaterialinyourtextbook(Chapter4).
2. UsingMATLAB ,performthefollowing:a. x=[012345]b. y=[123456]
Nowmultiplyxbyyusingtwoways.ThefirstoneistheusualMATLABmultiplication(star(x*y))and
theotheroneiswhatwecalledpointwisearraymultiplication(adotfollowedbyastar(x.*y).Whatisthe
differencebetweenthetwo?
*WriteyouranswerinResultsandDiscussion
3. UsingMATLABgenerateavectort=[0:0.001:1].Thengeneratem=cos(2**t).Plotm,v,andtheproductx=mv.Areyougoingtousemultiplicationbetweenmatricesorvectorsthatarerepresentingafunction?
*WriteyouranswerinResultsandDiscussion
-
8/14/2019 Experiment No 3.pdf
3/13
III. LABWORK1. UseMATLABtosimulatethefollowingblockdiagram
x(t) y(t)=x(t)cos(2fct)
cos(2f ct)
Assume 0and letx(t) cos(22000t).Use acarrierfrequencyoffc 20kHz.Plot x(t),y(t),w(t),and v(t),andtheirmagnitudespectrumseachinatwopanelfigure.Definethetimevectortas[0:200]*tswheretsis
thestepsizegivenbyts=1/(10fc).
*WriteyouranswerinResultsandDiscussion
Atthereceiverend,youneedtodesignaLowPassFilter(LPF). I nMATLAB ,youcanuseatypeof filters
known as B utterworth filters. For example, you can design a given filter with some ordern and cutoff
frequencyfcwhichistypicallynormalizedin
Matlabandgivenby2fcts(wheretsisthesamplingperiod).Toobtainthefiltercoefficients,thestatement
willbe:[num,den]=butter(n,2fcts),wherenumandden
arethenumeratoranddenominatorcoefficientsoftherationalfunctionrepresentingtheanalogfilter.You
canusen 5forexample.Onceyouobtainedthesecoefficients,youcanusetheMatlabfunctionfilterto
filterthesignalw(t)usingthedesignedLPF.Thatis,v=filter(num,den,w).
RefertotheadditionalnotesbelowforfurtherdiscussiononhowtousefiltersinMatlab.
UsefulMATLABFunctions:cos,fftshift(fft()),butter,filter,abs,plot,subplot,figure,xlabel,ylabel,title.
2. RepeatPart1with2differentvaluesforthereceiverphaseoffset:=/2&.Whatdoyounoticeatthereceiverend?I sthereanydifferencebetweentherecoveredsignalhereandthe
oneobtainedinPart1?Whyisthat?Andwhatisthesolutiontothisproblem?
*WriteyouranswerinResultsandDiscussion
RepeatPart1bymakingy(t)= Ac(1+xn(t))cos(2fct)where isthemodulationindexoftheAMwave, Ac
isthecarrieramplitude(set itequalto4),andxn(t)isthenormalizedversionofx(t).Set ittobe0.5(5 0%
modulation).
w(t) v(t)
cos(2fct +)
X X LPF
-
8/14/2019 Experiment No 3.pdf
4/13
3. Atthedemodulator,youcanimplementthefunctionalityofthesimpleenvelopedetectorthatyoustudiedin class (builtwithadiode,acapacitorand resistor) by using simpleMATLABcode to produce fullwave
rectification (absolute value function), followed by lowpass filtering. This is illustrated in the following
blockdiagram.YouneedtothinkaboutsettingtheappropriatecutofffrequencyfortheLPF.I naddition,
youcanalsoaddamechanismtoremovetheDCcomponentfromthesignal
y(t)
ReceivedSignal
4. RepeatPart3bylettingthemodulationindexequalto1.2.Whatwillhappentothereceivedsignal?Explain.
Since
the
modulation
index
is
greater
than
1,
it
caused
a
severe
distortion
in
the
receiver.
I t
is
called
over
modulation.I tsometimescausesharmonicgeneration.
5. LoadthefilecalledExp3Part5 .mat.Thisdatafilecontains:a. Avectorcalledms,whichisaspeechsignalsampledwithts 1/96E3 s.
b. Avectorcalledt thatrepresentstime.
Withacarrierof24kHz,transmitandreceivemsusingtheAMsysteminpart3with
=0.5&1.5.Forbothcasesshowthefollowing:a. I nonefigurewithtwopanels,thetimeandfrequencydomainrepresentationsofthemodulatedwavesb. Listentomsbytyping(sound(ms,96E3),pause,thenpressEntertocontinue).Also listentothereceived
signalvbytypingsound(v,96E3).Commentonthedifferencesbetweenthetwosignals.
The demodulated waveform in the receiver is a replica of the modulated waveform. Their only
differenceisthatthedemodulatedwavehasloweramplitudecomparedtotheother.
Note:inordertobeabletoseethespectrumofthesignalms,afterplottingthemagnitudespectrumofms,
(denotedbyMs)vs.f,type:
axis([4E3,4E3,0,max(|Ms|)])
UsefulMATLABFunctions:load,sound,pause,axis.
IV. ADDITIONALNOTES(FILTERSINMATLAB)TofurtherunderstandhowtousefiltersinMatlab,recallfromEE207thattherationaltransferfunctionofa
filtercanbeexpressedintermsoftheLaplacevariablesby:
LPF
-
8/14/2019 Experiment No 3.pdf
5/13
wheretheasandbsdefinethetransferfunctioncoefficients.Thesecoefficientscompletelycharacterize
the filter response.Matlab returns thesetwovectorsas a resultof designinga filter withacertain type
(e.g.,B utterworth,etc)andcutofffrequency.Forexample,withnum=[bm,bm1,,b0]andden=[an,an1,,
a0],thefilterdesignisdoneby:[num,den]=butter(n,2fcts),
Notice also that the filter order n is important to specify. For example, t is shown that for these
B utterworthtypefilters,asthefilterorderincreasesthefilterresponsewillapproachthatofanidealbrick
wallresponse.
V. RESULTSANDDISCUSSIONSDiscussandshowalltheoutputoftheplotcommand.IncludetheSyntaxused.
ForPRELAB
2. Thefirstmethodproducesanerroranditisthemultiplicationofonematrixtoanotherwhilethe
secondmethodistheentrybyentryproductofXandYandisanarraymultiplication.
3. Wewillusethemultiplicationbetweenvectorsthatrepresentsfunction..
ForLABWORK
1. TheDSBSCmo dulatedsignaly(t) issimplyo btainedbymultiplyingthe info rmatio nsignalw iththecarrier.The
resulatingw avefo rmbeco mespassbandsignal. Therefo re,thissignalbeco mesapassbandsignalw ithfrequencythatis
much largerthanthemaximumfrequency inm(t).Thedemo dulatio npro cesso faDSBSCsignal invo lveso btainingthe
o riginalinfo rmatio nsignalo rscaledversio no fitfromthemo dulatedsignal.Thisisdonebymultiplyingthemo dulated
signaly(t)w ithano thercarriersignalthathasEX ACTLYthesamefrequencyandasthecarriersignalinthemo dulato r.
Theamplitudeo fthetw ocarriersignalsinthemo dulato randdemo dulato rareno timpo rtantsincetheyjustaffectthe
magnitudeo fthedifferentintermediatesignalsandfinalo utputsignalo fthedemo dulato r.Ho w ever,asseenw (t),the
o riginalmessagesignal(scaledby1/2)ispresentbutalsoo therco mpo nentsw ithfrequenciescenteredaro und2cand
2c.Theseco mpo nentsareundesiredandmustberemo vedtogetthemessagesignal.Thiscanbedo neusingaLPF
.Thisissimplyascaledversio no ftheo riginaltransmittedsignalthatcanno wbeeasilyamplifiedtoo btaintheo riginal
signalexactly.
-
8/14/2019 Experiment No 3.pdf
6/13
WAVEFORMandMAGNITUDESPECTRUM:
x(t):
y(t):
w(t):
-
8/14/2019 Experiment No 3.pdf
7/13
v(t):
SYNTAX
2. Compared tothe receiversignalofpart 1,havingavalueof/2 for makes thesignal toshift90.
Whilehavingavalueof for madethesignaltobeinvertedby180.Thisisbecause isanaddedangleto
anothercosinefunctionmultipliedtoanothercosinefunction.
f c=2000; t s=1/ ( 10*f c) ; t =[ 0: 200] *t s; psi =0; n=5;[ num, den] =but t er ( n, 2*f c*t s) ;x=cos( 2*pi *2000*t ) ;y=x. *cos( 2*pi *f c*t) ;w=y. *cos( ( 2*pi *f c*t ) +psi ) ;v=f i l t er ( num, den, w) ;f i gure(1) , subpl ot ( 211) , pl ot ( t , x, ' r ' ) , gr i d on, xl abel ( ' Ti me' ) ,yl abel ( ' Ampl i t ude' ) , t i t l e( ' x( t ) ' ) ;subpl ot ( 212) , s tem( abs(f f t shi f t ( f f t ( x) ) ) ) , gr i d on, xl abel ( ' Frequency' ) ,yl abel ( ' Magni t ude' ) , t i t l e( ' Magni t ude Spect r a OF x( t ) ' ) ;f i gur e( 2) , subpl ot ( 211)pl ot ( t , y, ' g' ) , gr i d on, xl abel ( ' Ti me' ) , yl abel ( ' Ampl i t ude' ) , t i t l e( ' y( t ) ' ) ;
subpl ot ( 212) , s tem( abs(f f t shi f t ( f f t ( y) ) ) ) , gr i d on, xl abel ( ' Frequency' ) ,yl abel ( ' Magni t ude' ) , t i t l e( ' Magni t ude Spect r a OF y( t ) ' ) ;f i gur e( 3) , subpl ot ( 211)pl ot ( t , w, ' m' ) , gr i d on, xl abel ( ' Ti me' ) , yl abel ( ' Ampl i t ude' ) , t i t l e( ' w( t ) ' ) ;subpl ot ( 212) , s tem( abs(f f t shi f t ( f f t ( w) ) ) ) , gr i d on, xl abel ( ' Frequency' ) ,yl abel ( ' Magni t ude' ) , t i t l e( ' Magni t ude Spect r a OF w( t ) ' ) ;f i gur e( 4) , subpl ot ( 211)pl ot ( t , v, ' c' ) , gr i d on, xl abel ( ' Ti me' ) , yl abel ( ' Ampl i t ude' ) , t i t l e( ' v( t ) ' ) ;subpl ot ( 212) , s tem( abs(f f t shi f t ( f f t ( v) ) ) ) , gr i d on, xl abel ( ' Frequency' ) ,yl abel ( ' Magni t ude' ) , t i t l e( ' Magni t ude Spect r a OF v( t ) ' ) ;
-
8/14/2019 Experiment No 3.pdf
8/13
WAVEFORMandMAGNITUDESPECTRUM:
x(t):
y(t):
w(t):
-
8/14/2019 Experiment No 3.pdf
9/13
v(t):
SYNTAX:f c=2000; t s=1/ ( 10*f c) ; t =[ 0: 200] *t s; psi
v(t):=( pi / 2) ; n=5; [ num, den] =but t er ( n, 2*f c*t s) ; x=cos( 2*pi *2000*t ) ; y=x. *cos( 2*pi *f c*t) ; w=y. *cos( ( 2*pi *f c*t ) +phase) ; v=f i l t er ( num, den, w) ; f i gure( 5) , subpl ot ( 211) , pl ot ( t , x) , gr i d onxl abel ( ' TI ME' ) , yl abel ( ' AMPLI TUDE' ) , t i t l e( ' x( t ) ' ) ; subpl ot ( 212) , s tem( abs(f f t shi f t ( f f t ( x) ) ) ) , gr i d on
xl abel ( ' FREQUENCY' ) , yl abel ( ' MAGNI TUDE' ) , t i t l e( ' MAGNI TUDE SPECTRA OFx ( t ) ' ) ; f i gure( 6) , subpl ot ( 211) , pl ot ( t , y) , gr i d onxl abel ( ' TI ME' ) , yl abel ( ' AMPLI TUDE' ) , t i t l e( ' y( t ) ' ) ; subpl ot ( 212) , s tem( abs(f f t shi f t ( f f t ( y) ) ) ) , gr i d onxl abel ( ' FREQUENCY' ) , yl abel ( ' MAGNI TUDE' ) , t i t l e( ' MAGNI TUDE SPECTRA OFy ( t ) ' ) ; f i gure(7) , subpl ot ( 211) , pl ot ( t , w) , gr i d onxl abel ( ' TI ME' ) , yl abel ( ' AMPLI TUDE' ) , t i t l e( ' w( t ) ' ) ; subpl ot ( 212) , s tem( abs(f f t shi f t ( f f t ( w) ) ) ) , gr i d onxl abel ( ' FREQUENCY' ) , yl abel ( ' MAGNI TUDE' ) , t i t l e( ' MAGNI TUDE SPECTRA OFw( t ) ' ) ; f i gure( 8) , subpl ot ( 211) , pl ot ( t , v) , gr i d on
xl abel ( ' TI ME' ) , yl abel ( ' AMPLI TUDE' ) , t i t l e( ' v( t ) ' ) ; subpl ot ( 212) , s tem( abs(f f t shi f t ( f f t ( v) ) ) ) , gr i d onxl abel ( ' FREQUENCY' ) , yl abel ( ' MAGNI TUDE' ) , t i t l e( ' MAGNI TUDE SPECTRA OF
-
8/14/2019 Experiment No 3.pdf
10/13
3.
SYNTAX
4.
f c=20000; t s=1/ ( 10*f c) ; t =( 0: 2000) *t s; A=4;x=cos( 2*pi *2000*t ) ; f om=cos( 2*pi *f c*t ) ; xnor m=x/ max( abs( x) ) ; y=A. *( 1+. 5. *xnorm) . *f om; %0. 5 modul at i onw=abs( y) ; [ num, den] =but t er ( 5, 2*f c*t s) ; v=f i l t er ( num, den, w) - ( A+1) / 2; f i gure(13) , subpl ot ( 311) , pl ot ( t , y) , axi s([ 0 . 003 - 5 5] ) t i t l e( ' MODULATED SI GNAL ( y( t ) ) ' ) , xl abel ( ' t i me' ) , yl abel ( ' AMPLI TUDE' ) subpl ot ( 312) , pl ot ( t , w) , axi s([ 0 . 003 -5 5] ) , t i t l e( ' w( t ) ' ) xl abel ( ' TI ME' ) , yl abel ( ' AMPLI TUDE' )
subpl ot ( 313) , pl ot ( t , v) , axi s([ 0 . 003 - 2 2] ) , t i t l e( ' DEMODULATED SI GNAL( v ( t ) ) ' ) xl abel ( ' TI ME' ) , yl abel ( ' AMPLI TUDE' )
-
8/14/2019 Experiment No 3.pdf
11/13
SYNTAX
5.
f c=20000; t s=1/ ( 10*f c) ; t =( 0: 2000)*t s; Ac=4; x=cos( 2*pi *2000*t ) ; xnorm=x/ max( abs( x) ) ; f om=cos( 2*pi *f c*t) ; y=Ac. *( 1+1. 2. *xnorm) . *f om; w=abs( y) ; [ num, den] =but t er ( 5, 2*f c*t s) ; v=f i l t er ( num, den, w) - ( Ac+1) / 2; f i gure(14) , subpl ot ( 311) , pl ot ( t , x) , axi s([ 0 . 003 - 2 2] ) t i t l e( ' Modul at i ng Si gnal ( x( t ) ) ' ) , xl abel ( ' Ti me' ) , yl abel ( ' Ampl i t ude' ) subpl ot ( 312) , pl ot ( t , f om) , axi s([ 0 . 003 - 2 2] ) , t i t l e( ' Carr i er Si gnal ( f o) ' ) xl abel ( ' Ti me' ) , yl abel ( ' Ampl i t ude' ) subpl ot ( 313) , pl ot ( t , y) , axi s([ 0 . 003 - 10 10] ) , t i t l e( ' Modul ated Si gnal( y ( t ) ) ' ) xl abel ( ' Ti me' ) , yl abel ( ' Ampl i t ude' ) f i gure(15) , subpl ot ( 311) , pl ot ( t , y) , axi s([ 0 . 003 - 10 10] ) , t i t l e( ' Modul atedSi gnal ( y( t ) ) ' ) xl abel ( ' Ti me' ) , yl abel ( ' Ampl i t ude' ) subpl ot ( 312) , pl ot ( t , w) , axi s([ 0 . 003 - 10 10] ) , t i t l e( ' w( t ) ' ) xl abel ( ' Ti me' ) , yl abel ( ' Ampl i t ude' ) subpl ot ( 313) , pl ot ( t , v) , axi s([ 0 . 003 - 5 5] ) , t i t l e( ' Demoodul at ed Si gnal( v ( t ) ) ' ) xl abel ( ' Ti me' ) , yl abel ( ' Ampl i t ude' )
-
8/14/2019 Experiment No 3.pdf
12/13
SYNTAX
VI. CONCLUSIONAmplitudemodulationisamodulationtechniquethatvariesthestrengthofthetransmittedsignalin
relationtotheinformationbeingsent.Doublesidebandsupressedcarrierisaformofamplitudemodulationin
which both the upper and lower sidebands are transmitted but the power contained in the unmodulated
carrierlevel isreducedtoafixed level, ideallybeingcompletelysuppressed.MATLABcansimulateamplitude
modulationbyusingpointwisemultiplicationofaninformationsignalwiththecarriersignalofthesamevector
size.Thus,theoutput issimilartothe informationsignalbuthaspeakamplitudesequaltothesumofpeak
valuesofthesignals.
VII. QUESTIONSTOBEANSWERED1. EnumerateanddescribethetypesofAmplitudeModulation.I ncludeitsdesignationbyI TU(I nternationalTelecommunicationUnion)
l oad f orexp3. mat t = 0: Fs+1' / Fs; Fc = 24000; % Car r i er f r equency
Fs=2*( Fc+Fs) ; y1 = ammod(voi ce, Fc, Fs) ; % Comput e spect r a of bot h modul ated si gnal s. z1 = f f t ( y1) ; z1 = abs( z1(1: l engt h( z1) / 2+1) ) ; f r q1 = ( 0: l engt h( z1) - 1) *Fs/ l engt h( z1) / 2; % Pl ot spect r a of bot h modul at ed si gnal s. f i gur e; subpl ot ( 311) ; pl ot ( y1) ; t i t l e( ' Ampl i t ude Modul ated Si gnal ' ) subpl ot ( 312) ; pl ot ( f r q1, z1) ; t i t l e( ' Spect r um of 1- si deband si gnal ' ) ;%Demodul at i on[ num, den] = but t er ( 10, Fc*2/ Fs) ; s1 = amdemod( y1, Fc, Fs, 0, 0, num, den) ; soundsc( s1) subpl ot ( 313) ; pl ot ( s1) ; t i t l e( ' Demodul ated Si gnal ' )
-
8/14/2019 Experiment No 3.pdf
13/13
Designation Description
A3E doublesidebandafull
R3E singlesidebandreducedcarrier
H3E singlesidebandfullcarrier
J3E singlesidebandsuppressedcarrier
B 8E independentsidebandemission
C3F vestigialsideband
2. EnumerateandbrieflyexplainthemodulationmethodforAM.
a.Lowlevelgeneration
I nmodern radio systems, modulatedsignals are generatedvia digital signalprocessing (DSP).With
DSP many types of AM modulation are possible with software control (including DSB with carrier, SSB
suppressedcarrierandindependentsideband,orI SB ).
b.Highlevelgeneration
HighpowerAMtransmitters(suchasthoseusedforAMbroadcasting)arebasedonhighefficiency
classDandclassEpoweramplifierstages,modulatedbyvaryingthesupplyvoltage.