Onthispage
OverviewofFadingChannels
MethodologyforSimulatingMultipathFadingChannels:
SpecifyFadingChannels
SpecifyDopplerSpectrumofFadingChannel
ConfigureChannelObjects
UseFadingChannels
RayleighFadingChannel
RicianFadingChannel
AdditionalExamplesUsingFadingChannels
OverviewofFadingChannels
UsingCommunicationsSystemToolboxyoucanimplementfadingchannelsusingobjectsorblocks.
RayleighandRicianfadingchannelsareusefulmodelsofrealworldphenomenainwireless
communications.Thesephenomenaincludemultipathscatteringeffects,timedispersion,andDopplershifts
thatarisefromrelativemotionbetweenthetransmitterandreceiver.Thissectiongivesabriefoverviewof
fadingchannelsanddescribeshowtoimplementthemusingthetoolbox.
Thefigurebelowdepictsdirectandmajorreflectedpathsbetweenastationaryradiotransmitteranda
movingreceiver.Theshadedshapesrepresentreflectorssuchasbuildings.
Themajorpathsresultinthearrivalofdelayedversionsofthesignalatthereceiver.Inaddition,theradio
signalundergoesscatteringonalocalscaleforeachmajorpath.Suchlocalscatteringistypically
characterizedbyalargenumberofreflectionsbyobjectsnearthemobile.Theseirresolvablecomponents
combineatthereceiverandgiverisetothephenomenonknownasmultipathfading.Duetothis
phenomenon,eachmajorpathbehavesasadiscretefadingpath.Typically,thefadingprocessis
characterizedbyaRayleighdistributionforanonlineofsightpathandaRiciandistributionforalineofsight
path.
TherelativemotionbetweenthetransmitterandreceivercausesDopplershifts.Localscatteringtypically
comesfrommanyanglesaroundthemobile.ThisscenariocausesarangeofDopplershifts,knownasthe
Dopplerspectrum.ThemaximumDopplershiftcorrespondstothelocalscatteringcomponentswhose
directionexactlyopposesthemobile'strajectory.
ImplementFadingChannelUsinganObject
Abasebandchannelmodelformultipathpropagationscenariosthatyouimplementusingobjectsincludes:
Ndiscretefadingpaths,eachwithitsowndelayandaveragepowergain.AchannelforwhichN=1is
calledafrequencyflatfadingchannel.AchannelforwhichN>1isexperiencedasafrequencyselective
fadingchannelbyasignalofsufficientlywidebandwidth.
ARayleighorRicianmodelforeachpath.
DefaultchannelpathmodelingusingaJakesDopplerspectrum,withamaximumDopplershiftthatcan
bespecified.OthertypesofDopplerspectraallowed(identicalordifferentforallpaths)include:flat,
restrictedJakes,asymmetricalJakes,Gaussian,biGaussian,androunded.
IfthemaximumDopplershiftissetto0oromittedduringtheconstructionofachannelobject,thenthe
objectmodelsthechannelasstatic(i.e.,fadingdoesnotevolvewithtime),andtheDopplerspectrum
specifiedhasnoeffectonthefadingprocess.
SomeadditionalinformationabouttypicalvaluesfordelaysandgainsisinChooseRealisticChannel
PropertyValues
ImplementFadingChannelUsingaBlock
TheChannelsblocklibraryincludesRayleighandRicianfadingblocksthatcansimulaterealworld
phenomenainmobilecommunications.Thesephenomenaincludemultipathscatteringeffects,aswellas
Dopplershiftsthatarisefromrelativemotionbetweenthetransmitterandreceiver.
NoteTomodelachannelthatinvolvesbothfadingandadditivewhiteGaussiannoise,useafading
channelblockconnectedinserieswiththeAWGNChannelblock,wherethefadingchannelblock
comesfirst.
Thetablebelowindicatesthesituationsinwhicheachfadingchannelblockisappropriate.
SignalPath
ChannelBlock
Directlineofsightpathfromtransmittertoreceiver
MultipathRicianFadingChannel
Oneormoremajorreflectedpathsfromtransmitter
toreceiver
MultipathRayleighFadingChannel
Inthecaseofmultiplemajorreflectedpaths,asingleinstanceoftheMultipathRayleighFadingChannel
blockcanmodelallofthemsimultaneously.Thenumberofpathsthattheblockusesisthelengthofeither
theDelayvectorortheGainvectorparameter,whicheverlengthislarger.(Ifbothoftheseparametersare
vectors,theymusthavethesamelengthifexactlyoneoftheseparametersisascalar,theblockexpandsit
intoavectorwhosesizematchesthatoftheothervectorparameter.)
Choosingappropriateblockparametersforyoursituationisimportant.Formoredetailsaboutthe
parametersoffadingchannelblocks,see
ThereferencepagesfortheMultipathRayleighFadingChannelblockandtheMultipathRician
FadingChannelblock
TheChooseRealisticChannelPropertyValuessectionunder"ConfiguringChannelObjects"inthe
CommunicationsSystemToolboxdocumentation
CompensateforFadingResponse
Acommunicationsysteminvolvingafadingchannelusuallyrequirescomponent(s)thatcompensateforthe
fadingresponse.Typicalapproachestocompensateforfadinginclude:
Differentialmodulationoraonetapequalizerhelpscompensateforafrequencyflatfadingchannel.See
theMDPSKModulatorBasebandblockHelppageortheexampleinCompareEmpiricalResultsto
TheoreticalResultsforinformationaboutimplementingdifferentialmodulation.
Anequalizerwithmultipletapshelpscompensateforafrequencyselectivefadingchannel.See
Equalizationformoreinformation.
TheCommunications Link with Adaptive Equalizationexampleillustrateswhycompensatingfora
fadingchannelisnecessary.
VisualizeaFadingChannel
Youcanplotafadingchannel'scharacteristicsusingchannelvisualizationtools.
Forcommunicationsystemsthatyouimplementusingobjects,seeChannelVisualization.
Forcommunicationsystemsthatyouimplementusingblocks,therearetwowaystovisualizefadingchannel
response.Onewayistodoubleclicktheblockduringasimulation.ThesecondwayistoselectOpen
channelvisualizationatstartofsimulationintheblockdialogbox.
MethodologyforSimulatingMultipathFadingChannels:
TheRayleighandRicianmultipathfadingchannelsimulatorsinCommunicationsSystemToolboxusethe
bandlimiteddiscretemultipathchannelmodelofsection9.1.3.5.2in[1].Thisimplementationassumesthat
thedelaypowerprofileandtheDopplerspectrumofthechannelareseparable[1].Themultipathfading
{ }
channelisthereforemodeledasalinearfiniteimpulseresponse(FIR)filter.Let si denotethesetof
{ }
samplesattheinputtothechannel.Thenthesamples yi attheoutputofthechannelarerelatedto
{ }
si through:
N
yi =
{
n=N
singn
where gn isthesetoftapweightsgivenby:
gn =
ak sinc k n, N 1 n N 2
Ts
k=1
K
Intheequationsabove:
Tsistheinputsampleperiodtothechannel.
{ }
k ,where1 k K,isthesetofpathdelays.Kisthetotalnumberofpathsinthemultipathfading
channel.
}
ak ,where1 k K,isthesetofcomplexpathgainsofthemultipathfadingchannel.Thesepath
gainsareuncorrelatedwitheachother.
N 1andN 2arechosensothatgnissmallwhennislessthanN 1orgreaterthanN 2.
Twotechniques,filteredGaussiannoiseandsumofsinusoids,areusedtogeneratethesetofcomplexpath
gains,ak .
Eachpathgainprocessak isgeneratedbythefollowingsteps:
FilteredGaussianNoiseTechnique
1. Acomplexuncorrelated(white)Gaussianprocesswithzeromeanandunitvarianceisgeneratedin
discretetime.
2. ThecomplexGaussianprocessisfilteredbyaDopplerfilterwithfrequencyresponseH (f) =
whereS(f)denotesthedesiredDopplerpowerspectrum.
S(f),
3. ThefilteredcomplexGaussianprocessisinterpolatedsothatitssampleperiodisconsistentwiththatof
theinputsignal.Acombinationoflinearandpolyphaseinterpolationisused.
SumofsinusoidsTechnique
1. MutuallyuncorrelatedRayleighfadingwaveformsaregeneratedusingthemethoddescribedin[2],
wherei=1correspondstotheinphasecomponentandi=2correspondstothequadrature
component.
zk (t) = (1)
(t) + j(2)
(t), k = 1, 2, , K
k
k
(i)
(t)
k
G
=
2
Nk
n=1
(
)
(i)
(i)
cos 2 f k,nt + k,n , i = 1, 2
Where
Nkspecifiesthenumberofsinusoidsusedtomodelasinglepath.
f (i)
isthediscreteDopplerfrequencyandiscalculatedforeachsinusoidcomponentwithinasingle
k,n
path.
(i)
(i)
isthephaseofthenthcomponentofk andisani.i.d.randomvariablehavingauniform
k,n
(
]
distributionovertheinterval 0, 2 .
tisthefadingprocesstime.
(i)
ThediscreteDopplerfrequencies, f k,n,withmaximumshiftfmaxaregivenby
f (i)
k,n
where
(
)
(i)
= f max cos k,n
(
)
1
= f max cos
n
+ (i)
k,0
2N k
2
( )i1
k
(i)
1
, i = 1, 2 and k = 1, 2, , K
k,0
4N k K + 2
2. Inordertoadvancethefadingprocessintime,aninitialtimeparameter,tinit,isintroduced.Thefading
waveformsbecome
(i)
(t)
k
G
=
2
Nk
n=1
(
)
(
)
(i)
(i)
cos 2 f k,n t + t init + k,n , i = 1, 2
Whentinit=0,thefadingprocessstartsattimezero.Apositivevalueoftinitadvancesthefading
processrelativetotimezerowhilemaintainingitscontinuity.
3. ChannelfadingsamplesaregeneratedusingtheGMEDS1[2]algorithm.
CalculateComplexCoefficients
Thecomplexprocessresultingfromeithertechnique,zk ,isscaledtoobtainthecorrectaveragepathgain.
InthecaseofaRayleighchannel,thefadingprocessisobtainedas:
ak =
G
k z k
where
[
]
2
k = E ak
InthecaseofaRicianchannel,thefadingprocessisobtainedas:
(
)
zk
G
K r,k
j 2 f
t+
d,LOS,k LOS,k
ak = k G
+
e
K r,k + 1
K r,k + 1
componentofthekthpath(inHz),andLOS,kistheinitialphaseofthelineofsightcomponentofthekth
path(inrad).
Attheinputtothebandlimitedmultipathchannelmodel,thetransmittedsymbolsmustbeoversampledbya
factoratleastequaltothebandwidthexpansionfactorintroducedbypulseshaping.Forexample,ifsinc
pulseshapingisused,forwhichthebandwidthofthepulseshapedsignalisequaltothesymbolrate,then
thebandwidthexpansionfactoris1,andatleastonesamplepersymbolisrequiredattheinputtothe
channel.Ifaraisedcosine(RC)filterwithafactorinexcessof1isused,forwhichthebandwidthofthe
pulseshapedsignalisequaltotwicethesymbolrate,thenthebandwidthexpansionfactoris2,andatleast
twosamplespersymbolarerequiredattheinputtothechannel.
Foradditionalinformation,seethearticleAMatlabbasedObjectOrientedApproachtoMultipath
FadingChannelSimulation(http://www.mathworks.com/matlabcentral/fileexchange/18869amatlab
basedobjectorientedapproachtomultipathfadingchannelsimulation),locatedon
MATLABCentral.
References
[1]Jeruchim,M.C.,Balaban,P.,andShanmugan,K.S.,SimulationofCommunicationSystems,Second
Edition,NewYork,KluwerAcademic/Plenum,2000.
[2]Ptzold,Matthias,ChengXiangWang,andBjornOlavHogstand."TwoNewSumofSinusoidsBased
MethodsfortheEfficientGenerationofMultipleUncorrelatedRayleighFadingWaveforms."IEEE
TransactionsonWirelessCommunications.Vol.8,Number6,2009,pp.31223131.
SpecifyFadingChannels
CommunicationsSystemToolboxmodelsafadingchannelasalinearFIRfilter.Filteringasignalusinga
fadingchannelinvolvesthesesteps:
1. Createachannelobjectthatdescribesthechannelthatyouwanttouse.Achannelobjectisatypeof
MATLABvariablethatcontainsinformationaboutthechannel,suchasthemaximumDopplershift.
2. Adjustpropertiesofthechannelobject,ifnecessary,totailorittoyourneeds.Forexample,youcan
changethepathdelaysoraveragepathgains.
Note:Settingthemaximumpathdelaygreaterthan100samplesmaygenerateanOutof
memory'error.
3. Applythechannelobjecttoyoursignalusingthefilterfunction.
Thissectiondescribeshowtodefine,inspect,andmanipulatechannelobjects.Thetopicsare:
CreatingChannelObjects
DisplayObjectProperties
ChangeObjectProperties
RelationshipsAmongChannelObjectProperties
CreatingChannelObjects
Therayleighchanandricianchanfunctionscreatefadingchannelobjects.Thetablebelowindicatesthe
situationsinwhicheachfunctionissuitable.
Function
Object
SituationModeled
rayleighchan
Rayleighfadingchannelobject
Oneormoremajorreflectedpaths
ricianchan
Ricianfadingchannelobject
Onedirectlineofsightpath,
possiblycombinedwithoneor
moremajorreflectedpaths
Forexample,thecommandbelowcreatesachannelobjectrepresentingaRayleighfadingchannelthatacts
onasignalsampledat100,000Hz.ThemaximumDopplershiftofthechannelis130Hz.
c1 =
ChannelType: 'Rayleigh'
InputSamplePeriod: 1.0000e-005
DopplerSpectrum: [1x1 doppler.jakes]
MaxDopplerShift: 130
PathDelays: 0
AvgPathGaindB: 0
NormalizePathGains: 1
StoreHistory: 0
StorePathGains: 0
PathGains: -0.0428 + 0.4732i
ChannelFilterDelay: 0
ResetBeforeFiltering: 1
NumSamplesProcessed: 0
g=
-0.0428 + 0.4732i
ARicianfadingchannelobjecthasanadditionalpropertythatdoesnotappearabove,namely,ascalar
KFactorproperty.
Formoreinformationaboutwhateachchannelpropertymeans,seethereferencepageforthe
rayleighchanorricianchanfunction.
ChangeObjectProperties
Tochangethevalueofawriteablepropertyofachannelobject,issueanassignmentstatementthatuses
dotnotationonthechannelobject.Morespecifically,dotnotationmeansanexpressionthatconsistsofthe
object'sname,followedbyadot,followedbythenameoftheproperty.
TheexamplebelowillustrateshowtochangetheResetBeforeFilteringproperty,indicatingyoudonot
wanttoresetthechannelbeforeeachfilteringoperation.
c1 =
ChannelType: 'Rayleigh'
InputSamplePeriod: 1.0000e-005
DopplerSpectrum: [1x1 doppler.jakes]
MaxDopplerShift: 130
PathDelays: 0
AvgPathGaindB: 0
NormalizePathGains: 1
StoreHistory: 0
StorePathGains: 0
PathGains: 0.5781 + 0.9020i
ChannelFilterDelay: 0
ResetBeforeFiltering: 1
NumSamplesProcessed: 0
c1 =
ChannelType: 'Rayleigh'
InputSamplePeriod: 1.0000e-005
DopplerSpectrum: [1x1 doppler.jakes]
MaxDopplerShift: 130
PathDelays: 0
AvgPathGaindB: 0
NormalizePathGains: 1
StoreHistory: 0
StorePathGains: 0
PathGains: 0.5781 + 0.9020i
ChannelFilterDelay: 0
ResetBeforeFiltering: 0
NumSamplesProcessed: 0
Note:Somepropertiesofachannelobjectarereadonly.Forexample,youcannotassignanew
valuetotheNumSamplesProcessedpropertybecausethechannelautomaticallycountsthenumberof
samplesithasprocessedsincethelastreset.
RelationshipsAmongChannelObjectProperties
Somepropertiesofachannelobjectarerelatedtoeachothersuchthatwhenoneproperty'svaluechanges,
anotherproperty'svaluemustchangeinsomecorrespondingwaytokeepthechannelobjectconsistent.For
example,ifyouchangethevectorlengthofPathDelays,thenthevalueofAvgPathGaindBmustchangeso
thatitsvectorlengthequalsthatofthenewvalueofPathDelays.Thisisbecausethelengthofeachofthe
twovectorsequalsthenumberofdiscretepathsofthechannel.Fordetailsaboutlinkedpropertiesandan
example,seethereferencepageforrayleighchanorricianchan.
SpecifyDopplerSpectrumofFadingChannel
TheDopplerspectrumofachannelobjectisspecifiedthroughitsDopplerSpectrumproperty.Thevalueof
thispropertymustbeeither:
ADopplerobject.Inthiscase,thesameDopplerspectrumappliestoeachpathofthechannelobject.
AvectorofDopplerobjectsofthesamelengthasthePathDelaysvectorproperty.Inthiscase,the
DopplerspectrumofeachpathisgivenbythecorrespondingDopplerobjectinthevector.
ADopplerobjectcontainsallthepropertiesusedtocharacterizetheDopplerspectrum,withtheexceptionof
themaximumDopplershift,whichisapropertyofthechannelobject.Thissectiondescribeshowtocreate
andmanipulateDopplerobjects,andhowtoassignthemtotheDopplerSpectrumpropertyofchannel
objects.
CreateaDopplerObject
ThesolepurposeofDopplerobjectsistospecifythevalueoftheDopplerSpectrumpropertyofchannel
objects.Dopplerobjectscanbecreatedusingoneofsevenfunctions:doppler.ajakes,
doppler.bigaussian,doppler.jakes,doppler.rjakes,doppler.flat,doppler.gaussian,and
doppler.rounded.Foradescriptionofeachofthesefunctionsandtheunderlyingtheory,refertotheir
correspondingreferencepages.
Forexample,aGaussianspectrumwithanormalized(bythemaximumDopplershiftofthechannel)
standarddeviationof0.1,canbecreatedas:
d = doppler.gaussian(0.1);
DuplicateDopplerObjects
Asinthecaseofchannelobjects,Dopplerobjectscanbeduplicatedusingthecopyfunction.The
command:
d2 = copy(d1);
createsaDopplerobjectd2withthesamepropertiesasthatofd1.d1andd2arethenseparateinstancesof
aDopplerobject,inthatmodifyingeitheronewillnotaffecttheother.Usingd1 = d2insteadwillcauseboth
d1andd2toreferencethesameinstanceofaDopplerobject,inthatmodifyingeitheronewillcausethe
samemodificationtotheother.
ViewandChangeDopplerObjectProperties
ThesyntaxforviewingandchangingDopplerobjectpropertiesisthesameasforthecaseofchannel
objects(seeDisplayObjectPropertiesandChangeObjectProperties).Thefunctiondispcanbeused
withDopplerobjectstodisplaytheirproperties.
Inthefollowingexample,aroundedDopplerobjectwithdefaultpropertiesiscreatedanddisplayed,andthe
thirdelementofitsCoeffRoundedpropertyismodified:
dr = doppler.rounded
dr =
SpectrumType: 'Rounded'
CoeffRounded: [1 -1.7200 0.7850]
dr.CoeffRounded(3) = 0.8250
dr =
SpectrumType: 'Rounded'
CoeffRounded: [1 -1.7200 0.8250]
NotethatthepropertySpectrumType,whichiscommontoallDopplerobjects,isreadonly.Itis
automaticallyspecifiedatobjectconstruction,andcannotbemodified.IfyouwishtouseadifferentDoppler
spectrumtype,youneedtocreateanewDopplerobjectofthedesiredtype.
UseDopplerObjectsWithinChannelObjects
TheDopplerSpectrumpropertyofachannelobjectcanbechangedbyassigningtoitaDopplerobjectora
vectorofDopplerobjects.ThefollowingexampleillustrateshowtochangethedefaultJakesDoppler
spectrumofaconstructedRayleighchannelobjecttoaflatDopplerspectrum:
SigmaGaussian: 0.3000
>> h.DopplerSpectrum.SigmaGaussian = 1.1;
ThefollowingexampleillustrateshowtochangethedefaultJakesDopplerspectrumofaconstructedthree
pathRayleighchannelobjecttoavectorofdifferentDopplerspectra,andthenchangethepropertiesofthe
Dopplerspectrumofthethirdpath:
ConfigureChannelObjects
Beforeyoufilterasignalusingachannelobject,makesurethatthepropertiesofthechannelhavesuitable
valuesforthesituationyouwanttomodel.Thissectionofferssomeguidelinestohelpyouchooserealistic
valuesthatareappropriateforyourmodelingneeds.Thetopicsare
ChooseRealisticChannelPropertyValues
ConfigureChannelObjectsBasedonSimulationNeeds
ThesyntaxesforviewingandchangingvaluesofpropertiesofchannelobjectsaredescribedinSpecify
FadingChannels.
ChooseRealisticChannelPropertyValues
Herearesometipsforchoosingpropertyvaluesthatdescriberealisticchannels:
PathDelays
Byconvention,thefirstdelayistypicallysettozero.Thefirstdelaycorrespondstothefirstarrivingpath.
Forindoorenvironments,pathdelaysafterthefirstaretypicallybetween1nsand100ns(thatis,
between1e9sand1e7s).
Foroutdoorenvironments,pathdelaysafterthefirstaretypicallybetween100nsand10s(thatis,
between1e7sand1e5s).Verylargedelaysinthisrangemightcorrespond,forexample,toanarea
surroundedbymountains.
Note:Settingthemaximumpathdelaygreaterthan100samplesmaygenerateanOutof
memory'error.
Theabilityofasignaltoresolvediscretepathsisrelatedtoitsbandwidth.Ifthedifferencebetweenthe
largestandsmallestpathdelaysislessthanabout1%ofthesymbolperiod,thenthesignalexperiences
thechannelasifithadonlyonediscretepath.
AveragePathGains
Theaveragepathgainsinthechannelobjectindicatetheaveragepowergainofeachfadingpath.In
practice,anaveragepathgainvalueisalargenegativedBvalue.However,computermodelstypically
useaveragepathgainsbetween20dBand0dB.
ThedBvaluesinavectorofaveragepathgainsoftendecayroughlylinearlyasafunctionofdelay,but
thespecificdelayprofiledependsonthepropagationenvironment.
Toensurethattheexpectedvalueofthepathgains'totalpoweris1,youcannormalizepathgainsvia
thechannelobject'sNormalizePathGainsproperty.
MaximumDopplerShifts
Somewirelessapplications,suchasstandardGSM(GlobalSystemforMobileCommunication)
systems,prefertospecifyDopplershiftsintermsofthespeedofthemobile.Ifthemobilemovesat
speedv(m/s),thenthemaximumDopplershiftiscalculatedasfollows,wherefisthetransmission
carrierfrequencyinHertzandcisthespeedoflight(3e8m/s).
fd =
vf
c
Basedonthisformulaintermsofthespeedofthemobile,asignalfromamovingcaronafreewaymight
experienceamaximumDopplershiftofabout80Hz,whileasignalfromamovingpedestrianmight
experienceamaximumDopplershiftofabout4Hz.Thesefiguresassumeatransmissioncarrier
frequencyof900MHz.
AmaximumDopplershiftof0correspondstoastaticchannelthatcomesfromaRayleighorRician
distribution.
KFactorforRicianFadingChannels
TheRicianKfactorspecifiestheratioofspeculartodiffusepowerforadirectlineofsightpath.The
ratioisexpressedlinearly,notindB.
ForRicianfading,theKfactoristypicallybetween1and10.
AKfactorof0correspondstoRayleighfading.
DopplerSpectrumParameters
SeethereferencepagesfortherespectiveDopplerobjectsfordescriptionsoftheparametersandtheir
significance.
ConfigureChannelObjectsBasedonSimulationNeeds
Herearesometipsforconfiguringachannelobjecttocustomizethefilteringprocess:
Ifyourdataispartitionedintoaseriesofvectors(thatyouprocesswithinaloop,forexample),youcan
invokethefilterfunctionmultipletimeswhileautomaticallysavingthechannel'sstateinformationfor
useinasubsequentinvocation.Thestateinformationisvisibletoyouinthechannelobject'sPathGains
andNumSamplesProcessedproperties,butalsoinvolvespropertiesthatareinternalratherthanvisible.
Note:Tomaintaincontinuityfromoneinvocationtothenext,youmustsetthe
ResetBeforeFilteringpropertyofthechannelobjectto0.
IfyousettheResetBeforeFilteringpropertyofthechannelobjectto0andwanttherandomnessto
berepeatable,usetheresetfunctionbeforefilteringanysignalstoresetboththechannelandthestate
oftheinternalrandomnumbergenerator.
Ifyouwanttoresetthechannelbeforeafilteringoperationsothatitdoesnotuseanypreviouslystored
stateinformation,eitherusetheresetfunctionorsettheResetBeforeFilteringpropertyofthe
channelobjectto1.Theformermethodresetsthechannelobjectonce,whilethelattermethodcauses
thefilterfunctiontoresetthechannelobjecteachtimeyouinvokeit.
Ifyouwanttonormalizethefadingprocesssothattheexpectedvalueofthepathgains'totalpoweris1,
settheNormalizePathGainspropertyofthechannelobjectto1.
UseFadingChannels
AfteryouhavecreatedachannelobjectasdescribedinSpecifyFadingChannels,youcanusethefilter
functiontopassasignalthroughthechannel.Theargumentstofilterarethechannelobjectandthe
signal.Attheendofthefilteringoperation,thechannelobjectretainsitsstatesothatyoucanfindoutthe
finalpathgainsorthetotalnumberofsamplesthatthechannelhasprocessedsinceitwascreatedorreset.
Ifyouconfiguredthechanneltoavoidresettingitsstatebeforeeachnewfilteringoperation
(ResetBeforeFilteringis0),thentheretentionofstateinformationisimportantformaintainingcontinuity
betweensuccessivefilteringoperations.
Foranexamplethatillustratesthebasicsyntaxandstateretention,seePowerofaFadedSignal.
Ifyouwanttousethechannelvisualizationtooltoplotthecharacteristicsofachannelobject,youneedto
settheStateHistorypropertyofthechannelobjectto1sothatitispopulatedwithplotinformation.See
ChannelVisualizationfordetails.
RayleighFadingChannel
Thefollowingexamplesusefadingchannels:
PowerofaFadedSignal
CompareEmpiricalResultstoTheoreticalResults
WorkwithDelays
FilterUsingaLoop
StoreChannelStateHistory
UsetheChannelVisualizationTool
PowerofaFadedSignal
Thecodebelowplotsafadedsignal'spower(versussamplenumber).Thecodealsoillustratesthesyntaxof
thefilterandrayleighchanfunctionsandthestateretentionofthechannelobject.Noticefromthe
outputthatNumSamplesProcessedequalsthenumberofelementsinsig,thesignal.
c = rayleighchan(1/10000,100);
sig = 1i*ones(2000,1); % Generate signal
y = filter(c,sig);
% Pass signal through channel
c
% Display all properties of the channel
% Plot power of faded signal, versus sample number.
plot(20*log10(abs(y)))
Theoutputandtheplotfollow.
c=
ChannelType: 'Rayleigh'
InputSamplePeriod: 1.0000e-004
DopplerSpectrum: [1x1 doppler.jakes]
MaxDopplerShift: 100
PathDelays: 0
AvgPathGaindB: 0
NormalizePathGains: 1
StoreHistory: 0
StorePathGains: 0
PathGains: -0.8062 + 0.2648i
ChannelFilterDelay: 0
ResetBeforeFiltering: 1
NumSamplesProcessed: 2000
CompareEmpiricalResultstoTheoreticalResults
ThecodebelowcreatesafrequencyflatRayleighfadingchannelobjectandusesittoprocessaDBPSK
signalconsistingofasinglevector.Theexamplecontinuesbycomputingthebiterrorrateofthesystemfor
differentvaluesofthesignaltonoiseratio.Noticethattheexampleusesfilterbeforeawgnthisisthe
recommendedsequencetousewhenyoucombinefadingwithAWGN.
WorkwithDelays
Thevalueofachannelobject'sChannelFilterDelaypropertyisthenumberofsamplesbywhichthe
outputofthechannellagstheinput.Ifyoucomparetheinputandoutputdatasetsdirectly,youmusttake
thedelayintoaccountbyusingappropriatetruncatingorpaddingoperations.
Theexampleillustratesonewaytoaccountforthedelaybeforecomputingabiterrorrate.
M = 2;
% DQPSK modulation order
bitRate = 50000;
hMod = comm.DBPSKModulator;
% Create a DPSK modulator
hDemod = comm.DBPSKDemodulator;
% Create a DPSK demodulator
% Create Rayleigh fading channel object.
ch = rayleighchan(1/bitRate,4,[0 0.5/bitRate],[0 -10]);
delay = ch.ChannelFilterDelay;
tx = randi([0 M-1],50000,1);
stream
dpskSig = step(hMod,tx);
fadedSig = filter(ch,dpskSig);
% Apply channel effects
rx = step(hDemod,fadedSig); % Demodulate signal
% Compute bit error rate, taking delay into account.
hErrorCalc = comm.ErrorRate('ReceiveDelay', delay);
berVec = step(hErrorCalc,tx,rx);
ber = berVec(1)
num = berVec(2)
Theoutputbelowshowsthattheerrorrateissmall.Iftheexamplehadnotcompensatedforthechannel
delay,theerrorratewouldhavebeencloseto1/2.
num =
845
ber =
0.0170
FilterUsingaLoop
ThesectionConfigureChannelObjectsBasedonSimulationNeedsindicateshowtoinvokethefilter
functionmultipletimeswhilemaintainingcontinuityfromoneinvocationtothenext.Theexamplebelow
invokesfilterwithinaloopandusesthesmalldatasetsfromsuccessiveiterationstocreateananimated
effect.TheparticularchannelinthisexampleisaRayleighfadingchannelwithtwodiscretemajorpaths.
% Set up parameters.
M = 4;
% QPSK modulation order
hMod = comm.QPSKModulator;
bitRate = 50000;
% Data rate is 50 kb/s
numTrials = 125;
% Number of iterations of loop
% Create Rayleigh fading channel object.
ch = rayleighchan(1/bitRate,4,[0 2e-5],[0 -9]);
% Indicate that FILTER should not reset the channel
% in each iteration below.
ch.ResetBeforeFiltering = 0;
% Initialize scatter plot.
hConst = comm.ConstellationDiagram;
% Apply channel in a loop, maintaining continuity.
% Plot only the current data in each iteration.
for n = 1:numTrials
tx = randi([0 M-1],500,1);
% Generate random bit stream
pskSig = step(hMod,tx);
% PSK modulate signal
fadedSig = filter(ch, pskSig); % Apply channel effects
% Plot the new data from this iteration.
step(hConst,fadedSig);
end
Thescatterplotchangeswitheachiterationoftheloop,andtheexactcontentvariesbecausethefading
processinvolvesrandomnumbers.
StoreChannelStateHistory
Bydefault,thePathGainspropertyofachannelobjectstoresthecurrentcomplexpathgainvector.
SettingtheStoreHistorypropertyofachanneltotruemakesitstorethelastNpathgainvectors,whereN
isthelengthofthevectorprocessedthroughthechannel.Thefollowingcodeillustratesthisproperty
h = rayleighchan(1/100000, 130);
tx = randi([0 1],10,1);
hmod = comm.DBPSKModulator;
dpskSig = step(hmod,tx);
step method
h.StoreHistory = true;
y = filter(h, dpskSig);
h.PathGains
gains data
Thisexamplegeneratesanoutputsimilartothefollowing:
-0.7601 - 1.1853i
-0.7540 - 1.1822i
-0.7480 - 1.1791i
-0.7419 - 1.1759i
-0.7358 - 1.1728i
-0.7298 - 1.1696i
-0.7237 - 1.1665i
-0.7177 - 1.1634i
-0.7115 - 1.1599i
-0.7053 - 1.1565i
ans =
0.0788 - 0.5305i
Thelastelementisthecurrentpathgainofthechannel.
% Rayleigh channel
% Random bit stream
% Create DBPSK Modulator
% Process data by calling the
% Allow states to be stored
% Run signal through channel
% Display the stored path
SettingStoreHistorytotruesignificantlyslowsdowntheexecutionspeedofthechannel'sfilterfunction.
UsetheChannelVisualizationTool
CommunicationsSystemToolboxsoftwareprovidesaplottingfunctionthathelpsyouvisualizethe
characteristicsofafadingchannelusingaGUI.SeeFadingChannelsforadescriptionoffadingchannels
andobjects.
Toopenthechannelvisualizationtool,typeplot(h)atthecommandline,wherehisachannelobjectthat
containsplotinformation.Topopulateachannelobjectwithplotinformation,runasignalthroughitafter
settingitsStoreHistorypropertytotrue.
Forexample,thefollowingcodeopensthechannelvisualizationtoolshowingathreepathRayleighchannel
throughwhicharandomsignalispassed:
SeeExamplesofUsingtheChannelVisualizationToolforthebasicusagecasesofthechannel
visualizationtool.
ThistoolcanalsobeaccessedfromCommunicationsSystemToolboxsoftware.
PartsoftheGUI.TheVisualizationpulldownmenuallowsyoutochoosethevisualizationmethod.
TheFramecountcountershowstheindexofthecurrentframe.Itshowsthenumberofframesprocessed
bythefiltermethodsincethechannelobjectwasconstructedorreset.AframeisavectorofMelements,
interpretedtobeMsuccessivesamplesthatareuniformlyspacedintime,withasampleperiodequaltothat
specifiedforthechannel.
TheSampleindexslidercontrolindicateswhichchannelsnapshotiscurrentlybeingdisplayed,whilethe
Pausebuttonpausesarunninganimationuntilyouclickitagain.TheslidercontrolandPausebuttonapply
toallvisualizationsexcepttheDoppler Spectrum.
TheAnimationpulldownmenuallowsyoutoselecthowyouwanttodisplaythechannelsnapshotswithin
eachframe.SettingthistoSlowmakesthetoolshowchannelsnapshotsinsuccession,startingatthe
samplesetbytheSampleindexslidercontrol.SelectingMediumorFastmakesthetoolshowfewer
uniformlyspacedsnapshots,allowingyoutogothroughthechannelsnapshotsmorerapidly.Selecting
Interframe only(thedefaultselection)preventsautomaticanimationofsnapshotswithinthesameframe.
TheAnimationmenuappliestoallvisualizationsexcepttheDoppler Spectrum.
VisualizationOptions.Thechannelvisualizationtoolplotsthecharacteristicsofafilterinvariousways.
SimplychoosethevisualizationmethodfromtheVisualizationmenu,andtheplotupdatesitself
automatically.
Thefollowingvisualizationmethodsarecurrentlyavailable:
ImpulseResponse(IR).
Thisplotshowsthemagnitudesoftwoimpulseresponses:themultipathresponse(infinitebandwidth)and
thebandlimitedchannelresponse.
Themultipathresponseisrepresentedbystems,eachcorrespondingtoonemultipathcomponent.The
componentwiththesmallestdelayvalueisshowninred,andthecomponentwiththelargestdelayvalueis
showninblue.Componentswithintermediatedelayvaluesareshadesbetweenredandblue,becoming
moreblueforlargerdelays.
Thebandlimitedchannelresponseisrepresentedbythegreencurve.Thisresponseistheresultof
convolvingthemultipathimpulseresponse,describedabove,withasincpulseofperiod,T,equaltothe
inputsignal'ssampleperiod.
Thesolidgreencirclesrepresentthechannelfilterresponsesampledatrate1/T.Theoutputofthechannel
filteristheconvolutionoftheinputsignal(sampledatrate1/T)withthisdiscretetimeFIRchannelfilter
response.Forcomputationalspeed,theresponseistruncated.
Thehollowgreencirclesrepresentsamplevaluesnotcapturedinthechannelfilterresponsethatisusedfor
processingtheinputsignal.
Notethattheseimpulseresponsesvaryovertime.Youcanusetheslidertovisualizehowtheimpulse
responsechangesovertimeforthecurrentframe(i.e.,inputsignalvectorovertime).
FrequencyResponse(FR).
Thisplotshowsthemagnitude(indB)ofthefrequencyresponseofthemultipathchanneloverthesignal
bandwidth.
Aswiththeimpulseresponsevisualization,youcanvisualizehowthisfrequencyresponsechangesover
time.
IRWaterfall.
Thisplotshowstheevolutionofthemagnitudeimpulseresponseovertime.
Itshows10snapshotsofthebandlimitedchannelimpulseresponsewithinthelastframe,withthedarkest
greencurveshowingthecurrentresponse.
Thetimeoffsetisthetimeofthechannelsnapshotrelativetothecurrentresponsetime.
PhasorTrajectory.
Thisplotshowsphasors(vectorsrepresentingmagnitudeandphase)foreachmultipathcomponent,using
thesamecolorcodethatwasusedfortheimpulseresponseplot.
Thephasorsareconnectedendtoendinorderofpathdelay,andthetrajectoryoftheresultantphasoris
plottedasagreenline.Thisresultantphasorisreferredtoasthenarrowbandphasor.
Thisplotcanbeusedtodeterminetheimpactofthemultipathchannelonanarrowbandsignal.A
narrowbandsignalisdefinedhereashavingasampleperiodmuchgreaterthanthespanofdelaysofthe
multipathchannel(alternatively,asignalbandwidthmuchsmallerthanthecoherencebandwidthofthe
channel).Thus,themultipathchannelcanberepresentedbyasinglecomplexgain,whichisthesumofall
themultipathcomponentgains.Whenthenarrowbandphasortrajectorypassesthroughorneartheorigin,it
correspondstoadeepnarrowbandfade.
MultipathComponents.
Thisplotshowsthemagnitudesofthemultipathgainsovertime,usingthesamecolorcodeasthatusedfor
themultipathimpulseresponse.
Thetrianglemarkerandverticaldashedlinerepresentthestartofthecurrentframe.Ifaframehasbeen
processedpreviously,itsmultipathgainsmayalsobedisplayed.
MultipathGain.
Thisplotshowsthecollectivegainsforthemultipathchannelforthreesignalbandwidths.
Acollectivegainisthesumofcomponentmagnitudes,asexplainedinthefollowing:
Narrowband(magentadots):Thisisthemagnitudeofthenarrowbandphasorintheabovetrajectory
plot.Thiscurveissometimesreferredtoasthenarrowbandfadingenvelope.
Currentsignalbandwidth(dashedblueline):Thisisthesumofthemagnitudesofthechannelfilter
impulseresponsesamples(thesolidgreendotsintheimpulseresponseplot).Thiscurverepresentsthe
maximumsignalenergythatcanbecapturedusingaRAKEreceiver.Itsvalue(ormetrics,suchas
theoreticalBER,derivedfromit)issometimesreferredtoasthematchedfilterbound.
Infinitebandwidth(solidredline):Thisisthesumofthemagnitudesofthemultipathcomponentgains.
Ingeneral,thevariabilityofthismultipathgain,orofthesignalfading,decreasesassignalbandwidthis
increased,becausemultipathcomponentsbecomemoreresolvable.Ifthesignalbandwidthcurveroughly
followsthenarrowbandcurve,youmightdescribethesignalasnarrowband.Ifthesignalbandwidthcurve
roughlyfollowstheinfinitebandwidthcurve,youmightdescribethesignalaswideband.Withtheright
receiver,awidebandsignalexploitsthepathdiversityinherentinamultipathchannel.
DopplerSpectrum.
ThisplotshowsuptotwoDopplerspectra.
ThefirstDopplerspectrum,representedbythedashedredline,isatheoreticalspectrumbasedonthe
Dopplerfilterresponseusedinthemultipathchannelmodel.Intheprecedingplot,thetheoreticalDoppler
spectrumusedforthemultipathchannelmodelisknownastheJakesspectrum.Notethattheplotted
Dopplerspectrumisnormalizedtohaveatotalpowerof1.ThisDopplerspectrumisusedtodeterminea
Dopplerfilterresponse.Forpracticalpurposes,theDopplerfilterresponseistruncated,whichhastheeffect
ofmodifyingtheDopplerspectrum,asshownintheplot.
ThesecondDopplerspectrum,representedbythebluedots,isdeterminedbymeasuringthepower
spectrumofthemultipathfadingchannelasthemodelgeneratespathgains.Thismeasurementis
meaningfulonlyafterenoughpathgainshavebeengenerated.Thetitleabovetheplotreportshowmany
samplesneedtobeprocessedthroughthechannelbeforeeitherthefirstDopplerspectrumoranupdated
spectrumcanbeplotted.
ThePathNumbereditboxallowsyoutovisualizetheDopplerspectrumofthespecifiedpath.Thevalue
enteredinthisboxmustbeavalidpathnumber,i.e.,between1andthelengthofthePathDelaysvector
property.Onceyouchangethevalueofthisfield,thenewDopplerspectrumwillappearassoonasthe
processingofthecurrentframehasended.
IfthemeasuredDopplerspectrumisagoodapproximationofthetheoreticalDopplerspectrum,the
multipathchannelmodelhasgeneratedenoughfadinggainstoyieldareasonablerepresentationofthe
channelstatistics.Forinstance,ifyouwanttodeterminetheaverageBERofacommunicationslinkwitha
multipathchannelandyouwantastatisticallyaccuratemeasureofthisaverage,youmaywanttoensure
thatthechannelhasprocessedenoughsamplestoyieldatleastoneDopplerspectrummeasurement.
Itispossiblethatamultipathchannel(e.g.,aRicianchannel)canhavebothspecular(lineofsight)and
diffusecomponents.Insuchacase,theDopplerspectrumwouldhavebothalinecomponentanda
widebandcomponent.ThechannelvisualizationtoolonlyshowsthewidebandcomponentfortheDoppler
spectrum.
Unlikeothervisualizations,theDopplerspectrumvisualizationdoesnotsupportanimation.Becausethereis
nointraframedatatoplot,thevisualizationtoolonlyupdatesthechannelstatisticsattheendofeachframe
andthereforecannotpauseinthemiddleofaframe.IfyouswitchtotheDopplerspectrumvisualizationfrom
adifferentvisualizationthatisinpausemode,thePausebuttonissubsequentlydisabled.Disablingpause
avoidsinteractionproblemsbetweentheDopplerspectrumvisualizationandotheranimationstyle
visualizations.
ScatteringFunction.
ThisplotshowstheDopplerspectraofeachpathversusthepathdelays,usingthesamecolorcodeasthat
usedforthemultipathimpulseresponse.
TheprincipleofoperationoftheScatteringFunctionplotissimilartothatoftheDopplerSpectrumplot.The
maindifferenceisthattheDopplerspectraonthisplotarenotnormalizedastheyareontheDoppler
Spectrumplot,inordertobettervisualizethepowerdelayprofile.
CompositePlots.
Severalcompositeplotsarealsoavailable.Thesearechosenbyselectingthefollowingfromthe
Visualizationpulldownmenu:
IR and FRforimpulseresponseandfrequencyresponseplots.
Components and Gainformultipathcomponentsandmultipathgainplots.
Components and IRformultipathcomponentsandimpulseresponseplots.
Components, IR, and Phasorformultipathcomponents,impulseresponse,andphasortrajectory
plots.
ExamplesofUsingtheChannelVisualizationTool.Herearetwoexamplesthatshowhowyoumight
interactwiththeGUI.
VisualizeSamplesWithinaFrame.
Thisexampleshowshowtovisualizesampleswithinaframethroughanimation.Thefollowinglinesofcode
createaRayleighchannelandopenthechannelvisualizationtool:
controlallthewaytotheleftandclickResume.Theslidercontrolmovesbyitselfduringanimation.The
sampleindexincrementsautomaticallytoshowwhichsnapshotyouarevisualizing.
Youcanalsomovetheslidercontrolandglancethroughthesamplesoftheframeasyoulike.
AnimateSnapshotsAcrossFrames.
Thisexampleshowshowtoanimatesnapshotsacrossframes.Thefollowinglinesofcodecallthefilterand
plotmethodswithinalooptoaccomplishthis:
Ts = 1e-4;
fd = 100;
% Number of trials
% Number of samples per frame
RicianFadingChannel
QuasiStaticChannelModeling
Typically,apathgaininafadingchannelchangesinsignificantlyoveraperiodof1/(100fd)seconds,wherefd
isthemaximumDopplershift.Becausethisperiodcorrespondstoaverylargenumberofbitsinmany
modernwirelessdataapplications,assessingperformanceoverastatisticallysignificantrangeoffading
entailssimulatingaprohibitivelylargeamountofdata.Quasistaticchannelmodelingprovidesamore
tractableapproach,whichyoucanimplementusingthesesteps:
1. GeneratearandomchannelrealizationusingamaximumDopplershiftof0.
2. Processsomelargenumberofbits.
3. Computeerrorstatistics.
4. Repeatthesestepsmanytimestoproduceadistributionoftheperformancemetric.
Theexamplebelowillustratesthequasistaticchannelmodelingapproach.
M = 4;
% DQPSK modulation order
hMod = comm.DQPSKModulator;
% Create a DPSK modulator
hDemod = comm.DQPSKDemodulator;
% Create a DPSK demodulator
numBits = 10000;
numTrials = 20;
tx = randi([0 M-1],numBits,1);
% Generate random bit
stream
dpskSig = step(hMod, tx);
% DPSK modulate signal
fadedSig = filter(chan, dpskSig);
% Apply channel effects
rxSig = step(hChan,fadedSig);
% Add Gaussian
noise.
rx = step(hDemod,rxSig);
% Demodulate.
% Compute number of symbol errors.
% Ignore first sample because of DPSK initial condition.
serVec(:,n) = step(hErrorCalc,tx(2:end),rx(2:end));
end
nErrors = serVec(2,:)
per = mean(nErrors > 0) % Proportion of packets that had errors
Whiletheexampleruns,theCommandWindowdisplaysthegrowinglistofsymbolerrorcountsinthevector
nErrors.Italsodisplaysthepacketerrorrateattheend.Thesampleoutputbelowshowsafinalvalueof
nErrorsandomitsintermediatevalues.Yourresultsmightvarybecauseofrandomnessintheexample.
nErrors =
Columns 1 through 9
0
Columns 10 through 18
0
Columns 19 through 20
0
216
per =
0.1000
MoreAbouttheQuasiStaticTechnique.Asanexampletoshowhowthequasistaticchannelmodeling
approachcansavecomputation,considerawirelesslocalareanetwork(LAN)inwhichthecarrierfrequency
is2.4GHz,mobilespeedis1m/s,andbitrateis10Mb/s.Thefollowingexpressionshowsthatthechannel
changesinsignificantlyover12,500bits:
1
100 f d
(
) (
s 10 Mb/s =
)
(
)
c
s 10 Mb/s
100vf
(
)
3 108 m/s
10 Mb/s
100(1 m/s)(2.4 GHz)
= 12, 500 b
=
AtraditionalMonteCarloapproachforcomputingtheerrorrateofthissystemwouldentailsimulating
thousandsoftimesthenumberofbitsshownabove,perhapstensofmillionsofbits.Bycontrast,aquasi
staticchannelmodelingapproachwouldsimulateafewpacketsateachofabout100locationstoarriveata
spatialdistributionoferrorrates.Fromthisdistributiononecoulddetermine,forexample,howreliablethe
communicationlinkisforarandomlocationwithintheindoorspace.Ifeachsimulationcontains5,000bits,
100simulationswouldprocesshalfamillionbitsintotal.Thisissubstantiallyfewerbitscomparedtothe
traditionalMonteCarloapproach.
AdditionalExamplesUsingFadingChannels
Thefollowingmodelsincludetheuseoffadingchannels:
RayleighFadingChannel,whichillustratesthechannel'seffectonaQPSKmodulatedsignal
IEEE802.11aWLANPhysicalLayer
DefenseCommunications:USMILSTD188110B
WCDMAEndtoEndPhysicalLayer