MATLAB: Weights of LMS adaptives filter: bode commant, plot magnitude and phase

lms adaptive filter transfer function weights magnitude phase

Hello, I would like to know if there is a way to plot the magnitude and the phase of the values of the weights returned by LMS adapative filter.
By the way: is there any way to convert this filter to transfer function?
w =
-0.1229
-0.0786
-0.0391
-0.0043
0.0284
0.0594
0.0913
0.1247
0.1620
0.2035
0.2515

Best Answer

A very useful script for your case:
clear; clc; close all;
% LMS weights
w=[ -0.1229 -0.0786 -0.0391 -0.0043 0.0284 0.0594...
0.0913 0.1247 0.1620 0.2035 0.2515 ];
%sampling period of our system;
Ts=1;
% LMS feedforward is a filter
sys=tf(w, 1, Ts, 'variable','z^-1');
% plot bode diagram
figure;
bode(sys);
grid on; zoom on;
If you run the script, you will receive bode diagram:
Related Question