yang69 / MIMO-OFDM-Wireless-Communications-with-MATLAB

MATLAB Code for MIMO-OFDM Wireless Communications with MATLAB | MIMO-OFDM无线通信技术及MATLAB实现
GNU General Public License v3.0
331 stars 145 forks source link

Error in line 85 #1

Open andi-ra opened 3 years ago

andi-ra commented 3 years ago
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 commented 2 years ago

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

HBTANK commented 2 years ago

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 commented 2 years ago

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