Analisis Unjuk Kerja Ekualizer Pada Sistem Komunikasi Dengan Algoritma Godard

LAMPIRAN
1.

Program untuk MMSE

T=4000;
M=2500;
dB=27;

% total number of data
% total number of training symbols
% SNR in dB value

%%%%%%%%% Simulate the Received noisy Signal
N=20; % smoothing length N+1 panjang filter
Lh=5; % channel length = Lh+1
P=round((N+Lh)/2); % equalization delay

%%%%%%%%%%%

h=randn(1,Lh+1)+sqrt(-1)*randn(1,Lh+1);

% channel (complex)
% normalize
h=h/norm(h);
s=round(rand(1,T))*2-1; % QPSK or 4 QAM symbol sequence
s=s+sqrt(-1)*(round(rand(1,T))*2-1);
% generate received noisy signal
x=filter(h,1,s);
% AWGN noise (complex)
vn=randn(1,T)+sqrt(-1)*randn(1,T);
vn=vn/norm(vn)*10^(-dB/20)*norm(x); % adjust noise power with SNR
dB value
% Check SNR of the received
SNR=20*log10(norm(x)/norm(vn))
samples
x=x+vn;
% received signal
%%%%%%%%%%%%% adaptive MMSE equalizer estimation
Lp=T-N;
%% remove several first samples to avoid 0 or negative
subscript

X=zeros(N+1,Lp);
% sample vectors (each column is a sample
vector)
for i=1:Lp
X(:,i)=x(i+N:-1:i).';
end
e=zeros(1,M-10); % used to save instant error
f=zeros(N+1,1);
% initial condition
mu=0.001;
% parameter to adjust convergence and steady
error
for i=1:M-10
e(i)=s(i+10+N-P)-f'*X(:,i+10);
% instant error
% update equalizer
f=f+mu*conj(e(i))*X(:,i+10);
estimation
% output information
i_e=[i/10000 abs(e(i))];

end
sb=f'*X;

% estimate symbols (perform equalization)

% calculate SER
sb1=sb/norm(f); % scale the output
sb1=sign(real(sb1))+sqrt(-1)*sign(imag(sb1));
% perform symbol
detection
start=7; % carefully find the corresponding begining point
sb2=sb1-s(start+1:start+length(sb1)); % find error symbols
SER=length(find(sb2~=0))/length(sb2)
% calculate SER

47
Universitas Sumatera Utara

if 1
subplot(221),

% show the pattern of transmitted symbols
plot(s,'o');
grid,title('simbol
yang
ditransmisikan');
xlabel('Real'),ylabel('Image')
axis([-2 2 -2 2])
subplot(222),
plot(x,'o'); % show the pattern of received samples
grid,
title('Sampel
yang
diterima');
xlabel('Real'),
ylabel('Image')
subplot(223),
% show the pattern of the equalized symbols
plot(sb,'o');
grid,
title('dengan

ekualizer'),
xlabel('Real'),
ylabel('Image')
%subplot(224),
%plot(abs(e));
% show the convergence
%grid, title('Convergence'), xlabel('n'), ylabel('Error e(n)')
end

2.

Program Ekualizer Godard

T=4000;
M=2500;
dB=41;

% total number of data
% total number of training symbols
% SNR in dB value


%%%%%%%%% Simulate the Received noisy Signal
N=20; % smoothing length N+1
Lh=5; % channel length = Lh+1
P=round((N+Lh)/2); % equalization delay

%%%%%%%%%%%

% channel (complex)
h=randn(1,Lh+1)+sqrt(-1)*randn(1,Lh+1);
% normalize
h=h/norm(h);
s=round(rand(1,T))*2-1; % QPSK or 4 QAM symbol sequence
s=s+sqrt(-1)*(round(rand(1,T))*2-1);
% generate received noisy signal
x=filter(h,1,s);
% AWGN noise (complex)
vn=randn(1,T)+sqrt(-1)*randn(1,T);
vn=vn/norm(vn)*10^(-dB/20)*norm(x); % adjust noise power with SNR
dB value

% Check SNR of the received
SNR=20*log10(norm(x)/norm(vn))
samples
x=x+vn;
% received signal
%%%%%%%%%%%%% adaptive MMSE equalizer estimation

48
Universitas Sumatera Utara

%% remove several first samples to avoid 0 or negative
Lp=T-N;
subscript
X=zeros(N+1,Lp);
% sample vectors (each column is a sample
vector)
for i=1:Lp
X(:,i)=x(i+N:-1:i).';
end
e=zeros(1,M-10);

w=zeros(N+1,1);
p=2;
%w(1)=x(1);

% used to save instant error

mutlak=abs(s).^(2*p);
mutlak2=abs(s).^p;
jlh = sum(mutlak);
jlh2 = sum(mutlak2);
Rp = round(jlh/jlh2);
u1=transpose(s);
mu=0.015;
%for i=1:M-10
%
e(i)=s(i+10+N-P)-f'*X(:,i+10);
% instant error
%
f=f+mu*conj(e(i))*X(:,i+10);
% update equalizer

estimation
% i_e=[i/10000 abs(e(i))]
% output information
%end
for i=1:M-10
s(i) = s(i+10+N-P);
u1(i)=transpose(s(i));
y(i)=u1(i)-(w(i));
e(i)=y(i).*(abs(y(i)).*exp(p-2)).*(Rp-(abs(y(i)).*exp(p)));
%e(i)=y(i).*(abs(y(i)).^(p-2)).*(Rp-(abs(y(i)).^(p)));
w(i+1) = w(i)+(mu.*(e(i)).*u1(i));
w2=randsrc(21,1);
end
sb =w2'*X;

% estimate symbols (perform equalization)

% calculate SER
sb1=sb/norm(w2); % scale the output
sb1=sign(real(sb1))+sqrt(-1)*sign(imag(sb1));

% perform symbol
detection
start=7; % carefully find the corresponding begining point
sb2=sb1-s(start+1:start+length(sb1)); % find error symbols
% calculate SER
SER=length(find(sb2~=0))/length(sb2)
if 1
subplot(221),
% show the pattern of transmitted symbols
plot(s,'o');
grid,title('simbol
yang
ditransmisikan');
xlabel('Real'),ylabel('Image')
axis([-2 2 -2 2])
subplot(222),
plot(x,'o'); % show the pattern of received samples

49
Universitas Sumatera Utara


grid,
title('Sampel
ylabel('Image')

yang

diterima');

xlabel('Real'),

subplot(223),
% show the pattern of the equalized symbols
plot(sb,'o');
grid,
title('dengan
ekualizer'),
xlabel('Real'),
ylabel('Image')

end

50
Universitas Sumatera Utara