From: Stoic on
hi all, i am simulating LDPC code performance on Rayleigh flat fading channel,
using the following code:

load paritycheckmatrix.mat H
[M N] =size(H);
K=N-M;
R=K/N;

% Construct a companion LDPC encoder object
lenc = fec.ldpcenc(H);
% Construct a companion LDPC decoder object
ldec = fec.ldpcdec(H);
ldec.DecisionType = 'Hard decision';
ldec.OutputFormat = 'Information part';
ldec.NumIterations = 50;
% Stop if all parity-checks are satisfied
ldec.DoParityChecks = 'Yes';
% Construct a BPSK modulator object
modObj = modem.pskmod('M',2,'InputType','Bit');

Eb_N0_dB= [4.0: 8.0];
noisevar = 10^(-Eb_N0_dB/10)*1/(2*R);

% random message
msg = (sign(randn(1,K))+1)/2;
codeword = encode(lenc, msg);

% Modulate the signal (map bit 0 to 1 + 0i, bit 1 to -1 + 0i)
modulatedsig = modulate(modObj, codeword);

n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white gaussian noise, 0dB variance
h = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)] ; % Rayleigh fading channel

% Rayleigh Channel multiply and noise Noise addition
y = h.*modulatedsig +sqrt(noisevar)*n;

% equalization
yHat = y./h;

% Construct a BPSK demodulator object to compute log-likelihood ratios
demodObj = modem.pskdemod (modObj,'DecisionType','LLR','NoiseVariance',noisevar);

% BPSK Soft-decision Compute log-likelihood ratios (AWGN channel)
llr = demodulate(demodObj, yHat);

% Decode received signal
decodedmsg = decode(ldec, llr);
...
my result BER curve and FER curve are two ridiculous horizontal line!
It seems that the lstatement " llr = demodulate(demodObj, yHat); " returns an incorrect LLR value because the Noise variance has changed to another value X after euqzlization yHat = y./h. If so, how can i calculate the noise variance after equalization? anyone could help? many thanks.
 | 
Pages: 1
Prev: Semilogy Problem
Next: linear model from nonlinear