📄 rake2d.m
字号:
function [w, wh, wd]...
= rake2d(M, T, P, delay_spread, ind_sin, ind_in, mfx, mfy_IN, mfd_PSC, DD)
% Implements ES-D, ES-DD, BS-DD beamformers, w/ or w/o self-decorrelator
%
% Inputs:
% M --- # of data symbol in block processing
% T --- dimension of beamspace
% L --- # of time samples per chip
% Nc --- # of chips per data symbol
% mfx --- despreading filter's output
% mfy_S --- despreading filter's output, in hypothetical case with only SOI
% mfd_PSC --- self-decorrelating projector's output thru a "dump" code
% DD --- flag for the frequency version of beamformer
%
% Outputs:
% w --- for CZR's original algorithm w/o self-decorrelator
% wd --- for CZR's algorithm w/ self-decorrelator
% wh --- for CZR's algorithm w/o self-decorrelator --- hypothetically w/o SOI in I+N delay segment:
% mfx_sin_stack --- output vector reshaped from the matched filter with SOI+I+N
% mfy_S_sin_stack --- output vector reshaped from the matched filter with SOI only
% possibly transforming from element-space to beamspace:
% T = I if no beamspace transofrmation:
mfx = T' * mfx;
mfy_IN = T' * mfy_IN;
mfd_PSC = T' * mfd_PSC;
% segment delay axis into the S+I+N delay segment and the I+N delay segment:
mfx_sin = mfx(:,ind_sin);
mfx_in = mfx(:,ind_in);
mfy_IN_in = mfy_IN(:,ind_in);
mfd_PSC_in = mfd_PSC(:,ind_in);
clear mfx mfy_IN mfd_PSC;
% form space-delay vector-space:
mfx_sin_stack = [];
mfx_in_stack = [];
mfy_IN_in_stack = [];
mfd_PSC_in_stack = [];
for m = 1:M
ind_s = (m-1)*delay_spread+1;
ind_e = m *delay_spread;
mfx_sin_stack = [mfx_sin_stack stack(mfx_sin(:, ind_s:ind_e))];
end;
for p = 1:M*P
ind_s = (p-1)*delay_spread+1;
ind_e = p *delay_spread;
mfx_in_stack = [mfx_in_stack stack(mfx_in(:, ind_s:ind_e))];
mfy_IN_in_stack = [mfy_IN_in_stack stack(mfy_IN_in(:, ind_s:ind_e))];
mfd_PSC_in_stack = [mfd_PSC_in_stack stack(mfd_PSC_in(:, ind_s:ind_e))];
end;
clear mfx_sin mfx_in mfy_IN_in mfd_PSC_in;
Rmfx_sin_stack = mfx_sin_stack * mfx_sin_stack';
Rmfx_in_stack = mfx_in_stack * mfx_in_stack';
Rmfy_IN_in_stack = mfy_IN_in_stack * mfy_IN_in_stack';
Rmfd_PSC_in_stack = mfd_PSC_in_stack * mfd_PSC_in_stack';
clear mfx_sin_stack mfx_in_stack mfy_IN_in_stack mfd_PSC_in_stack;
% 2D beamformer of CZR's original algorithm --- SPT 06/2000:
[Vec, Val] = eig(Rmfx_sin_stack, Rmfx_in_stack);
[Val, Ind] = sort(diag(Val));
w = Vec(:,Ind(end));
w = w / norm(w);
clear Rmfx_in_stack;
% 2D beamformer of the hypothetical case w/o SOI energy in I+N delay segment:
[Vec, Val] = eig(Rmfx_sin_stack, Rmfy_IN_in_stack);
[Val, Ind] = sort(diag(Val));
wh = Vec(:,Ind(end));
wh = wh / norm(wh);
clear Rmfy_IN_in_stack;
% 2D beamformer of CZR's algorithm w/ self-decorrelator pre-processing:
[Vec, Val] = eig(Rmfx_sin_stack, Rmfd_PSC_in_stack);
[Val, Ind] = sort(diag(Val));
wd = Vec(:,Ind(end));
wd = wd / norm(wd);
clear Rmfx_sin_stack Rmfd_PSC_in_stack;
%if DD == 1
%mfx_sinDD = fft(mfx_sin.').';
%mfy_IN_inDD = fft(mfy_IN_in.').';
%mfd_PSC_inDD = fft(mfd_PSC_in.').';
%
%mfx_sin_DD = mfx_sinDD(:,[10*L-4:10*L 1:5]);
%mfy_IN_in_DD = mfy_IN_inDD(:,[10*L-4:10*L 1:5]);
%mfd_PSC_in_DD = mfd_IN_inDD(:,[10*L-4:10*L 1:5]);
%
%mfx_sin_stack = [mfx_sin_stack stack(mfx_sin_DD)];
%mfy_IN_in_stack = [mfy_IN_in_stack stack(mfy_IN_in_DD)];
%mfd_PSC_in_stack = [mfd_PSC_in_stack stack(mfd_PSC_in_DD)];
%end;
%Y_in_stack = [];
%X_in_stack = [];
%X0_in_stack = [];
%for cont_in = 1 : 4 : length(x_in)-(10*L) % counter for swepping all the samples
% in x_in with a block of 10*L FFT
%now_in = x_in(:,cont_in:cont_in+10*L-1);
%if DD == 1
%fft_in = fft(now_in.').';
%in = fft_in(:,[10*L-4:10*L 1:5]);
%X_in_stack = [X_in_stack,stack(in)];
%end;
%now_in = y_in(:,cont_in:cont_in+10*L-1);
%if DD == 1
%fft_in = fft(now_in.').';
%in = fft_in(:,[10*L-4:10*L 1:5]);
%Y_in_stack = [Y_in_stack,stack(in)];
%end;
%now_in = x0_in(:, cont_in : cont_in+10*L-1);
%if DD == 1
%fft_in = fft(now_in.').';
%in = fft_in(:,[10*L-4:10*L 1:5]);
%X0_in_stack = [X0_in_stack,stack(in)];
%end;
%Rxx_in = Rxx_in + X_in_stack*X_in_stack';
%Ryy_in = Ryy_in + Y_in_stack*Y_in_stack';
%Rxx0_in = Rxx0_in + X0_in_stack*X0_in_stack';
%end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -