title: MVDR Beamformer in Matlab
body: <p>I am trying to beamform using the Signal Processing toolbox in Matlab but my results are not as I would expect. </p>
  
  <p>I have an array of 8 isotropic antennas (nearly linear) receiving signals from many directions. I am then using the phase delay and MVDR functions to beamform time series data at the 8 antennas. </p>
  
  <p>When I plot the beam patterns of the two beamformers, the phase delay is how I would expect - with one main lobe and then surrounding side lobes. However, the MVDR beam pattern does not have a main lobe at the beam angle I am trying to look at. </p>
  
  <p>My code for the MVDR beamformer is below. (Note that the phase delay code is identical but for "phased.PhaseShiftBeamformer" replacing "phased.MVDRBeamformer" in the code. </p>
  
  <pre><code>array = phased.ConformalArray('ElementPosition',[ys;xs;zeros(1,8)],...
      'ElementNormal',[normal_az; normal_el]);
  
  angle_of_arrival = [theta;0];
  
  %Capon beamformer 
  beamformer = phased.MVDRBeamformer('SensorArray',array,...
      'OperatingFrequency',f0,...
      'Direction',angle_of_arrival,'WeightsOutputPort',true);
  
  [y,w] = beamformer(time_series_for_antennas);
  </code></pre>
  
  <p>The resulting beam patterns are shown in the figure below. The green cross shows where the beam is being steered to. The phase delay function is used to generate the top plot and the MVDR function for the bottom plot. </p>
  
  <p><a href="https://i.stack.imgur.com/jWIYM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jWIYM.png" alt="Phase delay (and MVDR) beamformer antenna pattern shown in top (and bottom) picture"></a></p>
  
  <p>To try and understand the problem, I recreated a simple example from the mathworks website to see the result when the signal is incoming from a single direction (see below for code). In this example, like in my problem, the main lobe is not prominent when the beamform angle is between 0 and 180 degrees.</p>
  
  <p>Does anyone have any reasoning for this?</p>
  
  <pre><code>clear;
  close all;
  clc;
  
  t = [0:.1:200]';
  fr = .01;
  xm = sin(2*pi*fr*t);
  c = physconst('LightSpeed');
  fc = 300e6;
  rng('default');
  incidentAngle = [45;0];
  array = phased.ULA('NumElements',5,'ElementSpacing',0.5);
  x = collectPlaneWave(array,xm,incidentAngle,fc,c);
  noise = 0.1*(randn(size(x)) + 1j*randn(size(x)));
  rx = x + noise;
  
  figure(1)
  count=1; % Used to initialize the counter 
  myVideo = VideoWriter('beamform_steering_vector.avi');
  myVideo.FrameRate = 5;
  open(myVideo)
  
  for ang=-180:180 % Loop over the video 
  
      beamformer = phased.MVDRBeamformer('SensorArray',array,...
          'PropagationSpeed',c,'OperatingFrequency',fc,...
          'Direction',[ang;0],'WeightsOutputPort',true);
      [y,w] = beamformer(rx);
  
      [weights,azimuthal,elevation] = pattern(array,fc,[-180:180],0,'PropagationSpeed',c,...
          'Weights',w,'CoordinateSystem','rectangular',...
          'Type','powerdb');
      plot(azimuthal, weights)
      hold on
      plot(azimuthal(azimuthal==ang),weights(azimuthal==ang),'bx')
      hold off
      title(ang)
      drawnow; % This just shows you the video as it makes it 
      M(count) = getframe(gcf); % This captures the video frames 
      count=count+1; %This basically just counts the number of frames 
  
  end 
  </code></pre>