RENEWLab
1.1.0
RENEW project
|
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(:) | |
|
virtual |
CN | ( | 0 | , |
nvar | |||
) |
|
virtual |
switch | ( | MOD_ORDER | ) |
bits = bits_matrix(:) |
Equalize with* known* channel |
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 |
Maybe you need to transpose bits_matrix before reshaping it to a vector |