scipy/scipy — pull request #3717 by Eric89GXL (2014-06-06 19:06:32+00:00)
Title: ENH: Add second-order sections filtering

With @endolith, we've put together a working version of second-order sections. Closes #2444.

This PR contains:

1. `sosfilt`, which performs filtering using second-order sections.

2. `zpk2sos` / `tf2sos` to convert to `sos` format. We might actually want to remove `tf2sos`. I'm worried that users might have filters in `tf` form and think that going to `sos` will reduce numerical error. Forcing them to do `zp2sos(tf2zpk(b, a))` might make them think twice about why there isn't a `tf2sos` function. I'm interested to hear other opinions on this...?

3. `cplxpair` and `cplxreal`, which are helper functions for dealing with complex conjugate pairings.

Implementing `filtfilt`-equivalent functionality should be very easy, but I think we should tackle that with #3259 as opposed to adding another function here.

One other thing missing is `lfiltic`-equivalent functionality. This will require some state-space gymnastics that I haven't managed to solve (despite some effort). I'll try to figure it out, but I think that could be left to a subsequent PR, especially since this one is already pretty big.