www.pudn.com > mimoprecoding.rar > codebook_select.asv, change:2006-07-07,size:1174b


function index = codebook_select(cir,sim_options) 
global sim_consts; 
[n_tx_antennas, n_rx_antennas] = get_n_antennas(sim_options); 
cir = transpose(cir); 
[temp_r,temp_c] = size(cir); 
cir_f = zeros(64,temp_c); 
for i = 1 : temp_c 
    cir_f(:,i) = fft(cir(:,i),64); 
end 
cir_tx = zeros(2*64,temp_c/2); 
pattern = [1:2:2*64;2:2:2*64]; 
for i = 1 : temp_c/2 
    cir_tx(pattern(1,:), i) = cir_f(:,i); 
    cir_tx(pattern(2,:), i) = cir_f(:,i + temp_c/2); 
end 
for i = 1 : 64 
    for j = 1 : n_rx_antennas 
        cir_tx_subc(j,:,i) = cir_tx(j+(i-1)*n_rx_antennas,:); 
    end 
end 
w = sim_consts.beamformingvec; 
[temp_r,temp_c] = size(w); 
index = []; 
for k = 1 : 64 
    index_temp = 1; 
    max = sum(abs((transpose(w(:,1)) * transpose(cir_tx_subc(:,:,k)))).^2); 
    for i = 2 : temp_c 
        temp = sum(abs((transpose(w(:,i)) * transpose(cir_tx_subc(:,:,k)))).^2); 
        if temp >= max 
            index_temp = i; 
            max = temp; 
        end 
    end 
    index = [index index_temp]; 
end 
temp = index(1); 
feedback_bits = 1; 
for k = 1 : 64 
    if index(k) ~= temp 
        feedback_bit 
    

2018无需申请注册送58体验金