필터 지우기
필터 지우기

error with using filter

조회 수: 1 (최근 30일)
pietro
pietro 2014년 9월 19일
편집: Gustavo Machado 2019년 6월 10일
Hi all,
I have to filter few signals and I wrote the following code:
Fpass = 40; % Passband Frequency
Fstop = 45; % Stopband Frequency
Apass = 1; % Passband Ripple (dB)
Astop = 80; % Stopband Attenuation (dB)
Fs = 100; % Sampling Frequency
h = fdesign.lowpass('Fp,Fst,Ap,Ast', Fpass, Fstop, Apass, Astop, Fs);
Hd = design(h, 'butter','MatchExactly', 'stopband','SystemObject', true);
a=rand(1000,1);
a=filter(Hd,a);
I get the following error:
Undefined function 'filter' for input arguments of type 'dsp.BiquadFilter'.
Why do I get that error?
Thanks
Regards
Pietro

채택된 답변

Honglei Chen
Honglei Chen 2014년 9월 19일
dsp.BiquadFilter is a System object, so its main method is step(). Try
a = step(Hd,a)
  댓글 수: 1
Gustavo Machado
Gustavo Machado 2019년 6월 10일
편집: Gustavo Machado 2019년 6월 10일
Honglei, I've encountered the same problem Pietro had and used step() to apply the filter, but the filter was inefficient, seems like it didn't filter the data.
I've posted a question regards my problem. I used the sosfilt(Hd.SOSMatrix) to filter my data but came across the problem described in this topic: https://www.mathworks.com/matlabcentral/answers/466353-difference-between-fvtool-filterobject-and-fvtool-filterobject-sosmatrix
I'd highly appreaciate if you could take a look at it.
Thanks in advance,
Gustavo

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by