⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mimo_ofdm_receiver.m

📁 用matlab对MIMO-OFDM通信系统的设计仿真的源代码
💻 M
字号:
function [rx_data_pilot_frequency,rx_data_depulsed_time]=MIMO_OFDM_receiver(rx_signal_time,MIMO_OFDM_system_par)
% Function MIMO_OFDM_receiver +++++++++++++++++++++++++++++++++++++++++++++++++
% Realize the receiver of MIMO OFDM system

% Input data:  rx_signal_time - receive time signal of MIMO OFDM system
%              MIMO_OFDM_system_par - parameters of MIMO OFDM system
% Output data: rx_data_pilot_frequency - receive frequency signal of MIMO OFDM system
%                          (num_rx_antenna,num_carriers,num_frame_channel_inv)
%              rx_data_depulsed_time - receive signal after the matched filter for pulse shaping filter in time domain
%   if pulse shaping is disabled, (num_rx_antenna,num_carriers+num_guard_length+channel_length-1,num_frame_channel_inv)
%   if pulse shaping is enabled, (num_rx_antenna,num_carriers+num_guard_length+pulse_delay*2+channel_lenght-1,num_frame_channel_inv)

% Begin:  Feb, 2005
% Last edited: Feb.6, 2005
%   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_carriers=MIMO_OFDM_system_par.num_carriers;
num_effect_carriers=MIMO_OFDM_system_par.num_effect_carriers;
num_guard_length=MIMO_OFDM_system_par.num_guard_length;
num_pilot=MIMO_OFDM_system_par.num_pilot;
firstnum_pilot=MIMO_OFDM_system_par.firstnum_pilot;
interval_pilot=MIMO_OFDM_system_par.interval_pilot;
modulation_type=MIMO_OFDM_system_par.modulation_type;
pilot_type=MIMO_OFDM_system_par.pilot_type;
pulse_type=MIMO_OFDM_system_par.pulse_type;

if(pulse_type==1)
    pulse_oversampling=MIMO_OFDM_system_par.pulse_oversampling;
    pulse_filt_order=MIMO_OFDM_system_par.pulse_filt_order;
    pulse_rolloff_factor=MIMO_OFDM_system_par.pulse_rolloff_factor;
    pulse_delay=MIMO_OFDM_system_par.pulse_delay; 
    channel_length_equivalent=MIMO_OFDM_system_par.channel_length_equivalent;    
end
noise_type=MIMO_OFDM_system_par.noise_type;
if(noise_type==1)
    SNR=MIMO_OFDM_system_par.SNR;
    wgn=10^(-SNR/10);
end
enable_LS_algorithm=MIMO_OFDM_system_par.enable_LS_algorithm;
channel_length=MIMO_OFDM_system_par.channel_length;

%+++++++++++++++++++++++++++++++++++++++++++ 
% Add noise at each recieve antenna
%+++++++++++++++++++++++++++++++++++++++++++ 

if(noise_type==1)
    % make AWGN noise(complex)
    AWGNoise=sqrt(wgn)*(randn(size(rx_signal_time))+sqrt(-1)*randn(size(rx_signal_time)))/sqrt(2); 
    rx_signal_noise_time=rx_signal_time+AWGNoise;
else
    rx_signal_noise_time=rx_signal_time;
end

%+++++++++++++++++++++++++++++++++++++++++++ 
% pulse shaping filter
%+++++++++++++++++++++++++++++++++++++++++++ 

if(pulse_type==1)
    pulse_rrcfilter=rcosine(1,pulse_oversampling,'fir/sqrt',pulse_rolloff_factor,pulse_delay);
    rx_data_depulsed_time=zeros(num_rx_antenna,num_carriers+num_guard_length+channel_length_equivalent-1,num_frame_channel_inv);
    for n1=1:num_frame_channel_inv
        for n2=1:num_rx_antenna
            rx_vec_temp=rx_signal_noise_time(n2,:,n1).';
            rx_vec_temp2=rcosflt(rx_vec_temp,1,pulse_oversampling,'Fs/filter',pulse_rrcfilter);
            rx_vec_temp3=downsample(rx_vec_temp2,pulse_oversampling); % Downsample.
            rx_data_depulsed_time(n2,:,n1)=rx_vec_temp3(:).';
        end
    end    
else
    rx_data_depulsed_time=rx_signal_noise_time;
end

%+++++++++++++++++++++++++++++++++++++++++++ 
% OFDM demodulation
%+++++++++++++++++++++++++++++++++++++++++++ 

rx_data_pilot_frequency=zeros(num_rx_antenna,num_carriers,num_frame_channel_inv);
for n1=1:num_frame_channel_inv
    for n2=1:num_rx_antenna
        [temp_vec]=OFDM_demodulator(rx_data_depulsed_time(n2,:,n1),num_guard_length,num_carriers);
        for n3=1:length(temp_vec)
            rx_data_pilot_frequency(n2,n3,n1)=temp_vec(n3);
        end
    end
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -