I have a question about the zero-frequency (DC) response of a IIR filter. The coefficients of the 3rd order IIR filter are as follows,
% polynomial coefficients for the numerator of the IIR transfer function b = [0.0066324, -0.0130292, 0.0063988]; % polynomial coefficients for the denominator of the IIR transfer function a = [1, -1.4158855, 0.4158913];
Note that the roots of
a are all less than unity, but one is quite close to the unity. I am trying to understand why MATLAB's
filter() function produces the following results:
rng default; x = rand(15,1); y = filter(b,a,x); mean(y)/mean(x) >> 0.0012
In the last statement, I computed the ratio of the input and output mean, MATLAB returns 0.0012.
However, from the zero-frequency of the transfer function $H(z)=0.3448$ (i.e.,
sum(b)/sum(a)=0.3448), I have expected that
mean(y)/mean(x)=0.3448. Checking this,
[H,W] = freqz(b,a); H(1) >> 0.3448
Have I misunderstood something here about MATLAB's
filter() function, or other misconception of the zero-frequency response of a transfer function? Thanks to anyone who is able to provide an insight to this problem.