Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

16-QAM and Rayleigh fading channel

Status
Not open for further replies.

Panoramix

Newbie level 3
Joined
Mar 20, 2006
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,364
16 qam

I am having a problem in how to send my data through a flat-fading Rayleigh channel using 16-QAM modulation. I am using the MATLAB built-in function to create the channel and am using FEC techniques for channel coding. The FEC techniques applied are divided into outer coding (Reed Solomon) and inner coding (convolutional) combined with interleavers. The RS code I use is RS(252, 168) and ½ rate convolutional coding with 10 constraint length. The coding does work for an AWGN channel so it proves that is done correctly. But is does not work for a Rayleigh channel. In my simulations the bit error probability has values nearly equal to 0.5.
The fading model appears to work correctly in differential PSK (D-BPSK – D-QPSK D-8ASK) but when I use no-differential (coherent) modulation I get error rate of 0.5. I have the same results for all values of SNR (small or large). I think that I lose symchronisation between receiver and transmitter so the decoder decides randomly, that is why I think I have the 0.5 response. What do you think I may be doing wrong? Is there something i should add to my system?
I don't know what am I doing wrong and I would really appreciate it if you could give some suggestions on how to overcome this problem.
 

bulx

Full Member level 4
Joined
Aug 7, 2004
Messages
225
Helped
47
Reputation
94
Reaction score
17
Trophy points
1,298
Activity points
1,520
rayleigh fading channel

Dont know how codeword synchronisation is achieved in your system. The RS decoder will work only if it can get the boundaries of the codeword exactly (BTW you mean (255, 168) RS code, right?). A one-bit shift is disaster. I guess you assume perfect symbol synchronisation (ie; the 4- bit symbol is recieved with perfect synch).

Also the viterbi decoder will fail in case of burst errors and deliver junk data to the RS decoder. If VD cant correct and passes on random error to the RS decoder, it wil also fail, since something like 8-bit errors spread across 8 bytes (1 bit error per byte) is equivalent to all 48 bits being in error. Does your RS decoder give you a decoding failure output?

If you have a hard decision viterbi decoder, you could change to a soft decision decode to improve performance slightly
-b
 

lincolndsp

Banned
Joined
Aug 13, 2005
Messages
71
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Location
Ukraine
Activity points
0
rayleigh convolutional

Send me the Matlab codes for simulation of whole
system and I'll try to fix the problem.
Regards
 

Panoramix

Newbie level 3
Joined
Mar 20, 2006
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,364
rayleigh fading, data generation

Thank you for your quick reply. Here is the code i am using. I want to send my data through a rayleigh fading channel using 16-QAM. Even if i use coherent BPSK modulation I have the same bad error rate results of 0.5. What i am doing wrong? Thanks in advance.


%% Setup
clear all;
close all;
clc;

% Define parameters.
M = 16; % Size of signal constellation
bits = log2(M); % Number of bits per symbol
n = 6e4; % Number of bits to process
%n = 2688; % Number of bits to process
nsamp = 4; % Oversampling rate

%% Signal Source
% Create a binary data stream as a column vector.
x = randint(n,1); % Random binary data stream

%% Outer Encoder - R-S 252 - 168
m = 8; % Number of bits in each symbol
n = 252; k = 168; % Codeword length and message length

modul = mod(length(x)/m, k);
if modul ~= 0
dataPad = [x ; zeros(((k - modul)*m), 1)];
else
dataPad = x;
end

temp1 = reshape(dataPad, m, length(dataPad)/m)';
dataTemp = bi2de(temp1, 'left-msb');
num = length(dataTemp)/k; % Number of codewords
data = reshape(dataTemp, k, length(dataTemp)/k )';

msg = gf(data,m); % Represent data using a Galois array.
t = (n-k)/2; % Error-correction capability of the code
c = rsenc(msg,n,k); % Encode the data.

%Outer Interleaver
st2 = 4831; %States for random number generator taken from matlab example for block interleaving
OutInterl = randintrlv(c,st2); % Interleave

gf2double = double(OutInterl.x)';
gf2doubleBits = de2bi(gf2double,'left-msb')';
outer = reshape(gf2doubleBits, 1, (length(gf2doubleBits) * m))';

%% Inner Encoder
% Define a convolutional coding trellis and use it
% to encode the binary data.
constr = 7;
trel = poly2trellis(constr,[171 133]); % constraint length = 7. Kolotos thesis

tblen = 5 * constr; % Traceback length for decoding
coded = convenc(outer,trel); % Encode.
coderate = 1/2;

% Inner Interleaver
st2 = 4831; %States for random number generator taken from matlab example for block interleaving
InnInterl = randintrlv(coded,st2); % Interleave

%% Bit-to-Symbol Mapping
% Convert the bits in x into k-bit symbols
xsym = bi2de(reshape(InnInterl,bits,length(InnInterl)/bits).','left-msb');

%% Modulation
%% Customised uniform gray coded 16-QAM Constellation
inphase = [ 1; 1; 3; 3; 1; 1; 3; 3; -1; -1; -3; -3; -1; -1; -3; -3 ];
quadr = [ 1; 3; 1; 3; -1; -3; -1; -3; 1; 3; 1; 3; -1; -3; -1; -3 ];
const = inphase + j*quadr;

% Modulate using cuctomised Gray Coded 16-QAM.
y = genqammod(xsym,const);

%% Filter Definition
% Define filter-related parameters.
filtorder = 40; % Filter order
delay = filtorder/(nsamp*2); % Group delay (# of input samples)
rolloff = 0.25; % Rolloff factor of filter

% Create a square root raised cosine filter.
rrcfilter = rcosine(1,nsamp,'fir/sqrt',rolloff,delay);

%% Transmitted Signal
% Upsample and apply square root raised cosine filter.
ytx = rcosflt(y,1,nsamp,'filter',rrcfilter);

% Create Rayleigh fading channel object.
chanStatic = rayleighchan;

fadedSig = filter(chanStatic,ytx); % Effect of channel for QAM signals

%% Channel
% Send signal over an AWGN channel.
EbNo = (1:20); % Range of SNR values, in dB.

%% Loop for all values of EbNo
for j = 1:length(EbNo)
snr = EbNo(j);
ynoisy = awgn(fadedSig,EbNo(j),'measured');

%% Received Signal
% Filter received signal using square root raised cosine filter.
yrx = rcosflt(ynoisy,1,nsamp,'Fs/filter',rrcfilter);
yrx = downsample(yrx,nsamp); % Downsample.
yrx = yrx(2*delay+1:end-2*delay); % Account for delay.

%% Demodulation
% Demodulate signal using 16-QAM.
zsym = genqamdemod(yrx,const);

rx = de2bi(zsym,'left-msb')'; % Convert integers to bits
rxReshaped = reshape(rx, bits * length(rx), 1);

%%Inner Decoding
deInnInterl = randdeintrlv(rxReshaped,st2); % Deinterleave.

% Decode the convolutional code.
deConv = vitdec(deInnInterl, trel, tblen, 'trunc', 'hard'); %Hard decision

%% Outer decoding
tempo = reshape(deConv, m, length(deConv)/m)';
data_temp1 = bi2de(tempo, 'left-msb');
data1 = reshape(data_temp1, n, length(data_temp1)/n)';

trans = gf(data1,m); %transform to gf array

deOutInterl = randdeintrlv(trans,st2); % Deinterleave.

decoded = rsdec(deOutInterl,n,k); % Decode the data
decodedDouble = double(decoded.x)';
temp2 = reshape(decodedDouble, k*num, 1);
col = de2bi(temp2, 'left-msb')';
coly = reshape(col, m*length(col), 1);

if modul ~= 0
[number,ratio(j)] = biterr(coly(1:end-((k - modul)*m)), x);
else
[number,ratio(j)] = biterr(coly, x);
end
disp(['EbNo: ',num2str(snr)]);
disp(['The bit error rate: ',num2str(ratio(j))]);
end

% Plot theoretical results.
figure; semilogy(EbNo,ratio,'r');
xlabel('E_b/N_0 (dB)'); ylabel('Symbol Error Rate');
grid on; drawnow;
legend('Empirical SER');
title('Empirical Error Rate');
 

Panoramix

Newbie level 3
Joined
Mar 20, 2006
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,364
square uniform qam

Can somebody please help with simulating 16-qam in a rayleigh fading channel? Am not particularly interested in what error correction is used. Thanks in advance
Regards
 

lucy_xxx

Banned
Joined
May 31, 2007
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
0
16-qam in rayleigh fading channel

hi,
have you solved the problem? as i am facing the same problem now.
can you plz help me?
mail:xliu@glam.ac.uk

thx a lot!!!
 

Eng.Mohammed

Newbie level 4
Joined
Feb 20, 2007
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,320
simulat qam awgn channel

I am facing the same problem for 16-QAM, also it does work for 4-QAM, please if you find the problem tell me, this will be kind of you
 

Asifmarri

Newbie level 1
Joined
Jun 7, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,287
examples error fading rayleigh

hi can u help me i m having the same problem of getting a ber of 0.5 when passing the signal through rayleigh channel.do i have to perform any equalization if then how?
shuld i use interlaving ?
m not working on simulink i have to generate matlab code
i m working on Mimo-ofdm as my MSc Project.
i will be very thankful if u can help me on this issue .i m anxiously waiting for ur reply

thanks in advance
plz email me at: m.asifkm@gmail.com
 

TQ

Newbie level 1
Joined
Oct 14, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
South Africa
Activity points
1,285
Hi everyone,

I am trying the basic task of simulating RS(15,13) using BPSK over a Rayleigh channel. The functions in matlab for rsenc and rsdec work fine when in AWGN, but the result does not match theory for a rayleigh channel. Can anyone guide me to find out why.

Thanks
 

cwjcwjcwj

Full Member level 5
Joined
Nov 8, 2004
Messages
273
Helped
17
Reputation
34
Reaction score
12
Trophy points
1,298
Activity points
1,714
The first thing I normally check when I am converting my AWGN-based code to Rayleigh-based code is to switch off the noise (assume the noise equal to zero for all SNR) and assume perfect channel information. You definately will get a BER = 0 for all SNR (unless you consider other factors, such as non linear device, interference and etc). This is the first step. If you not getting zero error rate. Then, I am sure there must be something wrong in your code.
 

desperado1

Full Member level 3
Joined
Sep 4, 2006
Messages
189
Helped
8
Reputation
16
Reaction score
2
Trophy points
1,298
Activity points
2,503
Re: rayleigh fading, data generation

Panoramix said:
Thank you for your quick reply. Here is the code i am using. I want to send my data through a rayleigh fading channel using 16-QAM. Even if i use coherent BPSK modulation I have the same bad error rate results of 0.5. What i am doing wrong? Thanks in advance.


%% Setup
clear all;
close all;
clc;

% Define parameters.
M = 16; % Size of signal constellation
bits = log2(M); % Number of bits per symbol
n = 6e4; % Number of bits to process
%n = 2688; % Number of bits to process
nsamp = 4; % Oversampling rate

%% Signal Source
% Create a binary data stream as a column vector.
x = randint(n,1); % Random binary data stream

%% Outer Encoder - R-S 252 - 168
m = 8; % Number of bits in each symbol
n = 252; k = 168; % Codeword length and message length

modul = mod(length(x)/m, k);
if modul ~= 0
dataPad = [x ; zeros(((k - modul)*m), 1)];
else
dataPad = x;
end

temp1 = reshape(dataPad, m, length(dataPad)/m)';
dataTemp = bi2de(temp1, 'left-msb');
num = length(dataTemp)/k; % Number of codewords
data = reshape(dataTemp, k, length(dataTemp)/k )';

msg = gf(data,m); % Represent data using a Galois array.
t = (n-k)/2; % Error-correction capability of the code
c = rsenc(msg,n,k); % Encode the data.

%Outer Interleaver
st2 = 4831; %States for random number generator taken from matlab example for block interleaving
OutInterl = randintrlv(c,st2); % Interleave

gf2double = double(OutInterl.x)';
gf2doubleBits = de2bi(gf2double,'left-msb')';
outer = reshape(gf2doubleBits, 1, (length(gf2doubleBits) * m))';

%% Inner Encoder
% Define a convolutional coding trellis and use it
% to encode the binary data.
constr = 7;
trel = poly2trellis(constr,[171 133]); % constraint length = 7. Kolotos thesis

tblen = 5 * constr; % Traceback length for decoding
coded = convenc(outer,trel); % Encode.
coderate = 1/2;

% Inner Interleaver
st2 = 4831; %States for random number generator taken from matlab example for block interleaving
InnInterl = randintrlv(coded,st2); % Interleave

%% Bit-to-Symbol Mapping
% Convert the bits in x into k-bit symbols
xsym = bi2de(reshape(InnInterl,bits,length(InnInterl)/bits).','left-msb');

%% Modulation
%% Customised uniform gray coded 16-QAM Constellation
inphase = [ 1; 1; 3; 3; 1; 1; 3; 3; -1; -1; -3; -3; -1; -1; -3; -3 ];
quadr = [ 1; 3; 1; 3; -1; -3; -1; -3; 1; 3; 1; 3; -1; -3; -1; -3 ];
const = inphase + j*quadr;

% Modulate using cuctomised Gray Coded 16-QAM.
y = genqammod(xsym,const);

%% Filter Definition
% Define filter-related parameters.
filtorder = 40; % Filter order
delay = filtorder/(nsamp*2); % Group delay (# of input samples)
rolloff = 0.25; % Rolloff factor of filter

% Create a square root raised cosine filter.
rrcfilter = rcosine(1,nsamp,'fir/sqrt',rolloff,delay);

%% Transmitted Signal
% Upsample and apply square root raised cosine filter.
ytx = rcosflt(y,1,nsamp,'filter',rrcfilter);

% Create Rayleigh fading channel object.
chanStatic = rayleighchan;

fadedSig = filter(chanStatic,ytx); % Effect of channel for QAM signals

%% Channel
% Send signal over an AWGN channel.
EbNo = (1:20); % Range of SNR values, in dB.

%% Loop for all values of EbNo
for j = 1:length(EbNo)
snr = EbNo(j);
ynoisy = awgn(fadedSig,EbNo(j),'measured');

%% Received Signal
% Filter received signal using square root raised cosine filter.
yrx = rcosflt(ynoisy,1,nsamp,'Fs/filter',rrcfilter);
yrx = downsample(yrx,nsamp); % Downsample.
yrx = yrx(2*delay+1:end-2*delay); % Account for delay.

%% Demodulation
% Demodulate signal using 16-QAM.
zsym = genqamdemod(yrx,const);

rx = de2bi(zsym,'left-msb')'; % Convert integers to bits
rxReshaped = reshape(rx, bits * length(rx), 1);

%%Inner Decoding
deInnInterl = randdeintrlv(rxReshaped,st2); % Deinterleave.

% Decode the convolutional code.
deConv = vitdec(deInnInterl, trel, tblen, 'trunc', 'hard'); %Hard decision

%% Outer decoding
tempo = reshape(deConv, m, length(deConv)/m)';
data_temp1 = bi2de(tempo, 'left-msb');
data1 = reshape(data_temp1, n, length(data_temp1)/n)';

trans = gf(data1,m); %transform to gf array

deOutInterl = randdeintrlv(trans,st2); % Deinterleave.

decoded = rsdec(deOutInterl,n,k); % Decode the data
decodedDouble = double(decoded.x)';
temp2 = reshape(decodedDouble, k*num, 1);
col = de2bi(temp2, 'left-msb')';
coly = reshape(col, m*length(col), 1);

if modul ~= 0
[number,ratio(j)] = biterr(coly(1:end-((k - modul)*m)), x);
else
[number,ratio(j)] = biterr(coly, x);
end
disp(['EbNo: ',num2str(snr)]);
disp(['The bit error rate: ',num2str(ratio(j))]);
end

% Plot theoretical results.
figure; semilogy(EbNo,ratio,'r');
xlabel('E_b/N_0 (dB)'); ylabel('Symbol Error Rate');
grid on; drawnow;
legend('Empirical SER');
title('Empirical Error Rate');

can you please explain this code
%% Modulation
%% Customised uniform gray coded 16-QAM Constellation
inphase = [ 1; 1; 3; 3; 1; 1; 3; 3; -1; -1; -3; -3; -1; -1; -3; -3 ];
quadr = [ 1; 3; 1; 3; -1; -3; -1; -3; 1; 3; 1; 3; -1; -3; -1; -3 ];
const = inphase + j*quadr;
 

cwjcwjcwj

Full Member level 5
Joined
Nov 8, 2004
Messages
273
Helped
17
Reputation
34
Reaction score
12
Trophy points
1,298
Activity points
1,714
It is a 16-QAM constellation (16 complex numbers)
 

yella

Newbie level 6
Joined
Jun 15, 2010
Messages
13
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,342
Re: examples error fading rayleigh

Asifmarri said:
hi can u help me i m having the same problem of getting a ber of 0.5 when passing the signal through rayleigh channel.do i have to perform any equalization if then how?
shuld i use interlaving ?
m not working on simulink i have to generate matlab code
i m working on Mimo-ofdm as my MSc Project.
i will be very thankful if u can help me on this issue .i m anxiously waiting for ur reply

thanks in advance
plz email me at: m.asifkm(at)gmail.com
first u have to convolve with tap values by taking first values of waveforms....then u have yo equalize using lms or anyother.....
with regards
 

Naveed khan

Newbie level 1
Joined
Jun 30, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
pakistan
Activity points
1,285
Hi all .. i am doing MS telecom .. now i am doing my master thesis. i am using matlab but i am new to it .. in my thesis CDMA is involve.

i need assitance , can some one give me CODES for a Single USER CDMA system.

thanks
Regards
Naveed
Email : naveedkhan_a@hotmail.com
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top