MATLAB Examples

# Example 11.2.1. - The Spatial Matched Filter or Steering Vector Beamformer.

A signal received by a ULA with M = 20 elements and spacing contains both a signal of interest at with an array SNR of 20 dB and thermal sensor noise with unit power . The signal of interest is an impulse present only in the 100th sample.

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;      % Sample Index Vector.
lambda = 1;        % Incoming Signal Wavelength in (m).
d      = lambda/2; % Interelement Distance in (m).
SNR    = 20;       % Array Voltage Gain in dBs.
phi_s  = 20;       % Signal Direction angle in deg.

u_s = (d/lambda)*sin(phi_s*pi/180); % Normalized Spatial Frequency of the signal of interest.

% Desired Signal Definition:
s = zeros(M,N);

% Array snapshot (n=100) that contains the signal of interest (an impulse).
s(:,100) = (10^(SNR/20)*exp(-1i*2*pi*u_s*(0:M-1).'))/sqrt(M);

## Spatial Matched Filter Calculation.

Examining the signal at a single sensor in Figure 11.10 (a), we see that the signal is not visible at n = 100 since the element level SNR is only 7 dB (full-array SNR minus M in decibels). The output power of this sample for a given realization can be more or less than the expected SNR due to the addition of the noise. However, when we apply a spatial matched filter using the Spatial Matched Filter or Steering Vector Beamformer.

c_mf = exp(-1i*2*pi*u_s*(0:M-1).')/sqrt(M);

## Monte Carlo Averaging

Run this experiment many times (Monte-Carlo runs) to come up with an average output vector y1: To reproduce perfectly Fig. 11.10 you should set NumExperiments = 1; As you can see, Monte-Carlo Averaging improves the output SNR a lot!

MC_Runs = 100;
y1 = zeros(1,N);
x1 = zeros(1,N);

for k=1:MC_Runs

% Uncorrelated noise samples at each array element with a Gaussian distribution:
w = (randn(M,N)+1i*randn(M,N))/sqrt(2);

% The two signals are added to produce the overall array signal:
x = s + w;

% Output Calculation.
y = c_mf'*x;
y1 = y1 + y;

end

y_average = 1/MC_Runs*y1;
max(10*log10(abs(y_average).^2))
ans =

20.0712

## Plot the Results.

figure('NumberTitle', 'off','Name','Figure 11.10');
subplot(2,1,1);
% This plots the instantaneous power for every element (M waveforms).
plot(n,10*log10(abs(x).^2));
ylim([-20 25]);
grid on;
title('Instantaneous Signal Power at each Element (Ensemble of 20 Elements)');
xlabel('Sample Number');
ylabel('Output Power (dB)');

subplot(2,1,2);
plot(n,10*log10(abs(y_average).^2),'*-');
grid on;
ylim([-30 25]);
title('Instantaneous Signal Power at the Output of the Steering Vector Beamformer');
xlabel('Sample Number');
ylabel('Output Power (dB)');