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 85 #1

Open
andi-ra opened this issue Dec 4, 2020 · 3 comments
Open

Error in line 85 #1

andi-ra opened this issue Dec 4, 2020 · 3 comments

Comments

@andi-ra
Copy link

andi-ra commented Dec 4, 2020

Cattura

Matrix dimensions must agree.

Error in OFDM_basic (line 85)
Neb=Neb+sum(sum(de2bi(X_r,Nbps)~=de2bi(X,Nbps)));

I managed to find a workaround, you can find the corrected (working) file at this address:

[https://gist.github.com/andi-ra/34054a494054d6714f2a374f5738951f]

Everything seems working, feel free to reach if my solution is not correct. Thank you for that great book!!

@doublesmallcw
Copy link

@andi-ra Thanks bro,my bug is same with you.I use the method of you, I deal with it,thanks!

@HBTANK
Copy link

HBTANK commented Jan 18, 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 = Amodulate(mod_object,randint(1,N,M));
else
modulated_symbols = A*modulate(mod_object,[0:M-1]);
end

@HBTANK
Copy link

HBTANK commented Jan 18, 2022

above code is not running can you please help???

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

3 participants