MATLAB Examples

# Example 11.3.1. - Optimum Beamformer Demo.

To demonstrate the optimum beamformer, we consider a scenario in which there are three interference sources and compare it to a conventional beamformer (Spatial Matched Filter). The array is a 20-element ULA with element spacing. These interferers are at the following angles with the corresponding interference-to-noise ratios (INRs) in decibels: and , and , and and . The optimum beamformer is first computed using (11.3.15) for a look direction of .

Copyright 2016 - 2026, Ilias S. Konsoulas.


## Workspace Initialization.

clc; clear; close all; 

## Signal Definitions.

M = 20; % Number of Array Elements. N = 200; % Number of Signal Samples. n = 1:N; % Time Sample Index Vector. lambda = 1; % Incoming Signal Wavelength in (m). d = lambda/2; % Interelement Distance in (m). SNR = 20; % Target SNR in dBs. phi_s = 0; % Target azimuth angle in degrees. phi_i1 = 20; % Interference angle in degrees. phi_i2 = -30; % Interference angle in degrees. phi_i3 = 50; % Interference angle in degrees. INR1 = 35; % Interference #1 INR in dBs. INR2 = 70; % Interference #2 INR in dBs. INR3 = 50; % Interference #3 INR in dBs. u_s = (d/lambda)*sin(phi_s*pi/180); % Normalized Spatial Frequency of the Target signal. u_int1 = (d/lambda)*sin(phi_i1*pi/180); % Normalized Spatial Frequency of the Interferer #1. u_int2 = (d/lambda)*sin(phi_i2*pi/180); % Normalized Spatial Frequency of the Interferer #2. u_int3 = (d/lambda)*sin(phi_i3*pi/180); % Normalized Spatial Frequency of the Interferer #3. % Target Signal definition. s = zeros(M,N); v_s = exp(-1i*2*pi*u_s*(0:M-1).')/sqrt(M); % Target Steering Vector. s(:,100) = 10^(SNR/20)*v_s; % Amplitude of Target Signal Generation. % The uncorrelated unit power thermal noise samples with a Gaussian % distribution are generated by: w = (randn(M,N)+1i*randn(M,N))/sqrt(2); % The interference (1iammer) vectors are generated by: v_i1 = exp(-1i*2*pi*u_int1*(0:M-1).')/sqrt(M); i_x1 = 10^(INR1/20)*v_i1*(randn(1,N)+1i*randn(1,N))/sqrt(2); v_i2 = exp(-1i*2*pi*u_int2*(0:M-1).')/sqrt(M); i_x2 = 10^(INR2/20)*v_i2*(randn(1,N)+1i*randn(1,N))/sqrt(2); v_i3 = exp(-1i*2*pi*u_int3*(0:M-1).')/sqrt(M); i_x3 = 10^(INR3/20)*v_i3*(randn(1,N)+1i*randn(1,N))/sqrt(2); %The three signals are added to produce the overall array signal. x = s + i_x1 + i_x2 + i_x3 + w; iplusn = i_x1 + i_x2 + i_x3 + w; % Calculation of the i+n autocorrelation matrix. R_ipn = 10^(INR1/10)*(v_i1*v_i1') + 10^(INR2/10)*(v_i2*v_i2') + 10^(INR3/10)*(v_i3*v_i3') + eye(M); InvR = inv(R_ipn); % MVDR Optimum Beamformer computed for a phi_s = 0 deg. c_opt = InvR*v_s/(v_s'*InvR*v_s); %#ok<*MINV> % Spatial Matched Filter or Steering Vector Beamformer Eq. (11.2.16). c_mf = v_s; 

## Calculate the Beam Patterns.

Nsamples1 = 3e4; angle1 = -90:180/Nsamples1:90-180/Nsamples1; Opt_Beam_Pat = zeros(Nsamples1,1); Conv_Beam_Pat = zeros(Nsamples1,1); for k=1:Nsamples1 u = (d/lambda)*sin(angle1(k)*pi/180); v = exp(-1i*2*pi*u*(0:M-1).')/sqrt(M); % Azimuth Scanning Steering Vector. Opt_Beam_Pat(k) = c_opt'*v; Conv_Beam_Pat(k) = c_mf'*v; end 

## Plot the corresponding Beampatterns.

figure('NumberTitle', 'off','Name','Figure 11.16(a)'); plot(angle1,10*log10(abs(Conv_Beam_Pat).^2),angle1,10*log10(abs(Opt_Beam_Pat).^2),'r', 'LineWidth',1.5) xlim([-95 95]); ylim([-100 0]); title([' Beamformer Design with d = \lambda/2 and M = 20. '; 'Conventional Beamformer (blue) and MVDR Optimum Beamformer (red).';]); xlim([-90 90]); xlabel('Angle (deg)'); ylabel('Power (dB)'); grid on; 

## Plot in Polar Coordinates

figure('NumberTitle','off','Name','Figure 11.16(a)-Polar','Position', [100 100 1000 600]); subplot(1,2,1); polardb(angle1.'*pi/180,10*log10(abs(Conv_Beam_Pat).^2),-80,'b'); title('Conventional BF'); grid on; subplot(1,2,2); polardb(angle1.'*pi/180,10*log10(abs(Opt_Beam_Pat).^2),-80,'r'); title('MVDR Optimum BF'); grid on; tightfig; 

## Calculate the SINR loss factor for the Optimum Beamformer:

Nsamples = 3e4; % The resolution must be very fine to reveal the true depth of the notches. Lsinr_opt = zeros(Nsamples,1); Lsinr_mf = zeros(Nsamples,1); SNR0 = M*10^(SNR/10); angle = -90:180/Nsamples:90-180/Nsamples; for k=1:Nsamples v = exp(-1i*pi*(0:M-1)'*sin(angle(k)*pi/180))/sqrt(M); % Azimuth Scanning Steering Vector. c_mf = v; % This is the spatial matched filter beamformer. Lsinr_opt(k) = v'*InvR*v; SINRout_mf = real(M*(10^(SNR/10))*(abs(c_mf'*v)^2)/(c_mf'*R_ipn*c_mf)); Lsinr_mf(k) = SINRout_mf/SNR0; end 

## Plot the SINR Loss.

figure('NumberTitle', 'off','Name','Figure 11.16(b)'); plot(angle,10*log10(abs(Lsinr_opt)),angle,10*log10(abs(Lsinr_mf)),'r', 'LineWidth',1.5); ylim([-75 5]); xlim([-90 90]); xlabel('Angle (deg)'); ylabel('SINR Loss (dB)'); title('SINR Loss for the MVDR Optimum Beamformer (blue) and the Conventional Beamformer (red)'); grid on;