% % Written by: % -- % John L. Weatherwax 2009-04-21 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- kRange = 0:10; r_k = ( (0.9).^(abs(kRange)) ) .* cos( pi * kRange / 4 ); % everything but the k=0 delta component r_k(1) = r_k(1) + 1.0 % add back in the delta R_x = [ r_k(1), r_k(2) ; r_k(2), r_k(1) ]; % for various lookaheads c compute the first-order FIR Wiener predictor all_errors = []; for c = 1:6 fprintf('c= %d\n', c); right_hand_side = [ r_k(c+1); r_k(c+2) ] w = R_x \ right_hand_side xhi = r_k(1) - right_hand_side' * w; fprintf('chi= %10.6f\n',xhi); all_errors = [ all_errors, xhi ]; end plot( all_errors, '-o' );