我是靠谱客的博主 野性歌曲,最近开发中收集的这篇文章主要介绍考虑下行链路的蜂窝网络中存在多个D2D通信对和多个蜂窝用户,它们共享相同的频率资源并且蜂窝用户为主用户,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

1.仿真预览

 2.理论分析

整个仿真一定要有完整的链路结构,波束赋形按照参考要求设计外,其他模块都要有,但可以适当根据理论进行简化,重点是波束赋形部分的matlab程序编写。主要看这部分内容。

具体实现步骤:

算法一的实现,与参考文献一(算法1)的区别是信干比公式(4.4)增加一个

 =[1,111],这个因子中的所有变量可以自行根据实际情况设定,各因子的意义在信干比公式中有说明。

 链路说明,需5号之前给出完整的仿真链路,发给我熟悉,链路的需要体现波束赋形过程,W矩阵为4x4,先随机给出,算法2需要对比的W矩阵可以先实现,将4W进行波束赋形,然后经过链路传输输出图中的两幅图,结果暂时不要求,根据实际的W得到。10号之前需要完整的结果图和仿真程序。重点需要检查赋形的算法程序!!!

考虑下行链路的蜂窝网络中存在多个D2D通信对和多个蜂窝用户,它们共享相同的频率资源并且蜂窝用户为主用户。如图4.1所示,中心基站配备M根天线,并且传输独立的信号给单个天线的用户,。每个蜂窝用户包括D2D设备配备单根天线。假设蜂窝网络中存在个蜂窝用户,表示;并且在蜂窝网络中存在D个可能的D2D通信对,用表示。每个D2D通信对由发射端和接收端组成。

 

3.部分核心代码

clc;
clear;
close all;
warning off;
addpath 'func'
addpath 'funcmodulation'
addpath 'funcestmation'
addpath 'funccp'
addpath 'funcLTEC'
addpath 'funcprecodeing'


 P      = [-10:5:15];
%P      = [15];

D      = 6;%设置4个D2D
LL     = [1,1,1,1,1,1];
for jj = 1:length(P);
    Ps        = sqrt(10^(P(jj)/10));
    Tx_n      = 4;   
    Rx_n      = 4;   
    %整体信噪比
    SNR       = 2.4;  
    Nfft      = 1024;
    Nid       = 17; 
    Sym_Len   = 7;
    CP_length = 144;
    CPNfft    = Nfft+CP_length;
    Pdk       = [200,200,200,200,200,200]/sqrt(Ps);
    for y=1:10
        rng(y)
        y
        jj
        noise     = SNR;
        N0        = 10^(-noise/10);
        %SNR转换为sigma
        sigmas    = 10^(-SNR/20);
        
        %产生信道估计所用的测试信号,功能类似导频
        [subframe,data_v,data_v0,data_v1,data_v2,data_v3] = func_data_gen(Tx_n,Rx_n,Sym_Len,Nid);
        number_length                                     = length(find(subframe == 0));
        %IFFT
        data_ifft1 = zeros(Nfft,2*Sym_Len);
        data_ifft2 = zeros(Nfft,2*Sym_Len);
        data_ifft3 = zeros(Nfft,2*Sym_Len);
        data_ifft4 = zeros(Nfft,2*Sym_Len);
        for i=1:2*Sym_Len
            data_ifft1(:,i) = ifft(data_v0(:,i),Nfft);
            data_ifft2(:,i) = ifft(data_v1(:,i),Nfft);
            data_ifft3(:,i) = ifft(data_v2(:,i),Nfft);
            data_ifft4(:,i) = ifft(data_v3(:,i),Nfft);
        end
        %插入CP
        WithCP_sequence1 = zeros(CPNfft,2*Sym_Len);
        WithCP_sequence2 = zeros(CPNfft,2*Sym_Len);
        WithCP_sequence3 = zeros(CPNfft,2*Sym_Len);
        WithCP_sequence4 = zeros(CPNfft,2*Sym_Len);

        for i=1:2*Sym_Len
            WithCP_sequence1(:,i) = func_CP_In(data_ifft1(:,i).',CP_length);
            WithCP_sequence2(:,i) = func_CP_In(data_ifft2(:,i).',CP_length);
            WithCP_sequence3(:,i) = func_CP_In(data_ifft3(:,i).',CP_length);
            WithCP_sequence4(:,i) = func_CP_In(data_ifft4(:,i).',CP_length);
        end
        T1=reshape(WithCP_sequence1,1,CPNfft*2*Sym_Len);
        T2=reshape(WithCP_sequence2,1,CPNfft*2*Sym_Len);
        T3=reshape(WithCP_sequence3,1,CPNfft*2*Sym_Len);
        T4=reshape(WithCP_sequence4,1,CPNfft*2*Sym_Len);

        [r1,channel_impulse1,delay_number1,tap_delay1]=func_LTEChan(T1,'EPA');
        [r2,channel_impulse2,delay_number2,tap_delay2]=func_LTEChan(T2,'EPA');
        [r3,channel_impulse3,delay_number3,tap_delay3]=func_LTEChan(T3,'EPA');
        [r4,channel_impulse4,delay_number4,tap_delay4]=func_LTEChan(T4,'EPA');
        [r5,channel_impulse5,delay_number5,tap_delay5]=func_LTEChan(T1,'EPA');
        [r6,channel_impulse6,delay_number6,tap_delay6]=func_LTEChan(T2,'EPA');
        [r7,channel_impulse7,delay_number7,tap_delay7]=func_LTEChan(T3,'EPA');
        [r8,channel_impulse8,delay_number8,tap_delay8]=func_LTEChan(T4,'EPA');
        R1     = (r1+r2+r3+r4);
        R2     = (r5+r6+r7+r8);
        
        %sigmas
        a      = Ps*R1*sqrt(Nfft) + sigmas*randn(size(R1));
        b      = Ps*R2*sqrt(Nfft) + sigmas*randn(size(R2));
 

        noise1 = a/sqrt(Nfft)-R1;
        noise2 = b/sqrt(Nfft)-R2;
        R1     = a/sqrt(Nfft);
        R2     = b/sqrt(Nfft);

        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        %去CP
        WithCP_sequence_1 = reshape(R1,CPNfft,2*Sym_Len);
        WithCP_sequence_2 = reshape(R2,CPNfft,2*Sym_Len);
        NoCP_sequence1    = zeros(2*Sym_Len,Nfft);
        NoCP_sequence2    = zeros(2*Sym_Len,Nfft);
        for i=1:2*Sym_Len
            NoCP_sequence1(i,:) = func_CP_del(WithCP_sequence_1(:,i),CP_length); 
            NoCP_sequence2(i,:) = func_CP_del(WithCP_sequence_2(:,i),CP_length); 
        end
        NoCP_sequence1=NoCP_sequence1.';
        NoCP_sequence2=NoCP_sequence2.';
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        %FFT
        FFTed1=zeros(Nfft,2*Sym_Len);
        FFTed2=zeros(Nfft,2*Sym_Len);
        for i=1:2*Sym_Len
            FFTed1(:,i)=fft(NoCP_sequence1(:,i));
            FFTed2(:,i)=fft(NoCP_sequence2(:,i));
        end
        %信道估计
        [hb10,hb11,hb12,hb13] = func_channel_estmation(FFTed1,0,Nid,1,Tx_n,Sym_Len,Rx_n);
        [hb20,hb21,hb22,hb23] = func_channel_estmation(FFTed2,0,Nid,1,Tx_n,Sym_Len,Rx_n);


        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        %%信道估计之后开始在正式的链路的仿真%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        %产生随机信号
        Din1     = randint(1,number_length*2);
        Din2     = randint(1,number_length*2);
        %调制
        Din_mod1 = func_QPSK(Din1);
        Din_mod2 = func_QPSK(Din2);
        %码本选择
        for i=1:Tx_n*Rx_n*2*Sym_Len
            H             = [hb10(i) hb11(i) hb12(i) hb13(i);hb20(i) hb21(i) hb22(i) hb23(i)];
            [R,snr,SINR0] = func_codebookselect(H,N0,sigmas,Ps,Tx_n,LL,Pdk);
            r_withRS(i)   = R;
            SINR(i)       = SINR0;
        end
        r        = func_rs_del(Tx_n,r_withRS,0,Nid,1,Sym_Len,Rx_n);
        %预编码
        [copreding0,copreding1,copreding2,copreding3,W] = func_Precoding(Din_mod1,Din_mod2,r);

        %VRB
        k=1;
        for i=1:length(subframe)
            if data_v(i)==0
               data_v0(i)=copreding0(k);
               data_v1(i)=copreding1(k);
               data_v2(i)=copreding2(k);
               data_v3(i)=copreding3(k);
               k=k+1;
            end
        end

       IFFTed0_2nd=zeros(Nfft,2*Sym_Len);
       IFFTed1_2nd=zeros(Nfft,2*Sym_Len);
       IFFTed2_2nd=zeros(Nfft,2*Sym_Len);
       IFFTed3_2nd=zeros(Nfft,2*Sym_Len);

       for i=1:2*Sym_Len
           IFFTed0_2nd(:,i)=ifft(data_v0(:,i),Nfft);
           IFFTed1_2nd(:,i)=ifft(data_v1(:,i),Nfft);
           IFFTed2_2nd(:,i)=ifft(data_v2(:,i),Nfft);
           IFFTed3_2nd(:,i)=ifft(data_v3(:,i),Nfft);
       end
       %加CP
       WithCP_sequence0_2nd=zeros(CPNfft,2*Sym_Len);
       WithCP_sequence1_2nd=zeros(CPNfft,2*Sym_Len);
       WithCP_sequence2_2nd=zeros(CPNfft,2*Sym_Len);
       WithCP_sequence3_2nd=zeros(CPNfft,2*Sym_Len);
       for i=1:2*Sym_Len
           WithCP_sequence0_2nd(:,i)=func_CP_In(IFFTed0_2nd(:,i).',CP_length);
           WithCP_sequence1_2nd(:,i)=func_CP_In(IFFTed1_2nd(:,i).',CP_length);
           WithCP_sequence2_2nd(:,i)=func_CP_In(IFFTed2_2nd(:,i).',CP_length);
           WithCP_sequence3_2nd(:,i)=func_CP_In(IFFTed3_2nd(:,i).',CP_length);
       end

       T0_2nd=reshape(WithCP_sequence0_2nd,1,CPNfft*2*Sym_Len);
       T1_2nd=reshape(WithCP_sequence1_2nd,1,CPNfft*2*Sym_Len);
       T2_2nd=reshape(WithCP_sequence2_2nd,1,CPNfft*2*Sym_Len);
       T3_2nd=reshape(WithCP_sequence3_2nd,1,CPNfft*2*Sym_Len);

       [r1_2nd]=func_LTEChannel2(T0_2nd,channel_impulse1,delay_number1,tap_delay1);
       [r2_2nd]=func_LTEChannel2(T1_2nd,channel_impulse2,delay_number2,tap_delay2);
       [r3_2nd]=func_LTEChannel2(T2_2nd,channel_impulse3,delay_number3,tap_delay3);
       [r4_2nd]=func_LTEChannel2(T3_2nd,channel_impulse4,delay_number4,tap_delay4);
       [r5_2nd]=func_LTEChannel2(T0_2nd,channel_impulse5,delay_number5,tap_delay5);
       [r6_2nd]=func_LTEChannel2(T1_2nd,channel_impulse6,delay_number6,tap_delay6);
       [r7_2nd]=func_LTEChannel2(T2_2nd,channel_impulse7,delay_number7,tap_delay7);
       [r8_2nd]=func_LTEChannel2(T3_2nd,channel_impulse8,delay_number8,tap_delay8);
       R1_2nd=r1_2nd+r2_2nd+r3_2nd+r4_2nd;
       R2_2nd=r5_2nd+r6_2nd+r7_2nd+r8_2nd;

       
       a = Ps*R1_2nd*sqrt(Nfft) + sigmas*randn(size(R1));
       b = Ps*R2_2nd*sqrt(Nfft) + sigmas*randn(size(R2));
 
       
       R1_2nd=a/sqrt(Nfft);
       R2_2nd=b/sqrt(Nfft);

       %去CP
       WithCP_sequence_1_2nd=reshape(R1_2nd,CPNfft,2*Sym_Len);
       WithCP_sequence_2_2nd=reshape(R2_2nd,CPNfft,2*Sym_Len);
       NoCP_sequence1_2nd=zeros(14,Nfft);
       NoCP_sequence2_2nd=zeros(14,Nfft);

         for i=1:2*Sym_Len
             NoCP_sequence1_2nd(i,:)=func_CP_del(WithCP_sequence_1_2nd(:,i),CP_length); 
             NoCP_sequence2_2nd(i,:)=func_CP_del(WithCP_sequence_2_2nd(:,i),CP_length); 
         end

         NoCP_sequence1_2nd=NoCP_sequence1_2nd.';
         NoCP_sequence2_2nd=NoCP_sequence2_2nd.';
         %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
         %FFT
         FFTed1_2nd=zeros(Nfft,2*Sym_Len);
         FFTed2_2nd=zeros(Nfft,2*Sym_Len);
         for i=1:2*Sym_Len
             FFTed1_2nd(:,i)=fft(NoCP_sequence1_2nd(:,i));
             FFTed2_2nd(:,i)=fft(NoCP_sequence2_2nd(:,i));
         end
         prb1=zeros(Tx_n*Rx_n,2*Sym_Len);
         prb2=zeros(Tx_n*Rx_n,2*Sym_Len);
         for i=1:2*Sym_Len
             for k=1:Tx_n*Rx_n
                 prb1(k,i)=FFTed1_2nd(k,i);
                 prb2(k,i)=FFTed2_2nd(k,i);
             end
         end

        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        %均衡
        vrb_1=reshape(prb1,1,Tx_n*Rx_n*2*Sym_Len);
        vrb_2=reshape(prb2,1,Tx_n*Rx_n*2*Sym_Len);
        eqed1=zeros(1,Tx_n*12*2*Sym_Len);
        eqed2=zeros(1,Tx_n*12*2*Sym_Len);

        for i=1:length(vrb_1)
            R=r_withRS(i);
            H=[hb10(i) hb11(i) hb12(i) hb13(i);hb20(i) hb21(i) hb22(i) hb23(i)];
            [eqed1(i),eqed2(i)]=func_Equ(vrb_1(i),vrb_2(i),H,N0,R);
        end

        Doutf1    = func_rs_del(Tx_n,eqed1,0,Nid,1,Sym_Len,Rx_n);
        Doutf2    = func_rs_del(Tx_n,eqed2,0,Nid,1,Sym_Len,Rx_n);
        %QPSK解调
        out1      = func_DQPSK(Doutf1);
        out2      = func_DQPSK(Doutf2);
        %计算误码
        [En1,En2] = func_error(Din1,Din2,out1,out2);
        err(y)    =(En1+En2)/2;
         %计算SINR
        SINRs(y)  =sum(SINR);
    end
    BER(jj) = mean(err)/(length(Din1)); 
    SINRs2(jj) = mean(SINRs); 
end
figure;
semilogy(P,BER,'b-s');
grid on
xlabel('P(dBm)');
ylabel('BER');
axis([-10.001,15.001,1e-3,1e0]);
figure;
plot(P,10*log10(SINRs2),'b-s');
grid on
xlabel('P(dBm)');
ylabel('SINR(dB)');
 

save r1.mat P BER SINRs2
 

A01-132

最后

以上就是野性歌曲为你收集整理的考虑下行链路的蜂窝网络中存在多个D2D通信对和多个蜂窝用户,它们共享相同的频率资源并且蜂窝用户为主用户的全部内容,希望文章能够帮你解决考虑下行链路的蜂窝网络中存在多个D2D通信对和多个蜂窝用户,它们共享相同的频率资源并且蜂窝用户为主用户所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(54)

评论列表共有 0 条评论

立即
投稿
返回
顶部