版權(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2023六年級(jí)英語下冊(cè) Review Module Unit 2說課稿 外研版(三起)001
- 2025合同模板銷售事務(wù)處理制度A范本
- 2023三年級(jí)英語下冊(cè) Unit 4 Food and Restaurants Lesson 23 How Much Are They說課稿 冀教版(三起)001
- 3 植物長在哪里 說課稿-2024-2025學(xué)年科學(xué)一年級(jí)上冊(cè)教科版
- 15分享真快樂(說課稿)-部編版道德與法治一年級(jí)下冊(cè)001
- 養(yǎng)老護(hù)工合同范本
- Unit2 Morals and virtues Reading for writing說課稿-2023-2024學(xué)年人教版高中英語必修第三冊(cè)
- 1 觀潮說課稿-2024-2025學(xué)年四年級(jí)上冊(cè)語文統(tǒng)編版
- 2024年五年級(jí)英語上冊(cè) Module 2 Unit 2 How much cheese did you buy說課稿 外研版(三起)
- 路面挖補(bǔ)施工方案
- 兒童四宮格數(shù)獨(dú)96題-(由簡到難,支持打印)
- 湖北宜昌歷年中考語文現(xiàn)代文之記敘文閱讀16篇(含答案)(2003-2023)
- 問題探究如何讓城市不再看海(教學(xué)課件)高一地理
- 2024年人教版五年級(jí)數(shù)學(xué)(上冊(cè))模擬考卷及答案(各版本)
- 人教版八年級(jí)下冊(cè)歷史第1課 中華人民共和國成立 說課稿
- 2024-2030年傷口護(hù)理管理行業(yè)市場(chǎng)現(xiàn)狀供需分析及重點(diǎn)企業(yè)投資評(píng)估規(guī)劃分析研究分析報(bào)告
- 《地球物理勘查》全冊(cè)配套完整教學(xué)課件
- 混凝土攪拌站安全生產(chǎn)風(fēng)險(xiǎn)分級(jí)管控體系方案全套資料2021-2022完整實(shí)施方案模板
- 新生兒紅臀的預(yù)防和護(hù)理
- 《停車場(chǎng)規(guī)劃設(shè)計(jì)規(guī)范》
- (正式版)JBT 5300-2024 工業(yè)用閥門材料 選用指南
評(píng)論
0/150
提交評(píng)論