implementing direct form 2 without using filter command

x = randn(200,1);
for n = 9:length(x)
y(n) = 9*w(n)+w(n-1)+w(n-2)+33*w(n-3)+12*w(n-4)
w(n) = 2*w(n-1)-1.5*w(n-2)+0.9*w(n-3)-0.96*w(n-4)+x(n)
end
The above are the equations for direct form2 realisation of a transfer function.But it is throwing an error for variable w(n).what is the value of w(n) so that the error is removed.

댓글 수: 1

Jan
Jan 2015년 7월 1일
편집: Jan 2015년 7월 1일
I've formatted your code to make it readable. Please use the "{} Code" button.
Please post the error message, when you mention, that there is one. Letting us guess the error at first wastes time.

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

 채택된 답변

Jan
Jan 2015년 7월 1일
편집: Jan 2015년 7월 1일

0 개 추천

Have you seen a working version of a direct form II implementation: http://www.mathworks.com/matlabcentral/answers/9900#answer_13623

댓글 수: 3

I have seen the direct form 2 implementation you have provided which uses "function [Y, z] = myFilter(b, a, X, z)" i am not allowed to use the above filter command.Is it possible to get the output just by using the difference equations i have provided. Thanks
"myFilter" is an implementation of direct form 2 that Jan has written and does not use the MATLAB "filter" command. You could name "myFilter" anything that is a valid MATLAB identifier, including
function [Y,z] = Supercalifragilisticexpialidocious(b, a, X, z)
Thank you very much for the clarification...

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

질문:

s
s
2015년 7월 1일

댓글:

s
s
2015년 7월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by