資源簡(jiǎn)介
現(xiàn)在需要通過源節(jié)點(diǎn)給目的節(jié)點(diǎn)發(fā)送數(shù)據(jù),發(fā)送鏈路包括兩條:
1、源節(jié)點(diǎn)直接發(fā)送目的節(jié)點(diǎn);
2、源節(jié)點(diǎn)通過中繼的轉(zhuǎn)發(fā),發(fā)送給目的節(jié)點(diǎn)。
因此,目的節(jié)點(diǎn)相當(dāng)于接收到兩條鏈路的信號(hào)。
代碼片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%???????????cooperation?communication
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc;
clear;
close?all;
warning?off;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%?????????system?parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BandWidth?=?8;%?in?Mega?Hz
%?number?of?primary?user
Node_set?=?100;
%?number?of?cooperation?user
Node_relay_Vec?=?[1];%?the?number?of?node?to?be?choosen?to?be?relay
TxRangeVec?=?[20:10:100];%?distance?between?source?and?sink?node
snr_Th?=?30;%?snr?threshold?for?outage?probability?0.001%
PlotOn?=?0;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%??????????????simulation?parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
IterNum?=?1;
Len?=?length(TxRangeVec);
RelayLen?=?length(Node_relay_Vec);
PowerConsumption?=?zeros(RelayLenLen);
PowerConsumption_D?=?zeros(1Len);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%????????????????simulation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for?sim_index?=?1:Len;
????TxRange?=?TxRangeVec(sim_index);
????
????for?loops?=?1:IterNum;
????????%?network?topology
????????Destination_Pos?=?[0;0];%?desitnation?node
????????Source_Pos?=?[-TxRange;0];%?source?node
????????%?coveage
????????alpha?=?0:pi/20:2*pi;%角度[02*pi]
????????R?=?TxRange;%半徑
????????x?=?R*cos(alpha);
????????y?=?R*sin(alpha);
????????%?the?terminal?to?be?relay?node
????????Phase_relay?=?2*pi*rand(1Node_set);
????????Distance_relay?=?R*rand(1Node_set);
????????Relay_Pos?=??[Distance_relay.*cos(Phase_relay);
????????????Distance_relay.*sin(Phase_relay)];
????????%?plot?the?network
????????if(PlotOn)
????????????figure(1);
????????????clf;
????????????plot(Destination_Pos(1)Destination_Pos(2)‘ro‘?‘MarkerFaceColor‘‘r‘);?hold?on;
????????????text(Destination_Pos(1)+0.1Destination_Pos(2)‘Rx‘);
????????????plot(xy‘m-‘‘linewidth‘2);axis?equal;
????????????
????????????plot(Source_Pos(1)Source_Pos(2)‘ks‘?‘MarkerFaceColor‘‘k‘);
????????????text(Source_Pos(1)+0.1Source_Pos(2)‘Tx‘);
????????????
????????????plot(Relay_Pos(1:)Relay_Pos(2:)‘b*‘);
????????????title(‘network?topo‘);
????????????
????????end;
????????%?CR?Tx?signal?generator
????????[Ofdm_cp?TxBit]?=?CR_Tx();
????????
????????%%?direct?transmitter
????????%?determine?the?snr?of?direct?path
????????Thermal_noise?=?-174+60+10*log10(BandWidth);%?in?dBm
????????%?sig?power
????????sig_pow?=?Thermal_noise?+?snr_Th;
????????%?determine?the?tx?power?from?path?loss
????????PL?=?128.1+37.6*log10(TxRange*0.001);
????????TX_dB_direct?=?sig_pow?+?PL;%?in?dBm
????????Tx_power_direct?=?10.^(0.1*TX_dB_direct);
????????%%???cooperative?transmitter
????????
????????%?path?loss?from?source?2?relay
????????Pos_source_relay?=?Relay_Pos?-?Destination_Pos*ones(1Node_set);
????????Distance_source_relay?=?sqrt(Pos_source_relay(1:).
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-10-10?15:39??源碼\
?????文件?????????645??2017-05-02?18:25??源碼\AF_MRC_NodeSet_100_RelayPower_50.mat
?????文件????????5367??2017-05-02?11:06??源碼\Cooperation_RealyNum_Distance_Sim.m
?????文件????????7791??2017-05-02?10:33??源碼\Cooperation_RealyNum_SNR_Sim.m
?????文件????????3015??2014-05-09?11:46??源碼\CR_Rx.m
?????文件????????3238??2014-05-09?11:46??源碼\CR_Tx.m
?????目錄???????????0??2017-05-02?10:30??源碼\requirement\
?????文件??????307520??2017-03-20?17:07??源碼\requirement\Partner?choice?and(山大論文中的參考文獻(xiàn)16).pdf
?????文件???????23040??2017-04-27?21:45??源碼\requirement\request.doc
?????目錄???????????0??2018-10-10?15:39??演示\
?????文件????25999281??2017-05-02?22:54??演示\45607.mp4
?????文件??????????64??2018-10-10?16:34??說明.txt
?????目錄???????????0??2018-10-10?15:38??需求\
?????文件??????307520??2017-03-20?17:07??需求\Partner?choice?and(山大論文中的參考文獻(xiàn)16).pdf
?????文件???????23040??2017-04-27?21:45??需求\request.doc
- 上一篇:基于序列圖像的超分辨率重建方法
- 下一篇:性能測(cè)試工具CBench
評(píng)論
共有 條評(píng)論