RENEWLab  1.1.0
RENEW project
syms2bits.m File Reference

Functions

 CN (0, nvar)
 
 switch (MOD_ORDER) case 2 % BPSK rx_data
 
demod_fcn_16qam, syms_eq arrayfun ()
 
id msb ()
 

Variables

Author(s) Create channel if awgn
 
 h = sqrt(hvar/2).*(randn(n_syms, n_ant) + 1i*randn(n_syms, n_ant))
 
end Add noise nvar = mean(mean( abs(syms).^2))/ 10^(0.1*snr)
 
 w = sqrt(nvar/2).*(randn(n_syms,1) + 1i*randn(n_syms,1))
 
 rx_syms = h.*syms + w
 
Equalize with *known * channel
 
Demodulate demod_fcn_bpsk = @(x) double(real(x)>0)
 
 demod_fcn_qpsk = @(x) double(2*(real(x)>0) + 1*(imag(x)>0))
 
 demod_fcn_16qam = @(x) (8*(real(x)>0)) + (4*(abs(real(x))<0.6325)) + (2*(imag(x)>0)) + (1*(abs(imag(x))<0.6325))
 
 demod_fcn_64qam
 
case QPSK rx_data = arrayfun(demod_fcn_qpsk, syms_eq)
 
end Do your selves
 
This is a matrix now bits_matrix = bits_matrix(:,1:end-1)
 
Maybe you need to transpose bits_matrix before reshaping it to a vector
 
 bits = bits_matrix(:)
 

Function Documentation

◆ arrayfun()

demod_fcn_16qam, syms_eq arrayfun ( )
virtual

◆ CN()

CN ( ,
nvar   
)

◆ msb()

id msb ( )
virtual

◆ switch()

switch ( MOD_ORDER  )

Variable Documentation

◆ awgn

Author (s) Create channel if awgn
Initial value:
== 0
hvar = 1

◆ bits

bits = bits_matrix(:)

◆ bits_matrix

This is a matrix now bits_matrix = bits_matrix(:,1:end-1)

◆ channel

Equalize with* known* channel

◆ demod_fcn_16qam

demod_fcn_16qam = @(x) (8*(real(x)>0)) + (4*(abs(real(x))<0.6325)) + (2*(imag(x)>0)) + (1*(abs(imag(x))<0.6325))

◆ demod_fcn_64qam

demod_fcn_64qam
Initial value:
= @(x) (32*(real(x)>0)) + (16*(abs(real(x))<0.6172)) + ...
(8*((abs(real(x))<(0.9258))&&((abs(real(x))>(0.3086))))) + ...
(4*(imag(x)>0)) + (2*(abs(imag(x))<0.6172)) + ...
(1*((abs(imag(x))<(0.9258))&&((abs(imag(x))>(0.3086)))))

◆ demod_fcn_bpsk

Demodulate demod_fcn_bpsk = @(x) double(real(x)>0)

◆ demod_fcn_qpsk

demod_fcn_qpsk = @(x) double(2*(real(x)>0) + 1*(imag(x)>0))

◆ h

else h = sqrt(hvar/2).*(randn(n_syms, n_ant) + 1i*randn(n_syms, n_ant))

◆ nvar

end Add noise nvar = mean(mean( abs(syms).^2))/ 10^(0.1*snr)

◆ rx_data

case QPSK rx_data = arrayfun(demod_fcn_qpsk, syms_eq)

◆ rx_syms

rx_syms = h.*syms + w

◆ selves

end Do your selves

◆ vector

Maybe you need to transpose bits_matrix before reshaping it to a vector

◆ w

w = sqrt(nvar/2).*(randn(n_syms,1) + 1i*randn(n_syms,1))
real
data real()
hvar
hvar
Definition: getRxVec.m:28
x
sample frequency in MHz x
Definition: getRxVec.m:86