⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aftdemo.m

📁 It is a GUI designed for the learning of Adaptive Filters
💻 M
📖 第 1 页 / 共 2 页
字号:

Jm=jmat(w1,w2,R,p,Jmin);
[J,w]=sd(mu,winit,N,R,p,Jmin);


axes(handles.axes2);
contour(w1,w2,Jm,50);xlabel('w1');ylabel('w2');
hold on
plot(w(1,:),w(2,:),'-O');
hold off
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
R = eval(get(handles.edit1,'String'));
p = eval(get(handles.edit4,'String'));
mu = str2double(get(handles.edit7,'String'));
winit = eval(get(handles.edit5,'String'));
Jmin = str2double(get(handles.edit6,'String'));
N = str2double(get(handles.edit8,'String'));

wo=R\p;
u=randn(1000,1);
d=filter(wo,1,u);
M=2;
w1=[(wo(1)-5):0.1:(wo(1)+5)];
w2=[(wo(2)-5):0.1:(wo(2)+5)];


Jm=jmat(w1,w2,R,p,Jmin);
[e,W]=lms(mu,M,u,d);

axes(handles.axes2);
contour(w1,w2,Jm,50);xlabel('w1');ylabel('w2');
hold on
plot(W(1,:),W(2,:),'-O');
hold off
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
R = eval(get(handles.edit1,'String'));
p = eval(get(handles.edit4,'String'));
mu = str2double(get(handles.edit7,'String'));
winit = eval(get(handles.edit5,'String'));
Jmin = str2double(get(handles.edit6,'String'));
N = str2double(get(handles.edit8,'String'));


wo=R\p;
u=randn(1000,1);
d=filter(wo,1,u);
M=2;
w1=[(wo(1)-5):0.1:(wo(1)+5)];
w2=[(wo(2)-5):0.1:(wo(2)+5)];


Jm=jmat(w1,w2,R,p,Jmin);
[E,NW]=nlms(mu,M,u,d,1);

axes(handles.axes2);
contour(w1,w2,Jm,50);xlabel('w1');ylabel('w2');
hold on
plot(NW(1,:),NW(2,:),'-O');
hold off
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton5 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
R = eval(get(handles.edit1,'String'));
p = eval(get(handles.edit4,'String'));
mu = str2double(get(handles.edit7,'String'));
winit = eval(get(handles.edit5,'String'));
Jmin = str2double(get(handles.edit6,'String'));
N = str2double(get(handles.edit8,'String'));


wo=R\p;
u=randn(1000,1);
d=filter(wo,1,u);
M=2;
w1=[(wo(1)-5):0.1:(wo(1)+5)];
w2=[(wo(2)-5):0.1:(wo(2)+5)];

M=2;
lambda=1;
delta=0.1;

[xi,RW]=rls(lambda,M,u,d,delta);
Jm=jmat(w1,w2,R,p,Jmin);
[w,J]=sd(mu,winit,N,R,p,Jmin);
[e,W]=lms(mu,M,u,d);
[E,NW]=nlms(mu,M,u,d,1);

figure;contour(w1,w2,Jm,50);xlabel('w1');ylabel('w2');
hold on

plot(w(1,:),w(2,:),'b-O');
plot(W(1,:),W(2,:),'r-*');
plot(NW(1,:),NW(2,:),'g-o');
plot(RW(1,:),RW(2,:),'k-x')

hold off



% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton7 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
R = eval(get(handles.edit1,'String'));
p = eval(get(handles.edit4,'String'));
mu = str2double(get(handles.edit7,'String'));
winit = eval(get(handles.edit5,'String'));
Jmin = str2double(get(handles.edit6,'String'));
N = str2double(get(handles.edit8,'String'));

[w,J]=sd(mu,winit,N,R,p,Jmin);
axes(handles.axes2);
plot(J);xlabel('No. of Itterations');ylabel('MSE');

% --- Executes on button press in pushbutton8.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton8 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
R = eval(get(handles.edit1,'String'));
p = eval(get(handles.edit4,'String'));
mu = str2double(get(handles.edit7,'String'));
winit = eval(get(handles.edit5,'String'));
Jmin = str2double(get(handles.edit6,'String'));
N = str2double(get(handles.edit8,'String'));


wo=R\p;
u=randn(1000,1);
d=filter(wo,1,u);
M=2;
[e,W]=lms(mu,M,u,d);
axes(handles.axes2);
plot(e(1:N));xlabel('No. of Itterations');ylabel('MSE');

% --- Executes on button press in pushbutton9.
function pushbutton9_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton9 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

R = eval(get(handles.edit1,'String'));
p = eval(get(handles.edit4,'String'));
mu = str2double(get(handles.edit7,'String'));
winit = eval(get(handles.edit5,'String'));
Jmin = str2double(get(handles.edit6,'String'));
N = str2double(get(handles.edit8,'String'));


wo=R\p;
u=randn(1000,1);
d=filter(wo,1,u);
M=2;
[E,NW]=nlms(mu,M,u,d,1);
axes(handles.axes2);
plot(E(1:N));xlabel('No. of Itterations');ylabel('MSE');

% --- Executes on button press in pushbutton10.
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton10 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

R = eval(get(handles.edit1,'String'));
p = eval(get(handles.edit4,'String'));
mu = str2double(get(handles.edit7,'String'));
winit = eval(get(handles.edit5,'String'));
Jmin = str2double(get(handles.edit6,'String'));
N = str2double(get(handles.edit8,'String'));


wo=R\p;
u=randn(1000,1);
d=filter(wo,1,u);
M=2;
w1=[(wo(1)-5):0.1:(wo(1)+5)];
w2=[(wo(2)-5):0.1:(wo(2)+5)];
lambda=1;
delta=0.1;

[xi,RW]=rls(lambda,M,u,d,delta);

axes(handles.axes2);
plot(xi(1:N));xlabel('No. of Itterations');ylabel('MSE');

% --- Executes on button press in pushbutton11.
function pushbutton11_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton11 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
R = eval(get(handles.edit1,'String'));
p = eval(get(handles.edit4,'String'));
mu = str2double(get(handles.edit7,'String'));
winit = eval(get(handles.edit5,'String'));
Jmin = str2double(get(handles.edit6,'String'));
N = str2double(get(handles.edit8,'String'));


wo=R\p;
u=randn(1000,1);
d=filter(wo,1,u);
M=2;
w1=[(wo(1)-5):0.1:(wo(1)+5)];
w2=[(wo(2)-5):0.1:(wo(2)+5)];
lambda=1;
delta=0.1;

Jm=jmat(w1,w2,R,p,Jmin);
[xi,RW]=rls(lambda,M,u,d,delta);

axes(handles.axes2);
contour(w1,w2,Jm,50);xlabel('w1');ylabel('w2');
hold on
plot(RW(1,:),RW(2,:),'-O');
hold off


% --- Executes on button press in pushbutton12.
function pushbutton12_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton12 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

R = eval(get(handles.edit1,'String'));
p = eval(get(handles.edit4,'String'));
mu = str2double(get(handles.edit7,'String'));
winit = eval(get(handles.edit5,'String'));
Jmin = str2double(get(handles.edit6,'String'));
N = str2double(get(handles.edit8,'String'));


wo=R\p;
u=randn(1000,1);
d=filter(wo,1,u);
M=2;
w1=[(wo(1)-5):0.1:(wo(1)+5)];
w2=[(wo(2)-5):0.1:(wo(2)+5)];
lambda=1;
delta=0.005;



Jm=jmat(w1,w2,R,p,Jmin);
[J,w]=sd(mu,winit,N,R,p,Jmin);
[e,W]=lms(mu,M,u,d);
[E,NW]=nlms(mu,M,u,d,1);
[xi,RW]=rls(lambda,M,u,d,delta);
plot(e(1:N),'r');xlabel('No. of Itterations');ylabel('MSE');

hold on
% plot(J(30:N));xlabel('No. of Itterations');ylabel('MSE');
plot(E(1:N),'g');xlabel('No. of Itterations');ylabel('MSE');
plot(xi(1:N),'b');xlabel('No. of Itterations');ylabel('MSE');
hold off

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -