[SciPy-dev] reimplementation of lfilter

Sturla Molden sturla@molden...
Tue Sep 22 14:19:27 CDT 2009

Ralf Gommers skrev:
 > Looks like a very useful improvement.
 > Your docstring won't render well, and there is already a cleaned up 
version of the old one here: 
http://docs.scipy.org/scipy/docs/scipy.signal.signaltools.lfilter/ Could 
you please integrate those changes with yours?

The code from SVN I linked is current version used in signaltools.

Also lost of the lfilter C code deal with complex numbers, which
is something an ISO compliant C or C++ compiler can do for us.

#ifdef __cplusplus
  #include <complex>
  typedef std::complex<float>       complex_float; 
  typedef std::complex<double>      complex_double; 
  typedef std::complex<long double> complex_long_double;
  #define restrict
  #include <complex.h>
  typedef float       _Complex      complex_float;
  typedef double      _Complex      complex_double;
  typedef long double _Complex      complex_long_double;

Perhaps a better option is to use C++ only... In any case, it is
better to leave the complex number arithmetics to the compiler,
instead of bloating the source.

Sturla Molden

More information about the Scipy-dev mailing list