JuliaLang/julia — pull request #7513 by mbauman (2014-07-03 22:03:49+00:00)
Title: WIP: filt improvements

I've made a handful of improvements and extensions to the `filt` function.

* This redefines `filt` as `filt!` with a few modifications to perform its filtering in-place. `filt` is defined as a simple wrapper, copying the vectors that `filt!` modifies.
* Both `filt` and `filt!` now accept an optional fourth argument argument for the initial filter state vector. This vector is modified in-place in `filt!`
* The default filter state is now automatically computed such that its response to a step function is steady state.

Here's an example of why that third part is important. This is a 5 pole low-pass butter worth filter. In red is the old implementation (initial state of 0s), and in blue is the new default initial state:

![screen shot 2014-07-03 at 5 44 08 pm](https://cloud.githubusercontent.com/assets/154641/3476279/bc00735e-02fc-11e4-9e16-30598693b210.png)

Or with a DC offset:

![screen shot 2014-07-03 at 6 03 02 pm](https://cloud.githubusercontent.com/assets/154641/3476343/d27b4ae0-02fd-11e4-829e-d13b9c2a640a.png)

This changes the output of filt. I think that this is the "right" default. But it will change results. Is that ok?

If approved, I'll add NEWS and update the doc.

See my one inline comment.