# Calculation of LLR values with variable noise variance (Scripts) 1.0

Average Rating
User Rating:
Visitors Rating:
My rating:

• Last update: 6 years ago
• Price: Free |
• Operating system: Linux, Mac OS X, Win All, BSD, Solaris
• Publisher: Bernhard Schmidt (2 other programs)
See full specifications

## Calculation of LLR values with variable noise variance (Scripts) Publisher's description

### LLR_DEMOD LLR Demodulator H = LLR_DEMOD_MEX(CONSTELLATION, MAPPING, METHOD) constructs a LLR demodulator object H for a given constellation, mapping and noise variance.

LLR_DEMOD LLR Demodulator
H = LLR_DEMOD_MEX(CONSTELLATION, MAPPING, METHOD) constructs
a LLR demodulator object H for a given constellation, mapping and noise
variance. The vectors CONSTELLATION and MAPPING are usually generated by
using MATLAB Modem Modulation Modem.<Type> and contain the complex or
real constellations points and the bit mapping, but in generall any signal
constellation and any bit-mapping can be used. METHOD determines whether
the exact LLR values or the approximations are calculated. (for more information:
http://www.mathworks.com/help/toolbox/comm/ug/bqwswmc-1.html)

A LLR demodulator object is equipped with one function:
- CALC_LLR (type "help llr_demod/calc_llr" for detailed help)

Input: CONSTELLATION [1xM]
MAPPING [1xM]
Method ['exact', 'approx']

Output: H [1x1]

Important: Before you can start you have to compile the mex-file mex_calc_llr.cpp by executing compile_mex_calc_llr.m. There is a test file and a small example of a simulation framework which will be extended in future updates. The old files can be found in the subdirectory OLD.

#######################################

These are the basic commands lines:

llr_demod_obj = mex_llr_demod(Constellation,Mapping,Methode); generate object

llr = calc_llr(llr_demod_obj,r,noise_var); % calculate llr values

New: Noise_var don't have to be a scalar value, but may be a vector of the same length as vector r.
########################################

Small example of a simulation framework:

EbN0 = 5; %dB
M = 16; % 2, 4, 16, 64 .... - QAM

get M-QAM constellation and mapping
h_mw = modem.qammod('M',M,'InputType', 'Bit','SymbolOrder','Gray');
constellation = h_mw.Constellation;
mapping = h_mw.SymbolMapping;

get variance of signal constellation (needed for the calculation of the
noise variance)
sigma_a2 = sum(abs((constellation - mean(constellation))).^2/length(constellation));

calculation of the noise variance
EsN0 = 10*log10(10.^(EbN0/10) * log2(M));
sigma_n2 = sigma_a2./(10.^(EsN0./10));

llr_demod_obj = mex_llr_demod(constellation,mapping,'exact'); generate object

for i = 1:100 % demodulate 100 frames of 1000 M-QAM Symbols

generate bitstream
u = randi([0 1],1000*log2(M),1);

do modulation with matlab object
x = modulate(h_mw,u);

H = 1/sqrt(2)*randn(size(x)) + 1i * 1/sqrt(2) * randn(size(x));
else
H = 1;
end

r = x.*H + sqrt(0.5*sigma_n2)*randn(size(x)) + 1j * sqrt(0.5*sigma_n2)*randn(size(x));

do Zero Forcing Equalization
r_hat = r./H;

do demodulation (with variable NOISE_VAR sigma_n2./abs(H).^2)
llr = calc_llr(llr_demod_obj, r_hat, sigma_n2./abs(H).^2);

end

#### System Requirements:

MATLAB 7.10 (2010a)
Program Release Status: New Release
Program Install Support: Install and Uninstall

#### Calculation of LLR values with variable noise variance (Scripts) Tags:

Click on a tag to find related softwares

## Most Popular

ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation