Why do I get different frequency response using state-space representation and transfer function
조회 수: 1 (최근 30일)
이전 댓글 표시
After using butter function to design a filter (as follow), I wanted to check the frequency response. However I suddenly find that the frequency response seems to be different using different representation. That doesn't make sense to me. Thanks a lot for answering me.

[Input, Fs]=audioread('input.wav');
Ws=[10 3800]/(Fs/2);
Wp=[30 3500]/(Fs/2);
[N, Wn]=buttord(Wp,Ws,0.1,30); %Design band pass filter.
[A,B,C,D]=butter(N,Wn);
sos=ss2sos(A,B,C,D);
fvtool(sos,'Fs',Fs); % Plot Freq Response using state space representation.
[b,a]=ss2tf(A,B,C,D);
fvt=fvtool(b,a,'Fs',Fs); % Plot Freq Response using Transfer Function.
Output=filter(b,a,Input);
audiowrite('output.wav',Output,Fs);
댓글 수: 0
답변 (1개)
Christoph F.
2018년 1월 17일
편집: Christoph F.
2018년 1월 17일
124th order recursive filters are iffy, numerically. At this point, the limited precision of even the double datatype can lead to erroneous behavior.
Generally: max(abs(a)) is on the order of 10^31 min(abs(a)) is on the order of 10^-9
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!