Design of Adaptive Equalizer: Using LMS Algorithm

You might also like

You are on page 1of 8

Design of adaptive equalizer

Using LMS Algorithm Project Report

Under the guidance of


Prof S Meher Dept of Electronics and Communication Engineering National Institute of Technology, Rourkela

4/20/2010 DSP LAB ABHIJEET SAHU : 107EC019

SOUMYAJYOTI BEHERA : 107EC032

Aim of the project: Design of an adaptive equalizer using LMS(least mean square) algorithm.
INTRODUCTION:

One of the most important advantages of the digital transmission systems for voice, data and video communications is their higher reliability in noise environment in comparison with that of their analog counterparts. Unfortunately most often the digital transmission of information is accompanied with a phenomenon known as inter symbol interference (ISI). Briefly this means that the transmitted pulses are smeared out so that pulses that correspond to different symbols are not separable. Obviously for a reliable digital transmission system it is crucial to reduce the effects of ISI. And one of the possible solutions is the implementation of equalizer based on filter with finite impulse response (FIR) employing the least mean square (LMS) algorithm for adjusting its coefficients. ISI problem is resolved by channel equalization in which the aim is to construct an equalizer such that the impulse response of the channel/equalizer combination is as close to z-d as possible, where d is a delay. Frequently the channel parameters are not known in advance and moreover they may vary with time, in some applications significantly. Hence, it is necessary to use the adaptive equalizers, which provide the means of tracking the channel characteristics.
BLOCK DIAGRAM OF DIGITAL TRANSMISION SYSTEM USING CHANNEL EQUALIZATION

The source block transmits Binary Phase Shift Keying (BPSK) symbols u[n] with equal probability. The channel block introduces inter symbol interference (ISI) using a finite impulse response (FIR) type of channel model. The transfer function of channel CK is Ck = C0+C1Z-1+C2 Z-2+.+CL-1ZL-1 L = no of channel filter coefficients

At the output of the channel, a noise sequence v[n] is added. This noise is assumed to be additive white Gaussian noise (AWGN) with variance . The sum of the channel output and the noise sequence forms the received signal x[n] , which is fed into the equalizer block. The equalizer block performs the equalization of the channel, which is a transversal filter as shown in fig 2.

LMS ALGORITHM: As in this project work we have designed an adaptive equalizer using the mean square error (MSE) criterion. The minimization of the cost function can be performed adaptively by applying the stochastic gradient (SG) or the least mean square (LMS) algorithm. The LMS (least mean square) algorithm is an approximation of the steepest descent algorithm which uses an instantaneous estimate of the gradient vector of a cost function. The estimate of the gradient is based on sample values of the tap-input vector and an error signal. The algorithm iterates over each coefficient in the filter, moving it in the direction of the approximated gradient. For the LMS algorithm it is necessary to have a reference signal d[n] representing the desired filter output. The difference between the reference signal and the actual output of the transversal filter is the error signal: e[n] = u[n-d] y[n]*wk[n] The task of the LMS algorithm is to find a set of filter coefficients c that minimize the expected value of the quadratic error signal, i.e., to achieve the least mean squared error (thus the name). The squared error and its expected value are: (e[n])2 = {u[n-d] wkT[n]y[n]}2 E(e2) = E(u2) - E(2uwTy) + E(wTyyTw) = E(u2) 2wTE(uy) + wTE(yyT)w the squared error e2 is a quadratic function of the coefficient vector c, and thus has only one (global) minimum (and no other (local) minima), that theoretically could

be found if the correct expected values in the above equation are known. In the LMS algorithm, however, a very short-term estimate is used by only taking into account the current samples: E(ux) ~ dx, and E(yyT) ~ yyT, leading to an update equation for the filter coefficients: wk[n+1] = wk[n] + y[n]e[n]T where is the step size parameter. The dependence of the stability bound on the signal power is exploited in the normalized LMS algorithm by normalizing the step-size according to the signal power: wk[n+1] = wk[n] + y[n]e[n]T / + |y[n]|2 : small positive constant The mean square error (MSE) for the filter in the kth time instant is defined as : MSEk = E(ek2) In simulations the expectation is evaluated through averaging over T independent runs, in order to be able to view the convergence of the equalizer as a function of the time. After the convergence of the adaptive equalizer, we can compute the final MSE by time averaging if the process is ergodic . However, it is important that the initial transient of the equalizer is discarded. Otherwise, we will end up with a too large value of the MSE. MATLAB PROGRAM AND SIMULATION :
clc clear all close all N = 1000; M = 5; T = 50; cir = zeros(1,2*M-1); MSE_vec = zeros(T,N-3); MSE_f=zeros(1,N-3); o_p=zeros(1,N); for j = 1 : T u = sign(randn(1,N)); c = randn(M,1); c = c / norm(c); z = filter(c,1,u); SNR = 30; var_v = var(z) * 10^(-SNR/10); v = var_v^0.5 * randn(1,N); %input signal %channel to be equalized %simulation length %channel length %number of independent trials %cascade impulse response %Mean Square Error vector %final MSE vector %output from the equalizer in Tth trial

%channel output %Signal to Noise Ratio %additive noise to the channel output

y = z + v;

%input to the equalizer

%-----------------------------LMS channel equalization-----------------------% w = zeros(M,1); y_regressor = zeros(1,M); step =.12; epsilon = 10^(-6); MSE=0; for k = 4 : N y_regressor = [y(k) y_regressor(1:M-1)]; e = u(k-3) - y_regressor * w; w = w + step * y_regressor' * e / (y_regressor * y_regressor' + epsilon); if j==T o_p(1,k)=y_regressor * w; end MSE=MSE+(abs(e).^2); MSE_avg=MSE/(k-3); MSE_vec(j,:)=[MSE_avg MSE_vec(j,1:N-4)]; end MSE_vec(j,:)=fliplr(MSE_vec(j,:)); q=[4:1:N]; figure(1); plot(q,MSE_vec(j,:));title('mean square error for different trial');xlabel('time at any instant ');ylabel('MSE'); hold on; cir = cir + conv(w,c)'; end hold off figure(2); subplot(2,2,1); plot(q,MSE_vec(j,:)); title('MSE in final trial'); xlabel('Time in samples');ylabel('MSE'); hold on; o_p_b=sign(o_p); n=[1:N]; plot(n,v); hold off; %converting to binary(+1/-1) %noise in the final trial

temp=ones(T,1); for j=1:N-3 MSE_f(1,j)=MSE_f(1,j)+((MSE_vec(:,j)'*temp)/T); end subplot(2,2,2); plot(q,MSE_f); title('MSE in final trial'); xlabel('time at any instant');ylabel('MSE');

%-----------------------FOR SIGNALS IN FINAL TRIAL-------------------------% figure(3); subplot(2,2,1); stem(c);title('channel impulse response');xlabel('time');ylabel('magnitude'); subplot(2,2,2); stem(w);title('equalizer impulse response');xlabel('time');ylabel('magnitude'); subplot(2,2,3); stem(cir/T); title('cascade channel-equalizer impulse response');ylabel('magnitude');xlabel('taps'); figure(4); subplot(2,2,1); n_i=n(4:N); stem(n_i,u(1:N-3));xlabel('time');title('input signal');ylabel('magnitude'); subplot(2,2,2); stem(n,z);xlabel('time');title('output after passing through channel');ylabel('magnitude'); subplot(2,2,3); n_o=n(1:N-3); stem(n_o,o_p(1:N-3));xlabel('time');title('Final output');ylabel('magnitude'); subplot(2,2,4); stem(n_o,o_p_b(1:N-3));xlabel('time');title('Binary final output');ylabel('magnitude');

CODE DESCRIPTION : In the following MATLAB code, we took a random digital signal and passd through a channel of length M=5. The output from the channel was passed through a noise signal, which corrupts the original signal. To retrieve the original signal we used the LMS algorithm to design the adaptive equalizer whose coefficients were dependant on the difference of the delayed original signal and the output from the equalizer i.e. the error signal. Until and unless the error function gets almost reduced to zero the output signal cant be equal to the input signal. The efficiency of this algorithm is judged by the degree of convergence i.e. the decrease of error function with the succeeding iterations. The mean square error found from the very last iteration gives the best result compared to its predecessor. So we checked the various MSE values for different iterations and checked the convergence. Finally we convolved the channel with the equalizer to get the cascade impulse response. Shown below are the following plots made out from the above code, to verify the way the adaptive equalizer helped us to retrieve the corrupt data. Parameters used: Parameter No of independent trials T No of transmitted symbols N No of filter coefficients M SNR Step size Channel coefficients Value 50 1000 5 30 .12 random

Figure 1: Impulse responses

Figure 2: Mean Square Error

Figure 3: Discrete Data output

CONCLUSION: The basic goal of this project was to design an adaptive equalizer using an algorithm which provides us a high convergence rate in order to meet the requirements for short training time and good tracking properties. So we used the LMS algorithm to design it and analyzed the mean square error which reduced finally to provide us the intended output with a certain delay. The channel and the noise signals were taken randomly to realize the real time environment and were equalized properly as the corrupted signals were recovered. LMS algorithm is largely used due to its unique properties: 1. Simplicity of implementation 2. Model independent 3. Higher degree of convergence of the error function One of the many applications of LMS is acoustic echo cancellation.

You might also like