I am trying to plot beampattern of an array after using Frost Beamforming algorithm to adapt weights. Below is sample code for frost beamformer.
clear; close all; clc;h = phased.URA('Size',[4 4],'ElementSpacing',[1 0.6]);h.Element.FrequencyRange = [20 20000];fs = 8e3;t = 0:1/fs:0.3;x = chirp(t,0,1,500);c = 340;collector = phased.WidebandCollector('Sensor',h,... 'PropagationSpeed',c,'SampleRate',fs,... 'ModulatedInput',false,'NumSubbands',8192);incidentAngle = [-50;30];x = step(collector,x.',incidentAngle);noise = 0.2*randn(size(x));rx = x + noise;beamformer = phased.FrostBeamformer('SensorArray',h,... 'PropagationSpeed',c,'SampleRate',fs,... 'Direction',incidentAngle,'FilterLength',5,... 'WeightsOutputPort',true);[y,yweights] = step(beamformer,rx);plot(t,rx(:,6),'r:',t,y)xlabel('Time')ylabel('Amplitude')legend('Original','Beamformed')How do I use pattern and yweights to plot the beampattern?
Best Answer