Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Ads

Discussion Groups

Discussion Groups | Matlab DSP | LMS Equalization

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

LMS Equalization - Helmi Kurniawan - Feb 26 12:53:00 2003



Hi all,

Anybody of you know how to use the matlab script provided in the book
DSP using matlab. The script is about LMS equalizer algorithm and as
follows:

function [h,y] = lms(x,d,delta,N)
% LMS Algorithm for Coefficient Adjustment
% ----------------------------------------
% [h,y] = lms(x,d,delta,N)
% h = estimated FIR filter
% y = output array y(n)
% x = input array x(n)
% d = desired array d(n), length must be same as x
% delta = step size
% N = length of the FIR filter
%
M = length(x); y = zeros(1,M);
h = zeros(1,N);
for n = N:M
x1= x(n:-1:n-N+1);
y = h * x1.';
error = d(n) - y(n);
h = h + delta*(error)*x1;
end

If i send the input array x =[1.03+1.002i 2.03+3i 2.06+3.32i
2.008+2.98i]

and let say the desired array is [1+i 2+3i 2+3i 3+3i]

and i used delta = 0.02 and N=4 how come the output only one and it
seems the error become larger, and hence it does not reduce the error.

Please explain about this and preferably with the example.

Thanks

Best regards,
Kurniawan





(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: LMS Equalization - navaneetha krishnan - Feb 27 5:07:00 2003

Here is an example,

x=randn(1,100);
y=filter([1 2 3 4],1,x);
[h,o]=lms(x,y,0.1,4);

I got h = [1.0004 1.9998 2.9996 3.9996]

I didnt try complex values.
In your code replace line y = h * x1.';
with y(n) = h * x1.';

Navan --- "Helmi Kurniawan <>"
<> wrote:
> Hi all,
>
> Anybody of you know how to use the matlab script
> provided in the book
> DSP using matlab. The script is about LMS equalizer
> algorithm and as
> follows:
>
> function [h,y] = lms(x,d,delta,N)
> % LMS Algorithm for Coefficient Adjustment
> % ----------------------------------------
> % [h,y] = lms(x,d,delta,N)
> % h = estimated FIR filter
> % y = output array y(n)
> % x = input array x(n)
> % d = desired array d(n), length must be same as
> x
> % delta = step size
> % N = length of the FIR filter
> %
> M = length(x); y = zeros(1,M);
> h = zeros(1,N);
> for n = N:M
> x1= x(n:-1:n-N+1);
> y = h * x1.';
> error = d(n) - y(n);
> h = h + delta*(error)*x1;
> end
>
> If i send the input array x =[1.03+1.002i 2.03+3i
> 2.06+3.32i
> 2.008+2.98i]
>
> and let say the desired array is [1+i 2+3i 2+3i
> 3+3i]
>
> and i used delta = 0.02 and N=4 how come the output
> only one and it
> seems the error become larger, and hence it does not
> reduce the error.
>
> Please explain about this and preferably with the
> example.
>
> Thanks
>
> Best regards,
> Kurniawan __________________________________________________




(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )