JuliaLang/julia — pull request #7560 by mbauman (2014-07-10 22:00:51+00:00)
Title: Filtering (filt) across columns of arrays and method signature tweaks

Here are yet two more patches for `filt` and `filt!` following #7513.

#### 1. Enable filtering (filt) across columns of arrays.
When passed a multidimensional array, simply iterate over its columns, independently filtering each one. The starting filter state may be given as a vector (in which case it is common across all columns) or an array with the same number of columns as the input. This is a pretty common feature and is very handy.

cf. https://github.com/JuliaDSP/DSP.jl/pull/58#issuecomment-48619941

#### 2. Relax filt signatures to allow heterogeneous types
Previously, `filt[!]` methods were only defined for arguments of all the same type `T<:Number`. This relaxes that restriction, allowing one to, for example, filter an array of Float32s by Float64 coefficients.

By default, the output of filt will be the determined by `promote_type` of all arguments.

Instead of defining many type parameters (`T<:Number, S<:Number, R<:…`), filt now simply trusts that the eltype of the arrays have methods for basic arithmetic.

I needed this second change to simplify filtering of arrays of Float32s. It should generally be more forgiving.

cc: @simonster, @timholy, @codles