-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathAS.m
35 lines (35 loc) · 787 Bytes
/
AS.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
31
32
33
34
35
function F = AS(H,Nt_RF)
K = size(H,1);
N = size(H,2);
deta = 10^-1;
% H£ºbeamspace channel matrix (sparse)
% N; number of retained beams
% n: total number of beams (transmit antennas)
H_abs = abs(H);
s_set = 1:N;
T_set = [];
%%% proposed search
for i = 1:Nt_RF
A = H(:,T_set);
B = inv(A*A' + deta*eye(K,K));
target = [];
for j = 1:length(s_set)
temp = H(:,s_set(j));
if ~isempty(A)
target(j) = (temp'*B^2*temp)/(1+temp'*B*temp);
else
target(j) = (temp'*temp)/(1+temp'*temp);
end
end
[~,jj] = max(target);
T_set = unique([s_set(jj) T_set]);
s_set(jj) = [];
end
S = zeros(N,Nt_RF);
for i = 1:Nt_RF
S(T_set(i),i) = 1;
end
% H_eff1 = H*S;
H_eff = H(:,T_set);
D = H_eff'*inv(H_eff*H_eff');
F = S*D;