% % Written by: % -- % John L. Weatherwax 2008-11-24 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- %addpath( '../../AdaptiveFilteringCode' ); M = 2; n = 0:(M-1); % the powers to put on 0.9 rd = 0.9.^n; % compute the autocorrelation matrix R: Rd = toeplitz( rd ); Rx = Rd + eye(M); % compute the crosscorrelation vector p: p = rd; p = p(:); % compute the optmial filter coefficients: w = Rx \ p(:); fprintf( 'optimal coefficients w = \n' ); disp( w ) % compute the expected error J_min: jmin = rd(1) - (p.') * w