I want to remove the DC from a ADC, so I designed a two-pole, 1 Hz high-pass Butterworth filter for a signal sampled at 10kHz. The filter coefficients are:
a = [ 0.99955581 -1.99911162 0.99955581] (a0, a1, a2) b = [ 0. 1.99911142 -0.99911182] (don't use, b1, b2)
Once the filter gets going (after 1 second) it work great, but it has a wicked response in that first second. I tried initializing the first two y's with both 0's and the future 1 second average. Testing the filter with white noise, here is an example of the initial transient. The initial variance of the white noise is 1 and the transient wanders up to 370 before settling down!
Question: What, if anything, can I do to calm this down?
BTW, my one-pole filter doesn't do this! Is it a stability issue with the two pole filter with a large ratio of sample frequency to cutoff frequency?