Home > WaveComBox > Toolbox > Transmitter > Generate_d_PAM.m

Generate_d_PAM

PURPOSE ^

Generates PAM real symbols spread in time and frequency.

SYNOPSIS ^

function [ d ] = Generate_d_PAM( Para )

DESCRIPTION ^

 Generates PAM real symbols spread in time and frequency.

 function [ d ] = Generate_d_PAM( Para )

 The function works for SISO and MIMO systems.

 Input arguments:

   Para: structure containing the modulation parameters.

 Outputs arguments:

   d: OQAM/PAM real symbols. Size: matrix [2*para.M, 2*Para.Ns] if Para.S
   == 1 and multidimensional array [Para.S, 2*para.M, 2*Para.Ns] if Para.S
   > 1

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ d ] = Generate_d_PAM( Para )
0002 % Generates PAM real symbols spread in time and frequency.
0003 %
0004 % function [ d ] = Generate_d_PAM( 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: OQAM/PAM real symbols. Size: matrix [2*para.M, 2*Para.Ns] if Para.S
0015 %   == 1 and multidimensional array [Para.S, 2*para.M, 2*Para.Ns] if Para.S
0016 %   > 1
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/2/(1./Para.M_PAM.*sum(abs(pammod([0:Para.M_PAM-1],Para.M_PAM)).^2)))*1./sqrt(Para.S);
0027 
0028 if Para.S==1
0029     d=zeros(Para.nSubcarriers,2*Para.Ns);  
0030     for index_sub_act=1:N_active
0031         data =randi([0 Para.M_PAM-1],1,2*Para.Ns);
0032         d(Para.ActiveSubcarriers(index_sub_act),:) =pammod(data,Para.M_PAM).*mod_norm;
0033     end
0034 else
0035     d=zeros(Para.S,Para.nSubcarriers,2*Para.Ns);
0036     for index_S=1:Para.S
0037         for index_sub_act=1:N_active
0038             data =randi([0 Para.M_PAM-1],1,2*Para.Ns);
0039             d(index_S,Para.ActiveSubcarriers(index_sub_act),:) =pammod(data,Para.M_PAM).*mod_norm;
0040         end
0041     end
0042 end
0043 
0044 end

Generated on Mon 24-Jun-2019 13:51:48 by m2html © 2005