我想在 AWGN 通道中为 ODFM 系统使用 Matlab 中的后 FFT 波束成形。在y
模拟中,我有4
天线阵列和4
用户。第一个用户的信号是需要的,其他的都是干扰信号。
这是我获取波束形成器系数 ( w_opt=inv(R)*P
) 的代码,它使用Communications System Toolbox
:
%%%%%%%%%% code for computing the beamformer coefficients %%%%%%%%%
clear all
close all
% clc
K=4; % number of users
S=4; % number of arrays
runs=1000;
l=10000;
N=32;
e=zeros(N,l,runs);
DOA=[30 0 140 100];
w_opt_fft=zeros(S,N);
R2=zeros(S,S,N);
p2=zeros(S,N);
F=zeros(N);
for k=1:N
for q=1:N
F(k,q)=sqrt(1/N)*exp(-1i*2*pi*(k-1)*(q-1)/N);
end;
end;
Ft=F'; %'
%%%%%%%%%array response for each user %%%%%%%%%
A=zeros(S,K);
for j=1:K
for i=1:S
A(i,j)=exp(1i*(i-1)*pi*cos(DOA(j)*pi/180));
end
end
FV2=zeros(N,S);
for j=1:l
sym = randint(N,K,2);
d=pskmod(sym,2);
for user=1:K
X2(:,user)=Ft*d(:,user);
y2(:,user)=X2(:,user);
end
y2_n=awgn(y2,20,'measured');
V2=A*y2_n.'; %'
for arr=1:S
FV2(:,arr)=F*V2(arr,:).'; %'
end
for sub=1:N
R2(:,:,sub)=R2(:,:,sub)+FV2(sub,:)'*FV2(sub,:); %'
d2(sub)=X2(sub,1);
p2(:,sub)=p2(:,sub)+FV2(sub,:).'*d2(sub)';
end
end
for sub=1:N
R2(:,:,sub)=R2(:,:,sub)/l;
p2(:,sub)=p2(:,sub)/l;
w_opt_fft(:,sub)=inv(R2(:,:,sub))*p2(:,sub);
end
save('w_opt_fft.mat','w_opt_fft')
%%%%%%%%%%%% BER Analysis %%%%%%%%%%%%%%
clear all
close all
clc
load 'w_opt_fft.mat'
K=4; % number of users
S=4; % number of arrays
runs=1000;
l=5000;
N=32;
e=zeros(N,l,runs);
DOA=[30 0 140 100];
R1=zeros(S,S,N);
R2=zeros(S,S,N);
p1=zeros(S,N);
p2=zeros(S,N);
ber1=zeros(11,1);
ber2=zeros(11,1);
F=zeros(N);
for k=1:N
for q=1:N
F(k,q)=sqrt(1/N)*exp(-1i*2*pi*(k-1)*(q-1)/N);
end;
end;
Ft=F'; %'
%%%%%%%%%array response for each user %%%%%%%%%
A=zeros(S,K);
for j=1:K
for i=1:S
A(i,j)=exp(1i*(i-1)*pi*cos(DOA(j)*pi/180));
end
end
%%%%%%%
for SNR=0:2:20;
for j=1:runs
sym = randint(N,K,2);
d=pskmod(sym,2);
for user=1:K
X2(:,user)=Ft*d(:,user);
y2(:,user)=X2(:,user);
end
y2_n=awgn(y2,SNR,'measured');
V2=A*y2_n.'; %'
for arr=1:S
FV2(:,arr)=F*V2(arr,:).'; %'
end
for sub=1:N
Fout2(sub)=w_opt_fft(:,sub)'*FV2(sub,:).';
end
data2=pskdemod(Fout2,2);
ber2(SNR/2+1)=ber2(SNR/2+1)+sum(sym(:,1)~=data2.'); %'
end
ber2(SNR/2+1)=ber2(SNR/2+1)/runs/N;
end
semilogy(0:2:20,ber2,'r','linewidth',2)
但是,beamformer 的系数不对,Bit Error Rate
也不好。