?? mimo_ofdm_vblast_receiver.m
字號:
function [BER] = MIMO_OFDM_VBLAST_receiver(channel_est,tx_data_pilot,rx_data_pilot_frequency,MIMO_OFDM_system_par);
% ordered V-BLAST receiver
%
% Begin: April 2007
% Last edited: Sept.3, 2007
% Feng Wan
num_frame_channel_inv=MIMO_OFDM_system_par.num_frame_channel_inv;
num_tx_antenna=MIMO_OFDM_system_par.num_tx_antenna;
num_rx_antenna=MIMO_OFDM_system_par.num_rx_antenna;
num_pilot=MIMO_OFDM_system_par.num_pilot;
num_carriers=MIMO_OFDM_system_par.num_carriers;
firstnum_pilot=MIMO_OFDM_system_par.firstnum_pilot;
interval_pilot=MIMO_OFDM_system_par.interval_pilot;
channel_length=MIMO_OFDM_system_par.channel_length;
pulse_type=MIMO_OFDM_system_par.pulse_type;
if(pulse_type==1)
channel_length=MIMO_OFDM_system_par.channel_length_equivalent; % when pulse type is enabled,
% the channel_length_quivalent is the true channel length
end
% %+++++++++++++++++++++++++++++++++++++
% % generate the channel matrix for different subcarriers
% %+++++++++++++++++++++++++++++++++++++
channel_est_frequency=zeros(num_rx_antenna,num_tx_antenna,num_carriers);
for n2=1:num_rx_antenna
for n3=1:num_tx_antenna
vec_temp1=zeros(num_carriers,1);
vec_temp2=zeros(channel_length,1);
for n4=1:size(channel_est,3)
vec_temp1(n4)=channel_est(n2,n3,n4);
end
vec_freq_temp1=fft(vec_temp1);
for n4=1:num_carriers
channel_est_frequency(n2,n3,n4)=vec_freq_temp1(n4);
end
end
end
BER_subcarrier=zeros(num_carriers,1);
%%% LOOP : subcarriers
for n_subcarrier=1:num_carriers
%%% LOOP : subcarriers
% %%% begin test
% if(n_subcarrier==4)
% disp('begin check!');
% end
% %%% end test
if(rem(n_subcarrier-firstnum_pilot,interval_pilot)~=0)
[BER] = VBLAST_receiver(channel_est_frequency(:,:,n_subcarrier),rx_data_pilot_frequency(:,n_subcarrier),...
tx_data_pilot(:,n_subcarrier),num_tx_antenna);
% %%% begin test
% temp_res=norm(rx_data_pilot_frequency(:,n_subcarrier)-channel_est_frequency(:,:,n_subcarrier)...
% *tx_data_pilot(:,n_subcarrier));
%
%
% if(BER>0)
% disp('maybe problem!');
% end
%
% if(temp_res>1e-11)
% disp('maybe problem!');
% end
%
% %%% end test
BER_subcarrier(n_subcarrier)=BER;
end
%%% LOOP : subcarriers
end
%%% LOOP : subcarriers
BER=sum(BER_subcarrier)/(num_carriers-num_pilot);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -