波束赋形算法matlab,LCMV_波束成形算法matlab仿真

%%

LCMV(Linear-Constrained Minimum Variance) Adaptive Beamingforming

Algorithm

% For Smart Antennas

% 2014/2/20

% By yazooliu

% Copyright By yzliu

% Reference

%--------------------------------------------------------------------------

% clear all

clear all;

clc;

close all;

%--------------------------------------------------------------------------

% Relevant parameter defination with

system

lamda  = 1;

% Wavelength of the incoming signal

K  = 1*8;  % Total number of array

elements

d  = lamda/2;  % Inter-element spacing

f1  = 0.1;  %

Frequency of the incoming signal

f2  = 0.2;  %

Frequency of the interferer signal

deg0  = [ 10 ];

% Angle of arrival of desired

signal in radians

degi  = [ -60 -30 30

60];  %

Angle of arrival of interferer in radians

theta0 = deg0.*pi/180;

% theta0

thetai = degi.*pi/180;

% thetai

SNR  = 10;  % Signal to Noise Ratio in

dB

SIR  = [1  2  3

4];  % Signal to

Interferer Ratio in dB

Ni  = 4;  % Number of interferers

dw  = 0.5  % d to lamda ratio of Inputing

no_samples = 3000;  % Number of

samples

kap  =

(2*pi)/lamda;

%--------------------------------------------------------------------------

% Modualation for

In_Sequence

ipBit=randn(1,no_samples)>0.5

ip=2*ipBit-1

%--------------------------------------------------------------------------

% Generating DirectionMatrix of

desired_siganl

alpha1 = kap*d*sin(theta0);

index1 = 0:K-1;

vtranspose = exp(-1i*(index1)*alpha1);

% DirectionVector of desired signal

%--------------------------------------------------------------------------

% Generation of signal with Signal Power

= 1

index2 = 1:no_samples;

signal = sqrt(2)*cos(2*pi*f1*index2); %

A = 1

%--------------------------------------------------------------------------

% Addition of Gaussian

noise

sig_noisepower =

1/(10^(SNR/10));

sig_noise  =

randn(1,no_samples);

sig_noise  =

sqrt(sig_noisepower)*sig_noise;

%--------------------------------------------------------------------------

% Generating Signal with

Modulation

s = ip.*signal;

%--------------------------------------------------------------------------

ntranspose

=zeros(Ni,length(index1));

interferer_signal  =zeros(Ni,no_samples);

% Generating Inteferer with Signal Power

= A^2/2

for index3  = 1:Ni

alpha2  =

kap*d*sin(thetai(index3));

ntranspose(index3,:) = exp(-1i*(index1)*alpha2);%DirectionVector of

inteferer signal

%----------------------------------------------------------------------

%

Generating Inteferer with Signal Power = A^2/2

interferer_signal  = cos(2*pi*f2*index2);

int_noisepower  =

1/(10^(SIR(index3)/10));

int_noise  = sqrt(2*int_noisepower);

%----------------------------------------------------------------------

%

Generating Interferer Signal multiplied with respective

amplitude

interferer_signal(index3,:) = int_noise*interferer_signal; % Signal

= Acos(wt)

end

%--------------------------------------------------------------------------

% Adding Noise For

Normalization

Noise=randn(K,no_samples);

npow=1/(10^(SNR/10));

Noise=sqrt(npow)*Noise;

%--------------------------------------------------------------------------

% generation DirectionMatrix (C0)with

signal and interferer_siganl

DirectionMatrix=[vtranspose'

ntranspose(1,:)' ntranspose(2,:)' ntranspose(3,:)'

ntranspose(4,:)']

%--------------------------------------------------------------------------

% Generating the signal and

interferer

signal_interferer=[s'

interferer_signal']'

%signal_interferer0=[s' u(1,:)' u(2,:)'

u(3,:)' u(4,:)']' %the same meaning right

%--------------------------------------------------------------------------

% genrating the output signal called

OutPutMatrix

OutPutMatrix=DirectionMatrix*signal_interferer+Noise+j*Noise

%--------------------------------------------------------------------------

% LCMV Algorithm finding

w_opt

%temp_xx=OutPutMatrix*OutPutMatrix'

RelativeMatrix=OutPutMatrix*OutPutMatrix'/no_samples;

F=[1 0 0 0 0]'

%temp0=inv(RelativeMatrix)

%temp1=DirectionMatrix'*inv(RelativeMatrix)*DirectionMatrix

WeightVector_temp=inv(DirectionMatrix'*inv(RelativeMatrix)*DirectionMatrix)*F;

WeightVector=inv(RelativeMatrix)*DirectionMatrix*WeightVector_temp;%LCMV

Algorithm w_opt

%--------------------------------------------------------------------------

% Signal with

signal_WeightVector

signal_WeightVector=OutPutMatrix'*WeightVector

signal_WeightVector0=reshape(signal_WeightVector,1,[]);

%--------------------------------------------------------------------------

%

Demodualation

ip_Hat0=(real(signal_WeightVector0/2))

ip_Hat(find(ip_Hat0>0))=+1;

ip_Hat(find(ip_Hat0<0))=-1;

% Detection

ipBitHat=(ip_Hat+1)/2

%--------------------------------------------------------------------------

% Plot the figures

%--------------------------------------------------------------------------

% Display the figure of Array &

Polar of Smart Anntennas

L=0;  % For

search

for

angle1=-90:90

L=L+1;

index1=0:K-1;

v_temp=j*2*index1*pi*dw

v=exp(v_temp*sin(angle1*pi/180));

Direction(:,L)=v;

end

%--------------------------------------------------------------------------

% Direction vector including the

expection & interfere signal

%

Arrfact(1,:)=WeightVector'*Direction;

Arrfact=abs(Arrfact);

Arrfactmax=max(Arrfact);

Pattern=Arrfact/Arrfactmax;

%For Normalization

%--------------------------------------------------------------------------

% Plot the figure of Rectangular Plot of

Array Factor

angle1=-90:90;

PatterndB=20*log10(Pattern);

plot(angle1,PatterndB,'r-','linewidth',1.50)

title('Rectangular Plot of Array

Factor');

xlabel('theta(deg)');

ylabel(' |Array

Factor|/dB');

%legend('LCMV-Algorithm')

axis([-90 90 -100 0])

set(gca,'xtick',[-90:10:90],'fontsize',8)

grid on

hold on;

%--------------------------------------------------------------------------

% Plot the figure of Polar Plot of Array

Factor

figure

polar(-pi/2:pi/180:pi/2,abs(Pattern))

title('Polar Plot of Array

Factor')

%--------------------------------------------------------------------------

% scatterplot

% scatterplot(ipBitHat)

%--------------------------------------------------------------------------

% save file

save

LCMV_Algorithm_Ex_2_20_yzliu

%--------------------------------------------------------------------------

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值