%% Figure 48. SINR Loss performance for PRI-Staggered and Adjacent-Bin post-Doppler STAP.
%%
%
% Coded by Ilias Konsoulas, 16 Sept. 2018.
% Code provided for educational purposes only. All rights reserved.
clc; clear; close all;
%% Radar System Operational Parameters
radar_oper_params;
%% Thermal Noise Power Computation
thermal_noise_power;
%% Thermal Noise Covariance Matrix
Rn = sigma2*eye(M*N);
%% Clutter Patch RCS Computation
clutter_patch_rcs;
%% Calculate the Array Transmit and Element Receive Power Gains
Tx_Rx_power_gains;
%% Calculate the Clutter to Noise Ratio (CNR) for each azimuth angle
ksi = Pt*Gtgain.*Grec*lambda^2*sigma/((4*pi)^3*Pn*10^(Ls/10)*Rcik^4); % Eq. (58)
%% Clutter Covariance Matrix Computations
beta = 1; % beta parameter.
phia = 0; % Velocity Misalignment Angle.
Rc = clutt_cov(ksi,beta);
%% Jamming Covariance Matrix Calculation
jamm_cov;
%% Total Interference Covariance Matrix
Ru = Rc + Rj + Rn; % Eq. (98)
InvRu = inv(Ru);
%% Target Space-Time Steering Vector
phit = 0; thetat = 0; % Target azimuth and elevation angles in degrees.
fdt = 100; % Target Doppler Frequency.
fspt = d/lambda*cos(thetat*pi/180)*sin(phit*pi/180);
omegat = fdt/fr;
at = exp(-1i*2*pi*fspt*(0:N-1)).'; % Target Spatial Steering Vector.
ta = chebwin(N,30); % 30 dB Chebychev Spatial Tapper.
%% Doppler Filter Bank Creation:
dopplerfilterbank = linspace(0,300,M+1);
omegadopplerbank = dopplerfilterbank/fr;
fd = 0:.5:300; Lfd = length(fd);
omegad = fd/fr;
SNRo = M*N;
%% Doppler Filter Matrix Construction for PRI-Staggered Post-Doppler method
K = 2;
P = floor(K/2);
M1= M - K +1;
U1 = zeros(M1,M);
for m=1:M
U1(:,m) = 1/sqrt(M)*exp(-1i*2*pi*omegadopplerbank(m)*(0:M1-1)); % Doppler Filter Steering Vector
end
td0 = ones(M1,1);
td30 = chebwin(M1,30); % 30-dB Chebyshev Doppler Taper.
td60 = chebwin(M1,60); % 60-dB Chebyshev Doppler Taper.
td90 = chebwin(M1,90); % 90-dB Chebyshev Doppler Taper.
F0 = diag(td0)*U1; % Eq. 227.
F30 = diag(td30)*U1;
F60 = diag(td60)*U1;
F90 = diag(td90)*U1;
%% Create Doppler Filter Bank in Fm Matrix for PRI-Staggered Post-Doppler method
Fm0 = zeros(M,K,M);
Fm30 = zeros(M,K,M);
Fm60 = zeros(M,K,M);
Fm90 = zeros(M,K,M);
for m=1:M
Fm0(:,:,m) = toeplitz([F0(:,m); zeros(K-1,1)],[F0(1,m) zeros(1,K-1)]); % Eq. 229.
Fm30(:,:,m) = toeplitz([F30(:,m); zeros(K-1,1)],[F30(1,m) zeros(1,K-1)]);
Fm60(:,:,m) = toeplitz([F60(:,m); zeros(K-1,1)],[F60(1,m) zeros(1,K-1)]);
Fm90(:,:,m) = toeplitz([F90(:,m); zeros(K-1,1)],[F90(1,m) zeros(1,K-1)]);
end
%% Doppler Filter Matrix Construction for Adjacent Bin Post-Doppler method
U2 = zeros(M,M);
if mod(K,2) % If K is odd
for m=1:M
U2(:,m) = 1/sqrt(M)*exp(-1i*2*pi*omegadopplerbank(m)*(0:M-1)); % Doppler Filter Steering Vector
end
else % if K is even:
outomegadoppler = zeros(1,M);
for m=1:M
outomegadoppler(m) = (omegadopplerbank(m) + omegadopplerbank(m+1))/2;
U2(:,m) = 1/sqrt(M)*exp(-1i*2*pi*outomegadoppler(m)*(0:M-1)); % Doppler Filter Steering Vector
end
end
td0ab = ones(M,1); % Uniform Doppler Taper.
td30ab = chebwin(M,30); % 30-dB Chebyshev Doppler Taper.
td60ab = chebwin(M,60); % 60-dB Chebyshev Doppler Taper.
td90ab = chebwin(M,90); % 90-dB Chebyshev Doppler Taper.
% Create Doppler Filter Bank in Fab matrix for Adjacent Bin post Doppler method:
Fab0 = diag(td0ab)*U2; % Eq. 230 without complex conjugation operator.
Fab30 = diag(td30ab)*U2;
Fab60 = diag(td60ab)*U2;
Fab90 = diag(td90ab)*U2;
Fmab0 = zeros(M,K,M);
Fmab30 = zeros(M,K,M);
Fmab60 = zeros(M,K,M);
Fmab90 = zeros(M,K,M);
for m=1:M
if mod(K,2) % if K is odd and >1.
if (m-P>0) && (m+P<=M)
% [m m-P:m+P]
% omegadopplerbank(m)
% omegadopplerbank(m-P:m+P)
Fmab0(:,:,m) = Fab0 (:,m-P:m+P); % Eq. 231.
Fmab30(:,:,m) = Fab30(:,m-P:m+P);
Fmab60(:,:,m) = Fab60(:,m-P:m+P);
Fmab90(:,:,m) = Fab90(:,m-P:m+P);
elseif (m-P<=0) && (m+P<=M)
% [m M+(m-P):M 1:m+P]
% omegadopplerbank(m)
% omegadopplerbank([M+(m-P):M 1:m+P])
Fmab0(:,:,m) = [Fab0(:,M+(m-P):M) Fab0(:,1:m+P) ]; % Eq. 231.
Fmab30(:,:,m) = [Fab30(:,M+(m-P):M) Fab30(:,1:m+P)];
Fmab60(:,:,m) = [Fab60(:,M+(m-P):M) Fab60(:,1:m+P)];
Fmab90(:,:,m) = [Fab90(:,M+(m-P):M) Fab90(:,1:m+P)];
elseif m+P>M
% [m m-P:M 1:m+P-M]
% omegadopplerbank(m)
% omegadopplerbank([m-P:M 1:m+P-M])
Fmab0(:,:,m) = [Fab0(:,m-P:M) Fab0(:,1:m+P-M)]; % Eq. 231.
Fmab30(:,:,m) = [Fab30(:,m-P:M) Fab30(:,1:m+P-M)];
Fmab60(:,:,m) = [Fab60(:,m-P:M) Fab60(:,1:m+P-M)];
Fmab90(:,:,m) = [Fab90(:,m-P:M) Fab90(:,1:m+P-M)];
end
else % if K is even.
if (m-P>0) && (m+P<=M+1)
% [m m-P:m+P-1]
% omegadopplerbank(m)
% outomegadoppler(m-P:m+P-1)
Fmab0(:,:,m) = Fab0(:,m-P:m+P-1); % Eq. 231.
Fmab30(:,:,m) = Fab30(:,m-P:m+P-1);
Fmab60(:,:,m) = Fab60(:,m-P:m+P-1);
Fmab90(:,:,m) = Fab90(:,m-P:m+P-1);
elseif (m-P<=0) && (m+P<=M)
% [m M+(m-P):M 1:m+P-1]
% omegadopplerbank(m)
% outomegadoppler([M+(m-P):M 1:m+P-1])
Fmab0(:,:,m) = [Fab0(:,M+(m-P):M) Fab0(:,1:m+P-1)]; % Eq. 231.
Fmab30(:,:,m) = [Fab30(:,M+(m-P):M) Fab30(:,1:m+P-1)];
Fmab60(:,:,m) = [Fab60(:,M+(m-P):M) Fab60(:,1:m+P-1)];
Fmab90(:,:,m) = [Fab90(:,M+(m-P):M) Fab90(:,1:m+P-1)];
elseif m+P>M+1
% [m m-P:M 1:m-M+P-1]
% omegadopplerbank(m)
% outomegadoppler([m-P:M 1:m-M+P-1])
Fmab0(:,:,m) = [Fab0(:,m-P:M) Fab0(:,1:m-M+P-1)]; % Eq. 231.
Fmab30(:,:,m) = [Fab30(:,m-P:M) Fab30(:,1:m-M+P-1)];
Fmab60(:,:,m) = [Fab60(:,m-P:M) Fab60(:,1:m-M+P-1)];
Fmab90(:,:,m) = [Fab90(:,m-P:M) Fab90(:,1:m-M+P-1)];
end
end
end
%% LSINR Computation for Optimum Fully Adaptive Case
LSINRopt = zeros(1,Lfd);
for n=1:Lfd
bt = exp(-1i*2*pi*omegad(n)*(0:M-1)).'; % Target Doppler Steering Vector
vt = kron(bt,at);
w = InvRu*vt; %#ok<MINV>
LSINRopt(n) = real(w'*vt)/SNRo;
end
%% SINR Computations for 0, 30, 60, and 90 dB Chebyshev Taper.
SINR0_mat = zeros(M,Lfd);
SINR30_mat = zeros(M,Lfd);
SINR60_mat = zeros(M,Lfd);
SINR90_mat = zeros(M,Lfd);
SINRab0_mat = zeros(M,Lfd);
SINRab30_mat = zeros(M,Lfd);
SINRab60_mat = zeros(M,Lfd);
SINRab90_mat = zeros(M,Lfd);
%% PRI-Staggered SINR Computations
for m=1:M
f0m = Fm0(:,:,m);
f30m = Fm30(:,:,m);
f60m = Fm60(:,:,m);
f90m = Fm90(:,:,m);
R0um = kron(f0m,eye(N))'*Ru*kron(f0m,eye(N));
R30um = kron(f30m,eye(N))'*Ru*kron(f30m,eye(N));
R60um = kron(f60m,eye(N))'*Ru*kron(f60m,eye(N));
R90um = kron(f90m,eye(N))'*Ru*kron(f90m,eye(N));
bdfb = exp(-1i*2*pi*omegadopplerbank(m)*(0:M-1)).';