how to use ha.coefficients for a filter?

I am using the code below which works but if I try to filter the input with the ha.coefficients I don't get the desired signal. How do I use the coefficients and the matlab filter command to filter the input stored in xx to get the desired output d?
mu=.008; ha = adaptfilt.lms(250,mu); [yy,e] = filter(ha,xx(1:250),d);
I tried to desired = filter(ha.coefficients,1,xx(1:250));

답변 (1개)

Honglei Chen
Honglei Chen 2015년 2월 10일

1 개 추천

It's an adaptive filter so the coefficients changes at every step. The Coefficients only contains the initial coefficients. In addition, the setup for adaptive filter is often in a vectorized form so filter is often carried out using matrix multiplication than the difference equation implemented in the filter command.

댓글 수: 2

dgmn
dgmn 2015년 2월 10일
편집: dgmn 2015년 2월 10일
I am trying to identify a unknown system/filter using LMS. I thought adaptfilt.lms would provide filter coefficents that I could use with the filter command. Is there a recommended way to do this?
Thanks
Honglei Chen
Honglei Chen 2015년 2월 11일
What version do you have? You can try the new dsp.LMSFilter which you can get the the coefficients by set WeightsOutputPort to true. But nevertheless, I don't think you want to use filter with those coefficients, you should just use in matrix multiplication.

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

카테고리

태그

질문:

2015년 2월 10일

댓글:

2015년 2월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by