www.pudn.com > mimoprecoding.rar > single_packet.m, change:2006-07-19,size:1885b


function [raw_bits_cnt, raw_bit_errs, feedback_bits] = single_packet(sim_options) 
global flag; 
global sim_consts; 
global codebook_index; 
load CB004064.mat 
sim_consts.beamformingvec = optbook; 
flag = 0; 
% Generate channel impulse response 
cir = get_channel_ir(sim_options); 
%cir2 = get_channel_ir(sim_options);  %临小区信道 
 
%corelation = corelation_H(cir,sim_options); 
 
%select vector from coodbook 
%[codebook_index feedback_bits] = codebook_select(cir,sim_options); 
%[codebook_index feedback_bits] = codebook_select2(cir,sim_options); 
[codebook_index feedback_bits] = codebook_select_interp(cir,sim_options); 
 
% Generate tx signal, returns also information bits and raw bits 
[tx_signal, tx_bits, flag] = transmitter(sim_options); 
%[tx_signal2, tx_bits2, flag] = transmitter(sim_options); 
%beamforming 
% if sim_options.UseTxDiv == 2 
%     tx_signal = tx_signal.*repmat(sim_consts.beamformingvec(:,codebook_index),1,size(tx_signal,2)); 
% end 
% Channel model 
rx_signal = channel(tx_signal, cir, sim_options); 
%rx_signal2 = channel(tx_signal2, cir2, sim_options); 
%beamforming combine 
% if sim_options.UseTxDiv == 2 
%     rx_signal = rx_signal.*repmat(conj(sum(sim_consts.beamformingvec(:,codebook_index))),2,size(rx_signal,2)); 
% end 
%Receiver, return data bits and undecoded bits 
%rx_signal = rx_signal + (1/6^2)*rx_signal2; 
[raw_bits] = receiver(rx_signal, cir, sim_options); 
% Calculate bit errors 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% pad_bits = randn(1, length(raw_bits)-tx_bits) > 0;%将接收比特补齐位数 
% raw_bits = [raw_bits  pad_bits]; 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
raw_bit_errs = sum(abs(raw_bits(1:length(tx_bits))-tx_bits)); 
raw_bits_cnt = length(tx_bits); 
% inf_bit_errs = sum(abs(rx_inf_bits(1:length(tx_inf_bits))-tx_inf_bits)); 
% inf_bits_cnt = length(tx_inf_bits); 

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