generate_tx_data.m

来自「用matlab对MIMO-OFDM通信系统的设计仿真的源代码」· M 代码 · 共 22 行

M
22
字号
function [tx_data]=generate_tx_data(num_tx,num_effect_carriers,modulation_type,num_frame)
% Function generate_tx_data +++++++++++++++++++++++++++++++++++++++++++++++++
% Generate transmit data

% Input data:  num_tx - number of transmit antennas 
%              num_effect_carriers - number of the effective subcarriers for each antenna
%              modulation_type - the modulation type
%              num_frame - number of the frames
% Output data: tx_data - output transmit data matrix, in the form: tx_data(num_tx,num_effect_carriers,num_frame)

% Begin:  Feb, 2005
% Last edited: Feb.2, 2005
%   Feng Wan    

switch modulation_type
    case 1 % BPSK
		tx_data=round(rand(num_tx,num_effect_carriers,num_frame))-0.5;
    case 2 % QPSK
		tx_data=(2*round(rand(num_tx,num_effect_carriers,num_frame))-1)...
            +sqrt(-1)*(2*round(rand(num_tx,num_effect_carriers,num_frame))-1);
        tx_data=tx_data/sqrt(2);
end

⌨️ 快捷键说明

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