MATLAB Examples

Example 11.5.1. - Sample Matrix Inversion.

In this example, we study the SMI adaptive beamformer and the loss associated with the number of snapshots used for training. SMI adaptive beamformers are produced with sample supports of K = 1.5M, 2M, 5M and 10M. Consider a ULA with M = 20 elements with an interference source at $\phi_i = 20^{\circ}$ and a power of 50 dB. The thermal noise has unit variance $\sigma_{w}^2 = 1$.

Contents

Workspace initialization.

clc; clear; close all;

Signal definitions.

M  = 20;          % Number of Array Elements.
K1 = 1.5*M;   % Number of Signal Snapshots.
K2 = 2*M;       % Number of Signal Snapshots.
K3 = 5*M;       % Number of Signal Snapshots.
K4 = 10*M;     % Number of Signal Snapshots.

lambda = 1;    % Incoming Signal Wavelength in (m).
d = lambda/2; % Interelement Distance in (m).
phi_s = 0;        % target azimuth angle in degrees
sigma_s = 1/sqrt(M);  % Target signal power so that M*sigma_s^2 = 1;

% This is a requirement from the example.
phi_i  = 20;      % interference angle in degrees
INR    = 40;      % Interference #1 INR in dBs

u_s = (d/lambda)*sin(phi_s*pi/180);  % Normalised Spatial Frequency Vector for Target Signal.
v_s = exp(-1i*2*pi*u_s*(0:M-1).')/sqrt(M);

% Take 100 realizations of sample matrices R1, R2, R3 and R4 and average to find smoother
% SINR loss curves:
NSamples = 1e3;
SINR_Opt = zeros(NSamples,1);
SINR1       = zeros(NSamples,1);  SINR_1 = zeros(NSamples,1);
SINR2       = zeros(NSamples,1);  SINR_2 = zeros(NSamples,1);
SINR3       = zeros(NSamples,1);  SINR_3 = zeros(NSamples,1);
SINR4       = zeros(NSamples,1);  SINR_4 = zeros(NSamples,1);

Monte-Carlo Runs.

Run the experiment many times and and average over the resulting SINR Factors.

 for k=1:100
    % Uncorrelated unit power thermal noise samples drawn from a complex Gaussian distribution:
    w1 = (randn(M,K1) + 1i*randn(M,K1))/sqrt(2);
    w2 = (randn(M,K2) + 1i*randn(M,K2))/sqrt(2);
    w3 = (randn(M,K3) + 1i*randn(M,K3))/sqrt(2);
    w4 = (randn(M,K4) + 1i*randn(M,K4))/sqrt(2);

    % The interference (jammer) vector are generated by:
    u_i = (d/lambda)*sin(phi_i*pi/180);  % Normalized Spatial Frequency Vector for Interference Signal.
    v_i = exp(-1i*2*pi*u_i*(0:M-1).')/sqrt(M);
    i_x1=(10^(INR/20))*v_i*(randn(1,K1) + 1i*randn(1,K1))/sqrt(2);
    i_x2=(10^(INR/20))*v_i*(randn(1,K2) + 1i*randn(1,K2))/sqrt(2);
    i_x3=(10^(INR/20))*v_i*(randn(1,K3) + 1i*randn(1,K3))/sqrt(2);
    i_x4=(10^(INR/20))*v_i*(randn(1,K4) + 1i*randn(1,K4))/sqrt(2);

    % The sample interference-plus-noise signal x_i+n is generated by:
    iplusn1 = i_x1 + w1;
    iplusn2 = i_x2 + w2;
    iplusn3 = i_x3 + w3;
    iplusn4 = i_x4 + w4;

    % Sample Autocirrelation Matrices:
    R1 = 1/K1*(iplusn1*iplusn1');
    R2 = 1/K2*(iplusn2*iplusn2');
    R3 = 1/K3*(iplusn3*iplusn3');
    R4 = 1/K4*(iplusn4*iplusn4');

    InvR1 = inv(R1);
    InvR2 = inv(R2);
    InvR3 = inv(R3);
    InvR4 = inv(R4);

Calculation of the true i+n autocorrelation matrix and its inverse.

    R_ipn = (10^(INR/10))*(v_i*v_i') + eye(M);
    InvR = inv(R_ipn);

    c_opt  = InvR*v_s/(v_s'*InvR*v_s);    % Optimum Beamformer computed for a phi_s = 0 deg.

    %#ok<*MINV>
    c_smi1 = InvR1*v_s/(v_s'*InvR1*v_s);  % SMI Beamformer computed for phi_s = 0 deg & K1 = 1.5*M snapshots.
    c_smi2 = InvR2*v_s/(v_s'*InvR2*v_s);  % SMI Beamformer computed for phi_s = 0 deg & K2 = 2*M snapshots.
    c_smi3 = InvR3*v_s/(v_s'*InvR3*v_s);  % SMI Beamformer computed for phi_s = 0 deg & K3 = 5*M snapshots.
    c_smi4 = InvR4*v_s/(v_s'*InvR4*v_s);  % SMI Beamformer computed for phi_s = 0 deg & K4 = 10*M snapshots.

    angle = -90:180/NSamples:90-60/NSamples;
    Opt_Beam_Pat  = zeros(NSamples,1);
    Conv_Beam_Pat = zeros(NSamples,1);

    for n=1:NSamples
        u = (d/lambda)*sin(angle(n)*pi/180);
        v = exp(-1i*2*pi*u*(0:M-1).')/sqrt(M);
        SINR_Opt(n) = M*sigma_s^2*v'*InvR*v;   % max SINR for Optimum Beamformer (11.3.12)
        SINR_1(n)     = M*sigma_s^2*((v'*InvR1*v)^2)/(v'*InvR1*R_ipn*InvR1*v);  %  (11.5.4)
        SINR_2(n)     = M*sigma_s^2*((v'*InvR2*v)^2)/(v'*InvR2*R_ipn*InvR2*v);
        SINR_3(n)     = M*sigma_s^2*((v'*InvR3*v)^2)/(v'*InvR3*R_ipn*InvR3*v);
        SINR_4(n)     = M*sigma_s^2*((v'*InvR4*v)^2)/(v'*InvR4*R_ipn*InvR4*v);
    end

    SINR1 = SINR1 + SINR_1;
    SINR2 = SINR2 + SINR_2;
    SINR3 = SINR3 + SINR_3;
    SINR4 = SINR4 + SINR_4;
end

% Average out the calculated sums:
SINR1 = 1/100*SINR1;
SINR2 = 1/100*SINR2;
SINR3 = 1/100*SINR3;
SINR4 = 1/100*SINR4;

Plot the corresponding Beampatterns.

figure('NumberTitle', 'off','Name','Figure 11.22');
plot(angle,10*log10(real(SINR_Opt)),'b',angle,10*log10(real(SINR1)),'r',angle,10*log10(real(SINR2)),'g',...
    angle,10*log10(real(SINR3)),'k',angle,10*log10(real(SINR4)),'c','LineWidth',1.5);
title(['                    SINR Loss in SMI Adaptive Beamformer.                 ';
    'Optimal (blue), K=1.5M (red), K=2M (green), K=5M (black) and K=10M (cyan).';]);
xlim([-90 90]);
ylim([-10 2]);
grid on;
xlabel('Angle (deg)');
ylabel('Power (dB)');