필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
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

채택된 답변

Dimitris Kalogiros
Dimitris Kalogiros 2018년 8월 27일
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:
  댓글 수: 2
Eloy Pena Asensio
Eloy Pena Asensio 2018년 8월 27일
편집: Eloy Pena Asensio 2018년 8월 27일
Thank you very much! What about my second question?
Is there any way to transform transfer function into a filter?
Dimitris Kalogiros
Dimitris Kalogiros 2018년 8월 27일
Mapping transfer function to filter coefficients is not an easy task, but it is feasible. If I find some time , later on night I will give you an example

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Dimitris Kalogiros
Dimitris Kalogiros 2018년 8월 27일
Here you are a more complete script:
clear; clc; close all;
%%problem definition
% 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 out system;
Ts=1;
%%analyse LMS taps
% magnitude and phase of taps
tap.magn=abs(w);
tap.phase=atan2(imag(w),real(w));
figure;
subplot(2,2,1); stem(tap.magn, '-b*'); title('magnitude of taps');
ylabel('magnitude'); xlabel('tap number'); zoom on; grid on;
subplot(2,2,2); plot(log10(tap.magn), '-b.'); title('magnitude of taps expressed at dB');
ylabel('dB'); xlabel('tap number'); zoom on; grid on;
subplot(2,1,2); plot(tap.phase, '-ro'); title('phase of taps');
xlabel('rand'); ylabel('tap number'); zoom on; grid on;
% LMS feedforward is a filter. Find its frequency response
sys=tf(w, 1, Ts, 'variable','z^-1');
% plot bode diagram
figure;
bode(sys);
grid on; zoom on;
Keep in mind that your LMS coefficients are real numbers, so seeking "magnitude" and "phase" of these values is something with low importance

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by