蜂窩小區(qū)同頻干擾的Matlab仿真設(shè)計(jì)_第1頁
蜂窩小區(qū)同頻干擾的Matlab仿真設(shè)計(jì)_第2頁
蜂窩小區(qū)同頻干擾的Matlab仿真設(shè)計(jì)_第3頁
蜂窩小區(qū)同頻干擾的Matlab仿真設(shè)計(jì)_第4頁
蜂窩小區(qū)同頻干擾的Matlab仿真設(shè)計(jì)_第5頁
已閱讀5頁,還剩5頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

.

/

Lab4:

Writeaprogramtocalculatethesignalinterferenceratio<SIR>intheforwardlink,andrepeatsitbyrandomlychangingthepositionoftheMS.Afteranumberofsimulations,usethesimulatedresultstodrawthehistogramoftheSIR<S=I>.TrytoobtainhistogramswithdifferentpathlossexponentnandclustersizeN.Concludeyourresults.

Theco-channelinterferenceintheforwardlinkcanbecharacterizedinfigure1.AMSwillbeinterferedbytheco-channelbasestation.Inoursimulation,weconsiderthe18co-channelcell,including6cellsinthefirstloopand12cellsinthesecond,nomatterwhattheclustersizeNis.

Figure1forwardlinkco-channelinterference

Firstly,weshouldrandomlychoosethepositionoftheMSinthecell.Sincethecellishexagonwhichishardtohandlewecutandpasteitintoasquare.Aswecanseeinfigure2,thecenterofthecoordinationisthecenterofthecell.ThesquarewechooseisABCD.WethenrandomlychooseapairofxandyasthecoordinateofMS.IfMSlocatesintriangle1wecutandpasteittotriangle3andifitlocatesintriangle2wemoveittotriangle4.

Weassumetherangeofthebasestationis0.1asradiusofclusteris1.FortheMSwholocatedwithinthisarea,wechangeitsdistancetobe0.1asitistooclosetothebasestaion.

Figure2randomlychoosethepositionofMSinacell

Matlabcode:RandPOS.m

function[z]=RandPOS<m>

%********getrandomvalueofx,ywithinasquare*****%

x=1.5*rand<m,1>-1;

y=sqrt<3>*rand<m,1>-0.5*sqrt<3>;

%********useforlooptocutthesquareintoahexagon*****%

fork=1:m

ifx<k>>-1&&x<k><-0.5&&y<k>><1+x<k>>*sqrt<3>

x<k>=x<k>+1.5;

y<k>=y<k>-sqrt<3>/2;

elseifx<k>>-1&&x<k><-0.5&&y<k><-<1+x<k>>*sqrt<3>

x<k>=x<k>+1.5;

y<k>=y<k>+sqrt<3>/2;

end

%********iftheMSistoonearlytothebasestation******%

ifsqrt<x<k>^2+y<k>^2><0.1

x<k>=0.1;

y<k>=0;

end

end

z=x+j*y;

Secondly,weshouldcalculatethecoordinateofco-channelbasestation.AsweknowtheclustersizeNwecancalculatethe<i,j>pairbytheformulaN=i2+i*j+j2.

Matlabcode:ClusterN.m

function[ii,jj]=ClusterN<N>

fora=0:sqrt<N>

forb=0:sqrt<N>

ifa^2+b^2+a*b==N

ii=a;

jj=b;

end;%endif

end;%forjj

end;

TakingN=7asexample,wecancalculatethecoordinatebyreferringtofigure3.AccordingtothevalueofIjpairandanglesinthefigurewecangetthecoordinateofthefirstloopbytheformula:location<k>=3×<i×ej×pi6+j×pi3×k-1+j×ej×pi6+j×pi3×k>,wherek=1,2….6.Thesecondloopcanbecalculatedbythefirstloop.Therearetwokindsofsecondloopco-channelbasestation.Onecanbecalculatedbydoublethecoordinateofthefirstlooppoints.Theothercanbedonebyaddingcoordinatesofadjacentfirstlooppointasitisthediagnoseofaparallelogram.Examplesofthosetwokindsofpoints,point1and2,canbefoundinfigure3

diagnoseofaparallelogram

doublethecoordinateofthefirstlooppoints

Figure3calculatecoordinateofco-channelbasestationbyIJpair

Matlabcode:AdjCel.m

function[CelLoc]=AdjCel<N>

[ii,jj]=ClusterN<N>

CelLoc=zeros<18,1>+j*zeros<18,1>;

CelLoc<1>=sqrt<3>*<ii*exp<j*pi/6>+jj*exp<j*pi/6+j*pi/3>>;

fork=2:6

CelLoc<k>=CelLoc<k-1>*<0.5+sqrt<3>/2*j>;

end;

fori=1:6

CelLoc<2*i+5>=CelLoc<i>+CelLoc<i>;

CelLoc<2*i+6>=CelLoc<i>+CelLoc<i+1>;

end;

CelLoc<18>=CelLoc<6>+CelLoc<1>;

NowwehavecoordinatesofMSandco-channelbasestation,sowecancalculateSIRbytheformulaSIR=<dms>-ni=118<dbsi>-n,wheredmsstandsforthedistancefromMStothecenterwhiledbsistandsforthedistancefromtheco-channelbasestationtotheMS.Wesimulatedit100000times.

Matlabcode:

clearall

closeall

N=input<'theclustersizeN='>;

n=input<'thepathlossexponentn='>

M=100000;

MSPos=RandPOS<M>;

CelLoc=AdjCel<N>;

ds=<abs<MSPos>>.^-n;

ditemp1=abs<MSPos*<ones<18,1>>'-ones<M,1>*CelLoc'>;

ditemp2=ditemp1.^-n;

di=ditemp2*ones<18,1>;

SIR=10*log<ds./di>;

hist<SIR,[-20:250]>

title<'Histogram'>;

xlabel<'SIR<dB>'>;

ylabel<'numbersofMS'>;

Rsults:

WewillsimulatetheSIRoftheco-interferenceoftheforwardinglinkwithdifferentclustersize‘N’andpathloseexponent‘n’andplaintthehistogramofeachcondition.Tomakeacomparison,wechosetwogroupofnandNas:

Whenn=3.6,weletN=1,3,4,7,12.

WhenN=7,weletn=2,3,3.5,4.

Figure5histogramofSIRwhileN=1,n=3.6

<dd0>-n.d0istherangeofthebasestation.

IftherandomMSistoonearlytothebasestation,d<d0ord=0,theSIRwillbetoohigh.

Sowhend<d0,weletd=d0toremovetheBS.

Thesmallestvalueofdis0.1.ItrelatedthelargestvalueofSIR.

Figure6histogramofSIRwhileN=3,n=3.6

Figure7histogramofSIRwhileN=4,n=3.6

Figure8histogramofSIRwhileN=7,n=3.6

Figure9histogramofSIRwhileN=12,n=3.6

Figure10histogramofSIRwhileN=7,n=2

Figure11histogramofSIRwhileN=7,n=3

Figure12histogramofSIRwhileN=7,n=3.5

Figure13histogramofSIRwhileN=7,n=4

WecanseefromthehistogramthattheaverageSIRincreasewithNincrease.Sincethedistancebetweentheclusterandtheco-interferencecellislargerwhenNislarger,sotheco-interferenceissmaller.ForaconstantclustersizeN,theSIRislargerasthepathloseexponentbecomeslarger.Sincewhennischanging,theco-interferencepowerisreducedmuchmorethanthesignalpower.Eventhoughthesystemwilllosemorepower,theSIRisbecomeslarger.

WriteaprogramtocalculatetheSIRinthereverselink,andrepeatsitbyrandomlychangingthepositionsoftheMSs.<Notethattheinterferencesinthereverselinkaregeneratedbyco-channelMSsandisdifferentfromtheinterferenceintheforwardlink.>Afteranumberofsimulations,usethesimulatedresultstodrawthehistogramoftheSIR.TrytoobtainhistogramswithdifferentpathlossexponentnandclustersizeN.Concludeyourresults.

Theco-channelinterferenceinthereverselinkcanbecharacterizedinfigure4.ABSwillbeinterferedbytheco-channelMS.Inoursimulation,weconsiderthe18co-channelcell,including6cellsinthefirstloopand12cellsinthesecond,nomatterwhattheclustersizeNis.

Figure14reverselinkco-channelinterference

Theprocedureisprettymuchthesameasforwardlinkwetalkedaboutearly.FirstlywerandomlychoosethepositionofMSsinthetargetcellandco-channelcells.InordertodoingthiswecanusetherandPOSfunctioninforwardlink.ThecoordinatesofMSscanbecalculatedbyaddingittocoordinatesofco-channelbasestation.ThenwecalculatetheSIRbyformulaSIR=<dbs>-ni=118<dmsi>-nwheredbsstandsforthedistancebetweenthetargetBSandMSwhiledmsistandsforthedistancefromtheco-channelMStothecenter.

Matlabcode:

%ReverseLink

closeall

clearall

N=input<'theclustersizeN='>;

n=input<'thepathlossexponentn='>;

M=100000;

MSPos=RandPOS<M>;

CelLoc=AdjCel<N>;

pos=ones<18,M>;

fori=1:18

pos<i,:>=RandPOS<M>;

end

IntMS=pos'+ones<M,1>*CelLoc';

ds=<abs<MSPos>>.^-n;

ditemp=<abs<IntMS>>.^-n;

di=ditemp*ones<18,1>;

SIR=10*log<ds./di>;

hist<SIR,-20:150>

title<'pdfofSIR'>;

xlabel<'SIR<dB>'>;

ylabel<'pdf'>;

WewillsimulatetheSIRoftheco-interferenceoftheforwardinglinkwithdifferentclustersize‘N’andpathloseexponent‘n’andplaintthehistogramofeachcondition.

Aswhatwedidfortheforwardlink.Tomakeacomparison,wechosetwogroupofnandNas:

Whenn=3.6,weletN=1,3,4,7,12.

WhenN=7,weletn=2,3,3.5,4.

Theresultis:

Figure15histogramofSIRwhileN=1,n=3.6

Figure16histogramofSIRwhileN=3,n=3.6

SincewehaveremovedthebasestationwhengeneratetherandompositionofMS.

whendistanceofMS≤0.1,weletittobepoint<0.1,0>.

Fortheforwardlink,thereislargestvalueSIRwhenitis0.1anditisaconstant.

Forthereverselink,whentherandomlyMSisat<0.1,0>,buttheMSontheco-interferencecellisalsorandomly,sotheSIRofthi

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論