Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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 ]
Chris Heier

Posts: 3
Registered: 11/29/05
Re: Coding Matlab function "filter" in C++
Posted: Nov 30, 2005 12:29 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> y(n) = k2*x(n) + k1*(1+k2)*x(n-1) + x(n-2) - k1*(1+k2)*y(n-1) - k2*y(n-2)

Hey thanks. That answers a ton for me. I guess the last thing I had
on my mind was in regards to n.

Since X would be a trace containing an array of samples, x[0] would
contain the first sample. In the algorithm, there is a point where it
is asking for x[n-1] and x[n-2]. In the case that n would equal 0, the
first part (n-1) would try to pull a value from the -1 element in the
array. How would I work around that for the first few elements of the
array?




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

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.