f2 = TFFilter([1., -0.97], [1])
b1 = filt(f2, x)
b2 = filt(f2, x)
filt() can have a state as input, but how is the sate recovered after the first call?
Cheers,
---david
--
You received this message because you are subscribed to the Google Groups "julia-dsp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-dsp+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
filt! makes a copy of the initial state before it does anything, so the si input isn't actually overwritten with the final state. But I agree that we need some way to get the final state.
We could change filt! to do this, but it's a little complicated because filt! can also do filtering along the first dimension of a matrix (or other nd array), and then it accepts either a matrix of initial states or a single initial state to use for all columns. In the latter case overwriting the initial state in place doesn't make so much sense.
We could also implement a streaming filtering API in DSP.jl instead of/in addition to hacking this onto filt!, although I think the basic representation of the filters should be separate from the state.
julia> myfilt = FIRFilter( h, 3//17 ) FIRFilter{FIRRational}(FIRRational(3x3 Array{Float64,2}: 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0,3//17,3,3,0,1,1),[0.0,0.0],2) julia> y1 = filt( myfilt, x[1:5] ) 1-element Array{Float64,1}: 1.0 julia> y2 = filt( myfilt, x[6:23] ) 4-element Array{Float64,1}: 6.0 12.0 18.0 23.0