Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with code for implementing MMSE equalizers in Matlab

Status
Not open for further replies.

leony

Member level 1
Joined
Feb 28, 2005
Messages
41
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,615
I was trying to implement a MMSE equalizer in Matlab, and come across the following code on the web. The problem is, whenever I searched, I found out that they use tap size the same as the size of discrete channel model. But I have, lets say a channel of
Code:
h=[1 0 0 0 0 ........  0,5   ....0 0 0 0.......0]  (the size is 1x100)

But again I want to use a 5 tap equalizer and my unequalized signal before the equalizer has a size of 8000. In the following code is says for X (unequalized signal)
has a size of 4N+1 X 2N+1 (means 9 x 5 when the tap is 5)
Code:
% z=xc; z=equalized output; c=tap coeff of filter; x=4N+1 X 2N+1 array;
I hope it is not confusing.
Thank you.

This code can be found at
**broken link removed**

Code:
function [c,z_equalized]=mmse(M,p2,p3,p4)
% function [filter coeff, equalized output]=min_mean_square_error(# of puls
%es total, perc in decimal ISI nearest pulses,
% perc in decimal ISI second nearest puls
%es, perc in decimal ISI third nearest pulses)
% Consider: y -> channel ISI -> x -> equalizer -> z
% z=xc; z=equalized output; c=tap coeff of filter; x=4N+1 X 2N+1 array;
%example3_6 = 1; %Set to 1 for results in example 3.6 in Sklar; set to 0 for
%general results;
if(example3_6==1)
M=7; %number of taps
h=[0.0110 0.0227 -0.1749 1.0 0.1617 -0.0558 0.0108]; 
%example3.6 results in Sklar; {x[k]} is backward in example;
figure; stem(h);
title('Plot of Channel ISI Impulse Response');
xlabel('Samples n');
ylabel('Amplitude');
else
h=[p4 p3 p2 1.0 p2 p3 p4]; % Channel ISI impulse response;
% If eye diagram is not open
% before equalization, then zero-forcing
% equalizer does not work well.
figure; stem(h);
title('Plot of Channel ISI Impulse Response');
xlabel('Samples n');
ylabel('Amplitude');
end
if(mod(M,2)==0) %if M is even, make it odd;
M=M+1;
end
N=(M-1)/2; %2N+1=M;
if(M<7) %length(h) = 7;
h=h(4-N:4+N); %h(4) is center tap;
elseif(M>7)
h=[zeros(1,(M-7)/2) h zeros(1,(M-7)/2)];
end
%Solve for c=filter weights or coeff. using equation c=(Rxx^-1)(Rxz);
%Tap weights or filter coeff are to be determined by transmitting a single
impulse as a training signal.
%So single impulse (delta function) convolves with channel ISI response 
{h[n]} equals {x[n]} = {h[n]}.
%The for loops form the x array = 4N+1X2N+1;
for k1=1:4*N+1
for k2=1:2*N+1
index=k1-k2+1;
if (index<=length(h))&(index>0)
x_arr(k1,k2)=h(index);
else
x_arr(k1,k2)=0;
end
end
end
z=[zeros(2*N,1);1;zeros(2*N,1)]; % z = 4N+1X1 matrix;
x_tranpose=transpose(x_arr);
Rxx=x_tranpose*x_arr; %auto-correlation vector;
Rxz=x_tranpose*z; %cross-correlation vector;
c=inv(Rxx)*Rxz; %filter coeff;
z_equalized=x_arr*c; %equalized output;
 

Re: MMSE Equalizers Help

Hi leony,

Do you mean to say that you want to use a equalizer with N taps while the channel is M taps?
N > M == This is the Ideal case. You have more taps than channel.
N < M == This happens practically. If the main tap happens to be about of this range then you have a problem.

I hope this helps. I could not clearly get your problem.

BR
M
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top