-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathweightMatSynth_mvdr.m
30 lines (29 loc) · 1.1 KB
/
weightMatSynth_mvdr.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function W = weightMatSynth_mvdr(options)
noiseAngle = options.beamforming.noiseAngle;
muMVDR = options.beamforming.muMVDR;
geometry = options.geometry;
frequency = options.frequency;
frequNum = options.frequNum;
%change this if you want to change the direction of the main lobe
if(options.beamforming.weightMatSynthesis.angle==0)
direction = ones(numel(geometry(1,:)),frequNum);
else
direction = beamSteering(options.beamforming.weightMatSynthesis.angle...
,geometry(1,:),frequency,options.c);
%direction = beamSteering3d(options.beamforming.weightMatSynthesis.angle...
%,0,geometry,frequency,options.c);
end
W = zeros(numel(geometry(1,:)),frequNum);
for frequCnt=1:frequNum
warning('');
gammaInv = inv(coherenceMat(geometry(1,:),geometry(2,:),...
%gammaInv = inv(coherenceMat(geometry(1,:),zeros(1,numel(geometry(1,:))),...
frequency(frequCnt), noiseAngle,0,muMVDR));
if(~strcmp('',lastwarn))
disp(sprintf('Warning at frequency %d',frequency(frequCnt)));
warning('');
end
W(:,frequCnt) = gammaInv*direction(:,frequCnt)...
/(direction(:,frequCnt)'*gammaInv*direction(:,frequCnt));
end
W(isnan(W)) = 0;