The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Coding Matlab function "filter" in C++
Replies: 6   Last Post: Feb 11, 2013 11:03 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 5
Registered: 4/3/08
Re: Coding Matlab function "filter" in C++
Posted: Feb 5, 2013 3:17 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Does anyone know what I am misunderstandning about Filter function concept with initial conditions of z0 = zi*y(1) as set in filtfilt function???
I tried to write my own as,

% assuming den & num has the same length
FilterOrder = (length(num)-1)/2;

for i=1:N
for j=1:2*FilterOrder
if i-j < 1
xo(j) = z0(j);
yo(j) = 0;
xo(j) = x(i-j);
yo(j) = y(i-j);
y(i) = num(1)*x(i) + sum(num(2:end).*xo') - sum(den(2:end).*yo');

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.