Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Line 13 of mapper.m file #3

Open
HBTANK opened this issue Jan 7, 2022 · 0 comments
Open

Error in Line 13 of mapper.m file #3

HBTANK opened this issue Jan 7, 2022 · 0 comments

Comments

@HBTANK
Copy link

HBTANK commented Jan 7, 2022

function [modulated_symbols,Mod] = mapper(b,N)
% If N is given, it generates a block of N random 2^b-PSK/QAM modulated symbols.
% Otherwise, it generates a block of 2^b-PSK/QAM modulated symbols for [0:2^b-1].

% MIMO-OFDM Wireless Communications with MATLAB¢ç Yong Soo Cho, Jaekwon Kim, Won Young Yang and Chung G. Kang
% 2010 John Wiley & Sons (Asia) Pte Ltd

% http://www.wiley.com//legacy/wileychi/cho/

M=2^b; % Modulation order or Alphabet (Symbol) size
if b==1, Mod='BPSK'; A=1; mod_object=modem.pskmod('M',M);
elseif b==2, Mod='QPSK'; A=1;
mod_object=modem.pskmod('M',M,'PhaseOffset',pi/4);
else Mod=[num2str(2^b) 'QAM']; Es=1; A=sqrt(3/2/(M-1)Es);
mod_object=modem.qammod('M',M,'SymbolOrder','gray');
end
if nargin==2 % generates a block of N random 2^b-PSK/QAM modulated symbols
modulated_symbols = A
modulate(mod_object,randint(1,N,M));
else
modulated_symbols = A*modulate(mod_object,[0:M-1]);
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant