Computational Intelligence, SS08
2 VO 442.070 + 1 RU 708.070 last updated:
Course Notes (Skriptum)
Online Tutorials
Practical Course Slides
Animated Algorithms
Interactive Tests
Key Definitions
Literature and Links

Homework 5: Adaptive Filters

[Points: 10; Issued: 2003/03/28; Deadline: 2003/04/11; Tutor: Gölles Markus; Infohour: 2003/04/02, 14:00-15:00, Seminarraum IGI; Einsichtnahme: 2003/05/14, 14:00-15:00, Seminarraum IGI; Download: pdf; ps.gz]

  • Write a MATLAB function [y,e,c]=lms2(x,d,N,mu) which implements an adaptive transversal filter using LMS (see Tutorial).
    function [ y, e, c] = lms2( x, d, N, mu)
    % [y, e, c] = lms2( x, d, N, mu)
    %   Adaptive transversal filter using LMS (for algorithm analysis)
    % INPUT
    %   x ... vector containing the samples of the input signal x[n]
    %         size(x) = [xlen,1] ... column vector
    %   d ... vector containing the samples of the desired output signal d[n]
    %         size(d) = [xlen,1] ... column vector
    %   N ... number of coefficients
    %   mu .. step-size parameter
    % OUTPUT
    %   y ... vector containing the samples of the output signal y[n]
    %         size(y) = [xlen,1] ... column vector
    %   e ... vector containing the samples of the error signal e[n]
    %         size(y) = [xlen,1] ... column vector
    %   c ... matrix containing the coefficient vectors c[n]
    %         size(c) = [N,xlen+1]
  • For a system identification application, write a MATLAB script to visualize the adaptation process in the time domain. Take the function lms2() and let $ x[n]$ be normally distributed random numbers with mean zero and variance one (use the MATLAB function randn()). Choose a proper value for the step-size parameter $ \mu$.

    Additionally, use the function rls1() (This function is provided.) instead of lms2() and compare these algorithms concerning the time until the coefficients converge.

    For the unknown FIR system, you can take any $ \mathbf{h}$ and $ M$ you may wish. To calculate $ d[n]$, use the MATLAB function filter().

    Additionally, modify your script and examine the cases $ N>M$ and $ N<M$.
  • For the two-dimensional case ($ N=M=2$), visualize the adaptation path in the $ \mathbf{c}$-plane ( $ \mathbf{c}[n] = \left[ c_0[n], c_1[n] \right]^{\mbox{T}}$). Use both algorithms (lms2() and rls1()) and different input signals:
    1. $ x[n] = \mathrm{sign}\left(\mathrm{rand}[n]-0.5\right)$   and$ \quad \mu=0.5, \rho=0.95$
    2. $ x[n] = \mathrm{randn}[n]$   and$ \quad \mu=0.5, \rho=0.95$
    3. $ x[n] = \cos[ \pi n ]$   and$ \quad \mu=0.5, \rho=0.95$
    4. $ x[n] = \cos[ \pi n ] + 2$   and$ \quad \mu=0.1, \rho=0.95$
    Compare the results of this four input signals. Describe your observations.