clc;
clear;
close all;
warning off;
addpath(genpath(pwd));
load Sources.mat
h = randn(5,1);
fnoise = 100*conv(noise,h);
primary = primary + fnoise(1:size(primary));
err1 = LMSFilter(primary, 100*noise, 0.000005, 5);
figure;
plot(err1,'r');
hold on
err2 = RLSFilter(primary, 100*noise, 5, 15);
plot(err2,'b');
legend('LMS自适应滤波误差','RLS自适应滤波误差');
ylim([-10,10]);