蜂窩小區同頻干擾的Matlab仿真設計_第1頁
蜂窩小區同頻干擾的Matlab仿真設計_第2頁
蜂窩小區同頻干擾的Matlab仿真設計_第3頁
蜂窩小區同頻干擾的Matlab仿真設計_第4頁
蜂窩小區同頻干擾的Matlab仿真設計_第5頁
已閱讀5頁,還剩5頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

.

/

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等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論