Effacer les filtres
Effacer les filtres

How can I simulate the MIMO section only?

2 vues (au cours des 30 derniers jours)
Liam
Liam le 18 Avr 2024
How can I just simulate the MIMO section without using the helperMIMOBER function in the example? as the version of MATLAB I am using does not support the function nargin.
I need to simulate this so I can compared existing SISO results which I have obtained previously.
  2 commentaires
Sam Chak
Sam Chak le 18 Avr 2024
Hi @Liam, I couldn't locate the custom helperMIMOBER() function in the provided link. However, @Star Strider shared the function in this comment, and the nargin command is not a new command or function.
function nber = helperMIMOBER(chan, x, snr_param, wt, wr)
Nsamp = size(x,1);
Nrx = size(chan,2);
Ntx = size(chan,1);
if nargin < 4
wt = ones(1,Ntx);
end
if nargin < 5
wr = ones(Nrx,1);
end
xt = 1/sqrt(Ntx)*(2*x-1)*wt; % map to bpsk
nber = zeros(Nrx,numel(snr_param),like,1); % real
for m = 1:numel(snr_param)
n = sqrt(db2pow(-snr_param(m))/2)*(randn(Nsamp,Nrx)+1i*randn(Nsamp,Nrx));
y = xt*chan*wr+n*wr;
xe = real(y)>0;
nber(:,m) = sum(x~=xe);
end
end
Liam
Liam le 21 Avr 2024
But what I am stuck with is how this: xt = 1/sqrt(Ntx)*(2*x-1)*wt maps to BPSK. and how would i map it to QPSK? would I square it or multiply it all by 2?

Connectez-vous pour commenter.

Réponses (1)

Sam Chak
Sam Chak le 21 Avr 2024
While I'm not an expert in BPSK and QPSK, I haven't encountered any problems when running the script in the link you provided and 'helperMIMOBER()' code on this MATLAB Answers forum.
%% The Script:
c = 3e8; % propagation speed
fc = 60e9; % carrier frequency
lambda = c/fc; % wavelength
txcenter = [0;0;0];
rxcenter = [1500;500;0];
[~,txang] = rangeangle(rxcenter,txcenter);
[~,rxang] = rangeangle(txcenter,rxcenter);
txsipos = [0;0;0];
rxsopos = [0;0;0];
g = 1; % gain for the path
sisochan = scatteringchanmtx(txsipos,rxsopos,txang,rxang,g);
Nsamp = 1e6;
x = randi([0 1],Nsamp,1);
ebn0_param = -10:2:10;
Nsnr = numel(ebn0_param);
% Now, we call the helperMIMOBER() function:
ber_siso = helperMIMOBER(sisochan,x,ebn0_param)/Nsamp
ber_siso = 1x11
0.3274 0.2866 0.2396 0.1861 0.1310 0.0789 0.0374 0.0123 0.0023 0.0002 0.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
%% the helperMIMOBER() function
function nber = helperMIMOBER(chan, x, snr_param, wt, wr)
Nsamp = size(x,1);
Nrx = size(chan,2);
Ntx = size(chan,1);
if nargin < 4
wt = ones(1,Ntx);
end
if nargin < 5
wr = ones(Nrx,1);
end
xt = 1/sqrt(Ntx)*(2*x-1)*wt; % map to bpsk
nber = zeros(Nrx,numel(snr_param), 'like', 1); % real
for m = 1:numel(snr_param)
n = sqrt(db2pow(-snr_param(m))/2)*(randn(Nsamp,Nrx)+1i*randn(Nsamp,Nrx));
y = xt*chan*wr+n*wr;
xe = real(y)>0;
nber(:,m) = sum(x~=xe);
end
end

Produits


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by