微信:HuangL1121
QQ号:1224848052
团队:MATLAB代做|MATLAB专业代做|python代做|matlab代写|FPGA代做|FPGA专业代做|MATLAB项目合作|FPGA项目合作|matlab代码|matlab算法源码|python代做|C代做|C++代做
地址:北京市-朝阳区-双柳北街18号院
当前位置:首页 > 技术资讯 > MATLAB代做|FPGA代做|simulink代做——天线阵列波束波束形成的 LCMV算法

MATLAB代做|FPGA代做|simulink代做——天线阵列波束波束形成的 LCMV算法

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%本程序是用于天线阵列波束波束形成的 LCMV算法,算法给出了误码率曲线,可以看出LCMV算法在高信噪比时误码率很小
%数字信号的波束形成,信号噪声均用数字0,1表示

clear all; 
close all;
clc
%SNR=10;
%diBi=1/(2*SNR)^0.5;

format long;%%设置计算精度
array=25;
Num_signal=10;
b=zeros(array,1);
B=zeros(array,Num_signal);
doa=zeros(Num_signal,1);
AA=zeros(1,array);
l=0.06;%波长  f=5 G;
d=0.5*l;%阵元间距
e=[1 0 0 0 0 0 0 0 0 0 ]';
Len_train=100;
Len=100000;

x_train=zeros(Num_signal,Len_train);%signal for training
N_train=zeros(array,Len_train);%noise for training

xxx=zeros(Num_signal,Len);%signal
Noise1=zeros(array,Len);%noise

Plot_SNR=-6:2:18; %%%所利用的信噪比
Plot_Pe=[];       %%%此矩阵向量用来存储计算的误码率

W=zeros(array,1);

x1=-0.6*pi/2;x2=-pi/3;x3=-pi/4;x4=-pi/6;x5=0*pi;x6=pi/6;x7=pi/4;x8=pi/3;x9=0.6*pi/2;x10=0.9*pi/2; %10个信号的入射角
doa(1)=x1;doa(2)=x2;doa(3)=x3;doa(4)=x4;doa(5)=x5;doa(6)=x6;doa(7)=x7;doa(8)=x8;doa(9)=x9;doa(10)=x10;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%此处产生阵列响应矩阵
for jj=1:Num_signal

    for ii=1:array
    b(ii)=exp(-j*2*pi*(ii-1)*d*sin(doa(jj))/l) ;
    end 
    
B(:,jj)=b/(b'*b)^0.5;
end 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %用此处产生的信号及噪声并且已经保存
xxx=randint(Num_signal,Len);                %randint(M,N)产生M*N随机矩阵,随机数为0或者1,randint(M,N,Q)则表示随机数范围是0-Q-1;
xxx=2*(xxx-0.5);

Noise1=randn(array,Len)+j*randn(array,Len);
%save Noise1.mat Noise1
%save xxx.mat xxx
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%载入信号及噪声
% load Noise1.mat
% load xxx.mat

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%在几种不同的信噪比下计算误码率
for SNR=-6:2:18
   %SNR=30;
%diBi=1/(2*SNR)^0.5;
%SNR=10;
diBi=1/(2*10^(SNR/10))^0.5;
Noise1=Noise1*diBi;%%%%加入信噪比

x_train=xxx(:,(1:Len_train));
N_train=Noise1(:,(1:Len_train));

x=B*x_train+N_train; %加噪声
x1=B*xxx+Noise1; %加噪声
R=x*x';
W=inv(R)*B*inv((B'*inv(R)*B))*e;

y=W'*x1;
output=real(y);
d_output=output;
d_output(find(d_output>=0))=1;
d_output(find(d_output<0))=-1;
d=xxx(1,:);
%error=norm(d-d_output,1)/2;

error=length(find(d-d_output));
pe=error/Len;
Plot_Pe=[Plot_Pe pe];
 
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

semilogy(Plot_SNR,Plot_Pe,'m*:');
axis([-6 18 10^(-5) 1 ]);
xlabel('SNR (dB)')
ylabel('BER');
%s=sprintf('BER versus SNR in the AWGN channel');
%title(s);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%画波束图
R=0;
m=1:array;
for angle1=-90:90
   R=R+1;
   Direction(:,R)=exp(j*2*m'*pi*0.5*sin(angle1*pi/180));  
end 
%得到方向图,方向矢量中包含有期望信号和干扰信号。
QuiescentPattern(1,:)=W'*Direction;
QuiescentPattern=abs(QuiescentPattern);
QuiescentPatternmax=max(QuiescentPattern);
Pattern=QuiescentPattern/QuiescentPatternmax;%规一化

figure(2);
angle1=-90:90;
PatterndB=20*log10(Pattern);
plot(angle1,PatterndB,'-g');
title('Pattern of MVDR');
%axis([-100 100 -150 0]);
xlabel('Arrival Angle');
ylabel('Array Response dB');
grid on;
hold on;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

联系:highspeedlogic

QQ :1224848052

微信:HuangL1121

邮箱:1224848052@qq.com

网站:http://www.mat7lab.com/

网站:http://www.hslogic.com/

微信扫一扫:



上一篇:MATLAB代做|FPGA代做|simulink代做——AES加解密代码

版权所有: MATLAB代做|MATLAB专业代做|python代做|matlab代写|FPGA代做|FPGA专业代做|MATLAB项目合作|FPGA项目合作|matlab代码|matlab算法源码|python代做|C代做|C++代做 Copyright © 2021 All rights reserved.
微信:HuangL1121 QQ:1224848052
地址:北京市-朝阳区-双柳北街18号院

扫一扫,关注我们