www.gusucode.com > phased 案例源码 matlab代码程序 > phased/SubbandMVDRBeamformingULAExample.m

    %% Subband MVDR Beamforming of ULA
% Apply subband MVDR beamforming to an underwater acoustic 11-element ULA.
% The incident angle of the signal is 10 degrees in azimuth and 30 degrees
% in elevation. The signal is an FM chirp having a bandwidth of 1 kHz. The speed of sound is
% 1500 meters per second.

% Copyright 2015 The MathWorks, Inc.


%% Simulate the Signal
sULA = phased.ULA('NumElements',11,'ElementSpacing',0.3);
fs = 2e3;
carrierFreq = 2000;
t = (0:1/fs:2)';
sig = chirp(t,0,2,fs/2);
c = 1500;
sCol = phased.WidebandCollector('Sensor',sULA,'PropagationSpeed',c,...
    'SampleRate',fs,'ModulatedInput',true,...
    'CarrierFrequency',carrierFreq);
incidentAngle = [10;0];
sig1 = step(sCol,sig,incidentAngle);
noise = 0.3*(randn(size(sig1)) + 1j*randn(size(sig1)));
rx = sig1 + noise;

%% Apply MVDR Beamforming
%
sMVDR = phased.SubbandMVDRBeamformer('SensorArray',sULA,...
    'Direction',incidentAngle,'OperatingFrequency',carrierFreq,...
    'PropagationSpeed',c,'SampleRate',fs,'TrainingInputPort',true, ...
    'SubbandsOutputPort',true,'WeightsOutputPort',true);
[y,w,subbandfreq] = step(sMVDR, rx, noise);
%%
% Plot the signal that is input to the middle sensor (6) against the beamformer
% output.
plot(t(1:300),real(rx(1:300,6)),'r:',t(1:300),real(y(1:300)))
xlabel('Time')
ylabel('Amplitude')
legend('Original','Beamformed');

%% Plot Array Response
% Plot the response pattern for five bands
pattern(sULA,subbandfreq(1:5).',-180:180,0,...
    'PropagationSpeed',c,'Weights',w(:,1:5));