help-octave
[Top][All Lists]

## Re: implementing filters

 From: Stephen W. Juranich Subject: Re: implementing filters Date: Sun, 21 Oct 2001 10:00:32 -0700

```> I'm a little confused on how to translate a typical filter equation
> making use of a "delay", or "forward shift" operator (the "q" in the
> following equation) into a standard difference equation.  As a result,
> I'm not sure if I'm using filter.oct correctly.  If I have an equation
> like:
>
>              1
>   yf(k) =  ---- y(k)
>            F(q)
>
>
> where y is my input, F(q) is some causal filter, and yf is my output,
> shouldn't this be the same as:
>
>
>   yf(k) = -1 * ( f(1)*y(k-1) + f(2)*y(k-2) +...+ f(n)*y(k-n))
>
>
> which I could then implement in Octave with:
>
>
>   yf = filter ( [0,-1*F], 1, y);

It looks like you've got your numerator and denominator mixed up.  If you read
'help filter', you'll see that the numerator of the transfer function is first
argument, the second is the denominator.  For example, say the filter impulse
response is a step function (it's not stable, I know, but just play along).
Then the command I would type in octave would be:

yf = filter(1, [1 0], y);

since (recall) that the Fourier transform of the step function is (1/s).  I

Good luck!

--------------------------------------------------------------------------
Electrical Engineering             http://students.washington.edu/sjuranic
University of Washington                http://ssli.ee.washington.edu/ssli

-------------------------------------------------------------
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
-------------------------------------------------------------

```