You are on page 1of 1

Fs = 1; % sampling frequency (notional) nBits = 2048; % number of BPSK symbols per vector maxErrs = 50; % target number of errors

at each Eb/No maxBits = 1e8; % maximum number of symbols at each Eb/No M = 2; % order of modulation Rs = Fs; % symbol rate nSamp = Fs/Rs; % samples per symbol Rb = Rs * log2(M); % bit rate dataState = 999983; % initial state of data generator chnl = [0.227 0.460 0.688 0.460 0.227 ]'; % channel impulse response chnlLen = length(chnl); % channel length, in samples EbNo = 0:14; % in dB BER = zeros(size(EbNo)); % initialize values noiseState = 999917; % initial state of noise generator nWts = 31; % number of weights algType1 = 'rls'; % RLS algorithm for first data block at each Eb/No forgetFactor = 0.999999; % parameter of RLS algorithm algType2 = 'lms'; % LMS algorithm for remaining data blocks stepSize = 0.00001; % parameter of LMS algorithm chnlEst = chnl; % perfect estimation initially prefixLen = 2*chnlLen; % cyclic prefix length excessEst = 1; idealBER = berawgn(EbNo, 'psk', M, 'nondiff'); [hBER, hLegend, legendString, hLinSpec, hDfeSpec, hErrs, hText1, hText2,... hFit, hEstPlot, hFig, hLinFig, hDfeFig] = eqber_graphics('init', chnl, ... EbNo, idealBER, nBits); alg1 = eval([algType1 '(' num2str(forgetFactor) ')']); linEq1 = lineareq(nWts, alg1); alg2 = eval([algType2 '(' num2str(stepSize) ')']); linEq2 = lineareq(nWts, alg2); [linEq1.RefTap, linEq2.RefTap] = ... deal(round(nWts/2)); [linEq1.ResetBeforeFiltering, linEq2.ResetBeforeFiltering] = ... deal(0); firstRun = true; % flag to ensure known initial states for noise and data eqType = 'linear'; eqber_adaptive;

You might also like