clear all
clc
nBits = 3000; %Number of Bits
chan = [.3 .9 .3]; %Channel
L = 3; %Filter Length
plotcol = ['r' ; 'g' ; 'b'];
%number of iterations
nIters = 125;
%step sizes
mu_lms = 0.003; %LMS
mu_lmf = 0.3; %LMF
mu_nlms = 0.03; %NLMS
%EbNo
LogEbNo = 20;
%MSE
MSE=zeros(nIters, nBits); % prepare to accumulate MSE*I
w0 = zeros(L,1); %initialise with zeros
N = L-1;
% --- Simulation Loops --- %
% --- The Channel --- %
EbNo = 10^(LogEbNo/10);
Eb = 1;
No = Eb/EbNo;
for eqtype = 1:3
for iter = 1:nIters
iter
% --- Transmitter --- %
TxSymbols = randsrc(nBits,1);
x = TxSymbols;
ChanReg = zeros(1, L);
X = zeros(1, L); % equalizer register
w = w0;
for k = 1:nBits
ChanReg = [x(k) ChanReg(1:(end-1))];
评论0