目录
1.算法描述
2.仿真效果预览
3.MATLAB核心程序
4.完整MATLAB
1.算法描述
LTE网络中采用MIMO技术增加系统容量,提升吞吐率,从理论上来看,多天线的空分复用能成倍增加系统容量。但实际上并非如此,如,22MIMO的容量C(容量)=22MIMO 小于两倍的SISO容量C(容量)=2SISO,这是因为容量增加了,干扰增大了,干扰主要是由于信道矩阵中信道的相关性造成的,为了消除信道相关性造成影响,需要在接收端对H进行评估,并做线性均衡,最大化MIMO信道矩阵H的容量。
为了获取更高的MIMO容量,接收机侧需要对MIMO的发射矩阵H中的每个信道都进行均衡处理,消除信道间的影响,这样增加接收机的实现复杂度。如SISO模式,接收机需要线性均衡处理一个信道,而对于一个2*2MIMO模式,接收机需要处理评估4个信道;其次,接收端若将H矩阵中的多个信道相关性评估结果反馈给发射机,这会增加系统开销。另一个是,若通过增加天线空间来消除信道间的影响,但天线近处的杂散环境使实现难度增加。于是提出了通过技术改进解决,这个方法就是预编码(Precoding)。
因此,预编码(Precoding)的目的是降低接收机消除信道间影响实现的复杂度,同时减少系统开销,最大提升MIMO的系统容量。当然,消除MIMO信道间的影响,可以在接收机侧实现,也可以通过改变发射机的发射方式,对发射信号进行预处理,辅助接收机消除信道间的影响,这种发射方式的改变就是通过预编码实现的。
为了识别MIMO矩阵H中有用的通道,需要把多个通道(如22MIMO H11\H12\H21\H22)转化成类似于SISO的一对一模式,实现发送信号S1对应接收信号R1,S2对应接收信号R2,也就是将多个MIMO交叉通道转换成多个平行的一对一信道。这个过程通过信道矩阵SVD(奇异值分解)实现。如r=Hs+n,变换为r=UΣ(V*)Ts+n,经过接收端的处理=Σ(V)T*s+UHn,从结果可以发现发射端不再需要知道MIMO信道矩阵H,而知道V(共轭转置矩阵,又叫酉矩阵)即可,此处的V即码本(Codebook),3GPP定义了一系列V矩阵,eNodeB和ue侧均可获得,应用时根据PMI选择一个可以使信道矩阵H容量最大的V。到这里,预编码就很好理解了,实际上就是在发射端对发射信号S乘以V,与后面SVD过程匹配,这样在接收端需要处理的复杂性与开销大大减少了。
考虑下行链路的蜂窝网络中存在多个D2D通信对和多个蜂窝用户,它们共享相同的频率资源并且蜂窝用户为主用户。
1)传统波束赋形算法1
该算法是一种最简单传统的波束赋形策略,其原理是对于第k个蜂窝用户,赋形矢量wk,conv是自身方向上的信道增益矢量,公式定义如下:
因此,在这个赋形策略中,基站主要针对蜂窝用户进行赋形,并没有对其关联的D2D通信对做干扰消除。
2)ZF波束赋形算法1
在ZF波束赋形算法1中,消除了蜂窝用户之间内部的干扰,第k个蜂窝用户传输在其他所有用户信道的零空间。特别是赋形矢量 ,对于第 个用户将会正交其他所有蜂窝用户的信道矢量。公式如(6)所示:
3)ZF波束赋形算法2
在ZF波束赋形算法中,消除了基站到D2D通信的干扰,第k个蜂窝用户数据传输在所有D2D通信信道的零空间。特别是,第k个蜂窝用户波束赋形矢量 将会正交所有基站到D2D通信对信道矢量。
仿真结果与传统波束赋形方法、ZF波束赋形算法1及ZF波束赋形算法2解析结果对比与分析。仿真模型由单个蜂窝小区下,T=4为基站天线数目,K=4为蜂窝用户数量为4,D=4为D2D通信对数量。在仿真场景中,D2D通信对和蜂窝用户到基站的距离固定且采用简单的路径损耗模型。
2.仿真效果预览
matlab2022a仿真结果如下:
3.MATLAB核心程序
clc;
clear;
close all;
warning off;
addpath 'func\'
addpath 'func\modulation\'
addpath 'func\estmation\'
addpath 'func\cp\'
addpath 'func\LTEC\'
addpath 'func\precodeing\'
SNRS = [0:4:16];
for jj = 1:length(SNRS);
Tx_n = 4;
Rx_n = 4;
%整体信噪比
SNR = SNRS(jj);
Nfft = 1024;
Nid = 17;
Sym_Len = 7;
CP_length = 144;
CPNfft = Nfft+CP_length;
for y=1:100
y
SNRS(jj)
noise = SNR;
N0 = 10^(-noise/10);
%产生信道估计所用的测试信号,功能类似导频
[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);
a = awgn(R1*sqrt(Nfft),noise,'measured');
b = awgn(R2*sqrt(Nfft),noise,'measured');
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
%信道估计
[MH10,MH11,MH12,MH13] = func_channel_estmation(FFTed1,0,Nid,1,Tx_n,Sym_Len,Rx_n);
[MH20,MH21,MH22,MH23] = func_channel_estmation(FFTed2,0,Nid,1,Tx_n,Sym_Len,Rx_n);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%信道估计之后开始在正式的链路的仿真%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%产生随机信号
Din1 = round(rand(1,number_length*2));
Din2 = round(rand(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 = [MH10(i) MH11(i) MH12(i) MH13(i);MH20(i) MH21(i) MH22(i) MH23(i)];
[R,snr] = func_codebookselect(H,N0);
r_withRS(i) = R;
end
r = func_rs_del(Tx_n,r_withRS,0,Nid,1,Sym_Len,Rx_n);
%预编码
[copreding0,copreding1,copreding2,copreding3] = 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;
R1_2nd=R1_2nd+noise1;
R2_2nd=R2_2nd+noise2;
a=awgn(R1_2nd*sqrt(Nfft),noise);
b=awgn(R2_2nd*sqrt(Nfft),noise);
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=[MH10(i) MH11(i) MH12(i) MH13(i);MH20(i) MH21(i) MH22(i) MH23(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;
end
BER(jj) = sum(err)/(Tx_n*Rx_n*length(Din1));
end
figure;
semilogy(SNRS,BER,'b-s');
grid on
xlabel('SNR');
ylabel('Ber');
axis([0,18,5e-3,1e0]);
01-132m
4.完整MATLAB
V