%% Simulation Parameters

N = 10; % Number of Antenna Elements.

M = N-1; % Degre of Freedom.

Theta_s = 0; % Desired Sig. Direction of Arrival.

Theta_1 = -10; % Direction of Arrival for Jammer 1.

Theta_2 = 10; % Direction of Arrival for Jammer 2.

Delta = 0.2267; % Positive Cons. In Optimization Problem (9). Delta>= (1/N)

K = 20; % Number of Snapshots.

Ndb = -15; % Noise Power.

%initialization

src_theta = [0,30];

Num_of_Src = length(src_theta);

Theta_interf = [Theta_1, Theta_2];

As = exp(1i * pi * (0:(N-1))’ * sind(Theta_s)); % Steering vector for source.

A = exp(1i * pi * (0:(N-1))’ * sind(Theta_interf)); % Steering vectors for two interferers.

NoiseAmp = 10^(Ndb/20); %noise amplitude for complex noise

Whit_noise=1/sqrt(2)*(NoiseAmp*randn+1j*NoiseAmp*randn); %noise process generaation

NoisPower = Whit_noise*Whit_noise’;

%*****************************************************

INR = 20; %dB Interference -to-noise ratio for interferers.

a1 = sqrt(10^(INR/10)*NoisPower); % Amplitude of interefrer signal 1

a2 = sqrt(10^(INR/10)*NoisPower); % Amplitude of interefrer signal 2

%**** Making Xtild_t for snapshot t

f_thetas = pi * sind(Theta_s);

f_theta1 = pi * sind(Theta_1);

f_theta2 = pi * sind(Theta_2);

X1tild_t = a1*(1-exp(1j*(f_theta1-f_thetas))).*A(1:M,1)+ a2*(1-exp(1j*(f_theta2-f_thetas))).*A(1:M,2)…*

+(NoiseAmprandn+1j*NoiseAmp*randn)*(1-exp(1j*(f_theta1-f_thetas))).*A(1:M,1) + (NoiseAmp*randn+1j*NoiseAmp*randn)*(1-exp(1j*(f_theta2-f_thetas))).*A(1:M,2);

% Cancellation Matrix for one snapshot

Ft = X1tild_t;

% F = [Ft1, Ft2, Ft3, …, FtK], K is the number of snapshots.

% ****** Making Cancellation Covariance Matrix R_f = Ft.*Ft’*

R_f = FtFt’;

R_f= R_f +1e-8*eye(9);

% **** Making Pre-defined gain direction vector V

V = exp(1i * pi * (0:(M-1))’ * sind(Theta_s));

%% ******** Solving Optimization Problem *************

cvx_begin

variable w(M,1) complex

minimize (w’* R_f *w)

subject to

real(w’*V)==1;

norm(w)<=Delta

cvx_end