Contents Previous Next Subchapters

Auto-Regressive And Moving Average Filtering (Mlmode)
Syntax filter(b, a, x)
See Also filter , conv , polmul , kalman , arcov

Description
Filters the input sequence x using both the auto-regressive coefficients, a, and moving average coefficients b. If x is white noise, the return value is the ARMA process corresponding to a and b. The arguments a, b, and x can be either integer, real, double-precision or complex. The arguments must all be vectors but do not have to be the same type. The return value has the type that results from coercion between the arguments types and the same dimensions as x. Let na be the length of a, nb be the length of b, A be a/a(1), and B be b/a(1). The return vector y has the same length as x and is given by
     y  =  B  x  +  B  x    + . . . + B  x
      i     1  i     2  i-1            nb i-nb+1
                 -  A  y    - . . . - A  y
                     2  i-1            na i-na+1

where negative subscripts correspond to zero values.

Example
If in Mlmode you enter
     x = [1; 2; 3];
     a = [1; -1];
     b = [1; 1];
     filter(b, a, x)
O-Matrix will respond
     {
     1
     4
     9
     }
Note that the first element of a is one so A and B are equal to a and b respectively.
     y  =  x            =  1
      1     1
     y  =  x  + x  + y  =  4
      2     2    1    1
     y  =  x  + x  + y  =  9
      3     3    2    2