Navigation

Operators and Keywords

Function List:

C++ API

filter.cc File Reference

#include "quit.h"
#include "defun-dld.h"
#include "error.h"
#include "oct-obj.h"

Include dependency graph for filter.cc:


Functions

MArrayN< doublefilter (MArray< double > &, MArray< double > &, MArrayN< double > &, int dim)
MArrayN< Complexfilter (MArray< Complex > &, MArray< Complex > &, MArrayN< Complex > &, int dim)
MArrayN< floatfilter (MArray< float > &, MArray< float > &, MArrayN< float > &, int dim)
MArrayN< FloatComplexfilter (MArray< FloatComplex > &, MArray< FloatComplex > &, MArrayN< FloatComplex > &, int dim)
template<class T >
MArrayN< Tfilter (MArray< T > &b, MArray< T > &a, MArrayN< T > &x, MArrayN< T > &si, int dim=0)
MArrayN< doublefilter (MArray< double > &, MArray< double > &, MArrayN< double > &, MArrayN< double > &, int dim)
MArrayN< Complexfilter (MArray< Complex > &, MArray< Complex > &, MArrayN< Complex > &, MArrayN< Complex > &, int dim)
MArrayN< floatfilter (MArray< float > &, MArray< float > &, MArrayN< float > &, MArrayN< float > &, int dim)
MArrayN< FloatComplexfilter (MArray< FloatComplex > &, MArray< FloatComplex > &, MArrayN< FloatComplex > &, MArrayN< FloatComplex > &, int dim)
template<class T >
MArrayN< Tfilter (MArray< T > &b, MArray< T > &a, MArrayN< T > &x, int dim=-1)
 DEFUN_DLD (filter, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {y =} filter (@var{b}, @var{a}, @var{x})\n\ @deftypefnx {Loadable Function} {[@var{y}, @var{sf}] =} filter (@var{b}, @var{a}, @var{x}, @var{si})\n\ @deftypefnx {Loadable Function} {[@var{y}, @var{sf}] =} filter (@var{b}, @var{a}, @var{x}, [], @var{dim})\n\ @deftypefnx {Loadable Function} {[@var{y}, @var{sf}] =} filter (@var{b}, @var{a}, @var{x}, @var{si}, @var{dim})\n\ Return the solution to the following linear, time-invariant difference\n\ equation:\n\ @iftex\n\ @tex\n\ $$\n\ \\sum_{k=0}^N a_{k+1} y_{n-k} = \\sum_{k=0}^M b_{k+1} x_{n-k}, \\qquad\n\ 1 \\le n \\le P\n\ $$\n\ @end tex\n\ @end iftex\n\ @ifnottex\n\ \n\ @c Set example in small font to prevent overfull line\n\ @smallexample\n\ N M\n\ SUM a(k+1) y(n-k) = SUM b(k+1) x(n-k) for 1<=n<=length(x)\n\ k=0 k=0\n\ @end smallexample\n\ @end ifnottex\n\ \n\ @noindent\n\ where\n\ @ifnottex\n\ N=length(a)-1 and M=length(b)-1.\n\ @end ifnottex\n\ @iftex\n\ @tex\n\ $a \\in \\Re^{N-1}$, $b \\in \\Re^{M-1}$, and $x \\in \\Re^P$.\n\ @end tex\n\ @end iftex\n\ over the first non-singleton dimension of @var{x} or over @var{dim} if\n\ supplied. An equivalent form of this equation is:\n\ @iftex\n\ @tex\n\ $$\n\ y_n = -\\sum_{k=1}^N c_{k+1} y_{n-k} + \\sum_{k=0}^M d_{k+1} x_{n-k}, \\qquad\n\ 1 \\le n \\le P\n\ $$\n\ @end tex\n\ @end iftex\n\ @ifnottex\n\ \n\ @c Set example in small font to prevent overfull line\n\ @smallexample\n\ N M\n\ y(n) = - SUM c(k+1) y(n-k) + SUM d(k+1) x(n-k) for 1<=n<=length(x)\n\ k=1 k=0\n\ @end smallexample\n\ @end ifnottex\n\ \n\ @noindent\n\ where\n\ @ifnottex\n\ c = a/a(1) and d = b/a(1).\n\ @end ifnottex\n\ @iftex\n\ @tex\n\ $c = a/a_1$ and $d = b/a_1$.\n\ @end tex\n\ @end iftex\n\ \n\ If the fourth argument @var{si} is provided, it is taken as the\n\ initial state of the system and the final state is returned as\n\ @var{sf}. The state vector is a column vector whose length is\n\ equal to the length of the longest coefficient vector minus one.\n\ If @var{si} is not supplied, the initial state vector is set to all\n\ zeros.\n\ \n\ In terms of the z-transform, y is the result of passing the discrete-\n\ time signal x through a system characterized by the following rational\n\ system function:\n\ @iftex\n\ @tex\n\ $$\n\ H(z) = {\\displaystyle\\sum_{k=0}^M d_{k+1} z^{-k}\n\ \\over 1 + \\displaystyle\\sum_{k+1}^N c_{k+1} z^{-k}}\n\ $$\n\ @end tex\n\ @end iftex\n\ @ifnottex\n\ \n\ @example\n\ @group\n\ M\n\ SUM d(k+1) z^(-k)\n\ k=0\n\ H(z) = ----------------------\n\ N\n\ 1 + SUM c(k+1) z^(-k)\n\ k=1\n\ @end group\n\ @end example\n\ @end ifnottex\n\ @end deftypefn")

Function Documentation

DEFUN_DLD ( filter  ,
args  ,
nargout   
)

template<class T >
MArrayN<T> filter ( MArray< T > &  b,
MArray< T > &  a,
MArrayN< T > &  x,
int  dim = -1 
) [inline]

template MArrayN< FloatComplex > filter ( MArray< FloatComplex > &  ,
MArray< FloatComplex > &  ,
MArrayN< FloatComplex > &  ,
MArrayN< FloatComplex > &  ,
int  dim 
)

template MArrayN< float > filter ( MArray< float > &  ,
MArray< float > &  ,
MArrayN< float > &  ,
MArrayN< float > &  ,
int  dim 
)

template MArrayN< Complex > filter ( MArray< Complex > &  ,
MArray< Complex > &  ,
MArrayN< Complex > &  ,
MArrayN< Complex > &  ,
int  dim 
)

template MArrayN< double > filter ( MArray< double > &  ,
MArray< double > &  ,
MArrayN< double > &  ,
MArrayN< double > &  ,
int  dim 
)

template<class T >
MArrayN<T> filter ( MArray< T > &  b,
MArray< T > &  a,
MArrayN< T > &  x,
MArrayN< T > &  si,
int  dim = 0 
) [inline]

template MArrayN< FloatComplex > filter ( MArray< FloatComplex > &  ,
MArray< FloatComplex > &  ,
MArrayN< FloatComplex > &  ,
int  dim 
)

template MArrayN< float > filter ( MArray< float > &  ,
MArray< float > &  ,
MArrayN< float > &  ,
int  dim 
)

template MArrayN< Complex > filter ( MArray< Complex > &  ,
MArray< Complex > &  ,
MArrayN< Complex > &  ,
int  dim 
)

template MArrayN< double > filter ( MArray< double > &  ,
MArray< double > &  ,
MArrayN< double > &  ,
int  dim 
)