[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
filter.oct -- how to use it?!?
From: |
E. Joshua Rigler |
Subject: |
filter.oct -- how to use it?!? |
Date: |
Fri, 28 Sep 2001 18:14:38 -0600 |
I recently made a fool of myself on this list by asking a dumb question
about FFTs, so what harm can it do for me to ask another dumb
question...
How are you supposed to use the Octave filter function? If I do
something like:
[yn] = filter (0, [1,-.5,-.1], [0,0,0], [10,10])
...the output is:
yn = 10 15 8.5
...when *I* expect it to be:
yn = 6.0 4.0 2.6
Isn't the "initial state" the same as saying [y(n-na) ... y(n-1)]? I am
assuming that filter operates like:
y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb)
- a(2)*y(n-1) - ... - a(na+1)*y(n-na)
(where b = x = 0)
It seems like filter is prepending (na-1) zeros to the inital state,
filtering all these zeros, then adding the value to the first element of
the initial state. Then bumping up to y(n+1), filtering again, and
adding to the second element of the initial state, and so on. Why? I
just want to take the previous n values in a time series and filter them
to predict the (n+1st) value. This is what the "Direct Form II
Transposed Structure" should be doing for me isn't it? Am I just being
really dense?
Be kind ;^).
-EJR
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- filter.oct -- how to use it?!?,
E. Joshua Rigler <=