Beruflich Dokumente
Kultur Dokumente
DECLARATION OF ORIGINALITY
UNIVERSITY OF PRETORIA
The University of Pretoria places great emphasis upon integrity and ethical conduct in the preparation of all written work submitted
for academic evaluation.
While academic staff teach you about referencing techniques and how to avoid plagiarism, you too have a responsibility in this
regard. If you are at any stage uncertain as to what is required, you should speak to your lecturer before any written work is submitted.
You are guilty of plagiarism if you copy something from another authors work (e.g. a book, an article or a website) without
acknowledging the source and pass it off as your own. In effect you are stealing something that belongs to someone else. This is not
only the case when you copy work word-for-word (verbatim), but also when you submit someone elses work in a slightly altered form
(paraphrase) or use a line of argument without acknowledging it. You are not allowed to use work previously produced by another
student. You are also not allowed to let anybody copy your work with the intention of passing if off as his/her work.
Students who commit plagiarism will not be given any credit for plagiarised work. The matter may also be referred to the
Disciplinary Committee (Students) for a ruling. Plagiarism is regarded as a serious contravention of the Universitys rules and can
lead to expulsion from the University.
The declaration which follows must accompany all written work submitted while you are a student of the University of Pretoria.
No written work will be accepted unless the declaration has been completed and attached.
Declaration
1. I understand what plagiarism is and am aware of the Universitys policy in this regard.
2. I declare that this assignment report is my own original work. Where other peoples work has been used (either from a printed
source, Internet or any other source), this has been properly acknowledged and referenced in accordance with departmental
requirements.
3. I have not used work previously produced by another student or any other person to hand in as my own.
4. I have not allowed, and will not allow, anyone to copy my work with the intention of passing it off as his or her own work.
SIGNATURE:
DATE:
Contents
1.1
1.2
1.3
1.4
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Problem Definition and Methodology . . . . . . . . . . . . . . . . . . . . . . .
1.2.1 Decision Feedback Equalisation . . . . . . . . . . . . . . . . . . . . . .
1.2.2 Maximum Likelihood Sequence Estimation (using Viterbi Algorithm)
1.2.3 Effects of channel impulse response . . . . . . . . . . . . . . . . . . . .
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3.1 Decision Feedback Equalisation . . . . . . . . . . . . . . . . . . . . . .
1.3.2 Maximum Likelihood Sequence Estimation (using Viterbi Algorithm)
Discussion and Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3
4
4
5
6
7
7
8
9
1.1
Introduction
Figure 1.1: Example communication network showing Rx and Tx effected by a multipath reflected disturbance waves
1.2
1.2.1
The DFE adaptive equalisation method uses the feedback from already known or assumed symbols in combination with regular methods to predict the future symbols. An important characteristic to consider is the
presence of header symbols.
Figure 1.2: A simplified illustration of a typical data block from a trasmitted sequence with header or tail
symbols to accomodate DFE or MLSE algorithms
The DFE algorithm uses delta values (inversely proportional to the probability of the future symbol) to
estimate the value of the future symbol at k for layer n for a channel impulse length of L = 3:
snk = |rk (sk c0 + sk1 c1 + sk2 c2 )|2
Note how noise is ignored in the calculation because of the uncertainty in its estimation.
1.2.2
MLSE is an extension of DFE where a trellis structure is used to denote possible combinations of the
sequence. The maximum likelihood sequence is then estimated by comparing the path costs (delta values
as calculated in DFE) , the most likely sequence is then the path of shortest cost. The Viterbi algorithm is
used to find the path of shortest cost for the state space associated with the sequence. A common way of
expressing this state space is with a trellis diagram.
Figure 1.4: Flow chart depicting the methodology behind simulating the multipath channel
1.2.3
The effect of non-decreasing and non-monotonic channel impulse response vectors will also be tested on both
equalisers to assess their viability in real world applications and the effects that these inconsistencies have.
Both equalisers will be tested with the given response,
C = [0.89, 0.42, 0.12]
as well as random response generation (using Marsaglia-Bray algorithm):
C=[
,
,
]
3
3
3
=1
1.3
1.3.1
Results
Decision Feedback Equalisation
The BER plot for DFE proved to be consistent with the theoretical plots provided by theoretical approximations. Some jaggedness is apparent for the plot due to insufficient run averages.
Figure 1.5: Plot of the BER plots generated running an average of 50 iterations through the SNR range
-4dB to 8dB for the DFE equaliser
1.3.2
The results for the MLSE equaliser yielded a curve similar to the one from the DFE results, however the
MLSE is noticeably better with non-decreasing channel impulse responses.
Figure 1.6: BER plot for the MLSE equaliser through SNR range from -4dB to 8dB
1.4
Overall, both equalisers performed as expected for the most part. Both equalisers seem to perform almost
identically for the same linearly decreasing channel response. The two equalisers are however not equally
matched when it comes to decoding information with an irregular (or non-decreasing) channel impulse
response.
Bibliography
[1] J. G. Proakis, M. Salehi, N. Zhou, and X. Li, Communication systems engineering, vol. 1. Prentice-hall
Englewood Cliffs, 1994.
[2] Z. Jia, Y. Cai, H.-C. Chien, and J. Yu, Performance comparison of spectrum-narrowing equalizations
with maximum likelihood sequence estimation and soft-decision output, Optics express, vol. 22, no. 5,
pp. 60476059, 2014.
10
for i=1+noHeaders:N+(noHeaders)
[ randWich , s1, s2, s3 ] = WichmannHill(s1,s2,s3);
transmittedSymbols(i) = ((randWich > 0.5) * 2) - 1 ; % generate the symbols
r(i-noHeaders) = transmittedSymbols(i)*CIR(1) + transmittedSymbols(i-1)*CIR(2) + transmittedSymbols(i% add noise: TODO getSigma(SNRdB(i), 1)
r(i-noHeaders) = r(i-noHeaders)+ (getSigma(SNRdB(iSNR), 1) * MarsagliaBray());
end
% at this point we have generated a received data vector r with noise and
% multipath element interfearance.
for i=1 : N % N
% loop through each of the received vectors and equalize.
% using DFE we use the previously known symbols.
tempS1 = eqSymbols(i:i+noHeaders-1);
tempS1(L) = 1;
11
tempS2 = eqSymbols(i:i+noHeaders-1);
tempS2(L) = -1;
delta s1 = DeltaDFE(CIR, r(i), tempS1, L);
delta s2 = DeltaDFE(CIR, r(i), tempS2, L);
if (DeltaDFE(CIR, r(i), tempS1, L) < DeltaDFE(CIR, r(i), tempS2, L))
% if delta(s1) is < delta(s2) then we know its s1.
eqSymbols(noHeaders+i) = 1;
else
eqSymbols(noHeaders+i) = -1;
end
if (eqSymbols(noHeaders+i) ~= transmittedSymbols(noHeaders+i))
nErrors = nErrors + 1;
end
% now we have decided and assumed the value of the data bit at r(i).
end
nErrorsAvg = nErrorsAvg + nErrors;
end
BERvalues(iSNR) = (nErrorsAvg / noRunsEach) / N;
disp('Finished an SNR level');
end
semilogy(SNRdB, BERvalues, 'b');
hold on;
% NOW do it for randomly generated CIR:
% same process but now the CIR changes each iteration:
% CIR = [0.89, 0.42, 0.12]; % this is the channel impulse response.
% allocate space:
eqSymbols = zeros(1, N + (noHeaders)); % incl. headers
transmittedSymbols = zeros(1, N + (noHeaders)); % incl. headers
r = zeros(1,N); % only data, no headers.
nErrors = 0;
% generate received symbol vector (using the generators from first
% practical)
% UNIFORM - WICHMANN HILL
% GAUSSIAN - MARSAGLIA BRAY
transmittedSymbols(1:2) = 1; % assign headers as s1.
eqSymbols(1:2) = 1; % assign headers as s1.
for i=1+noHeaders:N+(noHeaders)
[ randWich , s1, s2, s3 ] = WichmannHill(s1,s2,s3);
transmittedSymbols(i) = ((randWich > 0.5) * 2) - 1 ; % generate the symbols
r(i-noHeaders) = transmittedSymbols(i)*CIR(1) + transmittedSymbols(i-1)*CIR(2) + transmittedSymbols(i% add noise: TODO getSigma(SNRdB(i), 1)
r(i-noHeaders) = r(i-noHeaders)+ (getSigma(SNRdB(iSNR), 1) * MarsagliaBray());
end
12
% at this point we have generated a received data vector r with noise and
% multipath element interfearance.
for i=1 : N % N
% loop through each of the received vectors and equalize.
% using DFE we use the previously known symbols.
tempS1 = eqSymbols(i:i+noHeaders-1);
tempS1(L) = 1;
tempS2 = eqSymbols(i:i+noHeaders-1);
tempS2(L) = -1;
delta s1 = DeltaDFE(CIR, r(i), tempS1, L);
delta s2 = DeltaDFE(CIR, r(i), tempS2, L);
if (DeltaDFE(CIR, r(i), tempS1, L) < DeltaDFE(CIR, r(i), tempS2, L))
% if delta(s1) is < delta(s2) then we know its s1.
eqSymbols(noHeaders+i) = 1;
else
eqSymbols(noHeaders+i) = -1;
end
if (eqSymbols(noHeaders+i) ~= transmittedSymbols(noHeaders+i))
nErrors = nErrors + 1;
end
% now we have decided and assumed the value of the data bit at r(i).
end
nErrorsAvg = nErrorsAvg + nErrors;
end
BERvaluesRand(iSNR) = (nErrorsAvg / noRunsEach) / N;
disp('Finished an SNR level');
end
semilogy(SNRdB, BERvaluesRand, 'r');
hold on;
title('A bit-error rate curve for BPSK sequence with a DFE equaliser');
legend('Given CIR', 'Random CIR');
xlabel('SNR (in dB)');
ylabel('BER');
13
MLSE.m
clear all;
close all;
clc;
SNRdB = -4:0.1:10 ; % run from -4 to 8 dB.
BERvalues = zeros(1,length(SNRdB));
BERvaluesRand = zeros(1,length(SNRdB));
noRunsEach = 100;
% seeds:
a = clock;
s1 = sum(a(1:6));
s2 = floor(prod(a(4:6)));
s3 = floor(prod(a(1:2)));
N = 300; % size of the data received.
CIR = [0.89, 0.42, 0.12]; % this is the channel impulse response.
L = size(CIR,2); % channel impulse length L. should be 3.
noHeaders = L - 1;
% allocate the transmitted symbol vector:
% ( including the headers and tails. )
% no headers = L - 1, so: 2 headers.
for iSNR = 1:length(SNRdB)
nErrorsAvg = 0;
for n=1:noRunsEach
% allocate space:
eqSymbols = zeros(1, N + (noHeaders)); % incl. headers
transmittedSymbols = zeros(1, N + (noHeaders)); % incl. headers
r = zeros(1,N); % only data, no headers.
nErrors = 0;
% generate received symbol vector (using the generators from first
% practical)
% UNIFORM - WICHMANN HILL
% GAUSSIAN - MARSAGLIA BRAY
transmittedSymbols(1:2) = 1; % assign headers as s1.
eqSymbols(1:2) = 1; % assign headers as s1.
for i=1+noHeaders:N+(noHeaders)
[ randWich , s1, s2, s3 ] = WichmannHill(s1,s2,s3);
transmittedSymbols(i) = ((randWich > 0.5) * 2) - 1 ; % generate the symbols
r(i-noHeaders) = transmittedSymbols(i)*CIR(1) + transmittedSymbols(i-1)*CIR(2) + transmittedSymbols(i% add noise: TODO getSigma(SNRdB(i), 1)
r(i-noHeaders) = r(i-noHeaders)+ (getSigma(SNRdB(iSNR), 1) * MarsagliaBray());
end
% at this point we have generated a received data vector r with noise and
% multipath element interfearance.
eqSymbols(3:N+noHeaders) = doViterbi(r, CIR);
for i=1 : N
if (eqSymbols(noHeaders+i) ~= transmittedSymbols(noHeaders+i))
nErrors = nErrors + 1;
end
end
nErrorsAvg = nErrorsAvg + nErrors;
end
14
% allocate space:
eqSymbols = zeros(1, N + (noHeaders)); % incl. headers
transmittedSymbols = zeros(1, N + (noHeaders)); % incl. headers
r = zeros(1,N); % only data, no headers.
nErrors = 0;
% generate received symbol vector (using the generators from first
% practical)
% UNIFORM - WICHMANN HILL
% GAUSSIAN - MARSAGLIA BRAY
transmittedSymbols(1:2) = 1; % assign headers as s1.
eqSymbols(1:2) = 1; % assign headers as s1.
for i=1+noHeaders:N+(noHeaders)
[ randWich , s1, s2, s3 ] = WichmannHill(s1,s2,s3);
transmittedSymbols(i) = ((randWich > 0.5) * 2) - 1 ; % generate the symbols
r(i-noHeaders) = transmittedSymbols(i)*CIR(1) + transmittedSymbols(i-1)*CIR(2) + transmittedSymbols(i% add noise: TODO getSigma(SNRdB(i), 1)
r(i-noHeaders) = r(i-noHeaders)+ (getSigma(SNRdB(iSNR), 1) * MarsagliaBray());
end
% at this point we have generated a received data vector r with noise and
% multipath element interfearance.
eqSymbols(3:N+noHeaders) = doViterbi(r, CIR);
for i=1 : N
if (eqSymbols(noHeaders+i) ~= transmittedSymbols(noHeaders+i))
nErrors = nErrors + 1;
end
end
% now we have decided and assumed the value of the data bit at r(i).
nErrorsAvg = nErrorsAvg + nErrors;
end
BERvaluesRand(iSNR) = (nErrorsAvg / noRunsEach) / N;
disp('Finished an SNR level');
end
semilogy(SNRdB, BERvaluesRand, 'r');
hold on;
title('A bit-error rate curve for BPSK sequence with a DFE equaliser');
15
Delta.m
function RESULT = Delta(cir, r, s)
RESULT = abs( r - (cir(1))*s(1) - (cir(2))*s(2) - (cir(3))*s(3)).2;
end
DeltaDFE.m
function RESULT = DeltaDFE(cir, r, s, Lsize)
if (size(s,2) ~= Lsize)
disp('delta s size mismatch');
RESULT = 0;
else
%RESULT = abs( r - (cir(1))*s(3) - (cir(2))*s(2) - (cir(3))*s(1)).2;
tempResult = r;
for i=1:Lsize
tempResult = tempResult - cir(i)*s(Lsize - (i-1));
end
RESULT = abs(tempResult).2;
end
end
16
doViterbi.m
% function that equalizes a given received vector using MLSE - Viterbi.
function RESULT = doViterbi( r, CIR )
% given r, the sequence (preamble ommitted)
L = size(CIR,2);
N = size(r, 2);
%allocate the shifted symbols vector (could do dynamically but meh)
%represents the transitions of the 4 states.
symb = [ 1 1 1 ; -1 1 1;
1 1 -1 ; -1 1 -1;
1 -1 1 ; -1 -1 1;
1 -1 -1 ; -1 -1 -1 ];
for i=1:N
% for all layers:
distance(1,i+1)=
distance(2,i+1)=
distance(3,i+1)=
distance(4,i+1)=
end
min(distance(1,i)+delta
min(distance(1,i)+delta
min(distance(2,i)+delta
min(distance(2,i)+delta
values(1,i),distance(3,i)+delta
values(2,i),distance(3,i)+delta
values(3,i),distance(4,i)+delta
values(4,i),distance(4,i)+delta
values(5,i));
values(6,i));
values(7,i));
values(8,i));
17
getPrev.m
function [prevState,resultBit] = getPrev(curr,distance prev,weight)
if(curr==1)
if(distance prev(1)+weight(1) <= distance prev(3)+weight(5))
prevState=1;resultBit=1;
else
prevState=3;resultBit=1;
end
end
if(curr==2)
if(distance prev(1)+weight(2) <= distance prev(3)+weight(6))
prevState=1;resultBit=-1;
else
prevState=3;resultBit=-1;
end
end
if(curr==3)
if(distance prev(2)+weight(3) <= distance prev(4)+weight(7))
prevState=2;resultBit=1;
else
prevState=4;resultBit=1;
end
end
if(curr==4)
if(distance prev(2)+weight(4) <= distance prev(4)+weight(8))
prevState=2;resultBit=-1;
else
prevState=4;resultBit=-1;
end
end
end
getSigma.m
function [ outputS ] = getSigma( SNR , fbit )
% SNR in dB
% fbit for BPSK (=1) or QPSK (=2)
outputS = 1 ./ sqrt(power(10, SNR./10) * 2 * fbit);
end
18