资源简介

现在需要通过源节点给目的节点发送数据,发送链路包括两条: 1、源节点直接发送目的节点; 2、源节点通过中继的转发,发送给目的节点。 因此,目的节点相当于接收到两条链路的信号。

资源截图

代码片段和文件信息

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%           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:).

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           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(山大论文中的参考文献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(山大论文中的参考文献16).pdf
     文件       23040  2017-04-27 21:45  需求\request.doc

评论

共有 条评论