Generates QAM symbols spread in time and frequency. function [ d ] = Generate_d_QAM( Para ) The function works for SISO and MIMO systems. Input arguments: Para: structure containing the modulation parameters. Outputs arguments: d: QAM symbols. Size: matrix [2*para.M, Para.Ns] if Para.S == 1 and multidimensional array [Para.S, 2*para.M, Para.Ns] if Para.S > 1
0001 function [ d ] = Generate_d_QAM( Para ) 0002 % Generates QAM symbols spread in time and frequency. 0003 % 0004 % function [ d ] = Generate_d_QAM( Para ) 0005 % 0006 % The function works for SISO and MIMO systems. 0007 % 0008 % Input arguments: 0009 % 0010 % Para: structure containing the modulation parameters. 0011 % 0012 % Outputs arguments: 0013 % 0014 % d: QAM symbols. Size: matrix [2*para.M, Para.Ns] if Para.S == 1 and 0015 % multidimensional array [Para.S, 2*para.M, Para.Ns] if Para.S > 1 0016 % 0017 0018 0019 % This file is part of WaveComBox: www.wavecombox.com and is distributed under 0020 % the terms of the MIT license. See accompanying LICENSE file. 0021 % Original author: François Rottenberg, May 3, 2018. 0022 % Contributors: 0023 % Change log: 0024 0025 N_active=length(Para.ActiveSubcarriers); 0026 mod_norm=sqrt(Para.Es/(1./Para.M_QAM.*sum(abs(qammod([0:Para.M_QAM-1],Para.M_QAM)).^2))); 0027 0028 if Para.S==1 0029 d=zeros(Para.nSubcarriers,Para.Ns); 0030 for index_sub_act=1:N_active 0031 data =randi([0 Para.M_QAM-1],1,Para.Ns); 0032 d(Para.ActiveSubcarriers(index_sub_act),:) =qammod(data,Para.M_QAM).*mod_norm; 0033 end 0034 else 0035 d=zeros(Para.S,Para.nSubcarriers,Para.Ns); 0036 for index_S=1:Para.S 0037 for index_sub_act=1:N_active 0038 data =randi([0 Para.M_QAM-1],1,Para.Ns); 0039 d(index_S,Para.ActiveSubcarriers(index_sub_act),:) =qammod(data,Para.M_QAM).*mod_norm.*1./sqrt(Para.S); 0040 end 0041 end 0042 end 0043 0044 end 0045