What exactly is the "zf" content in the MATLAB functional filter

I know that to filter a lot of data in chuncks, you can use the filter function with the corresponding filter coefficients, and pass the final conditions "zf" to the next piece as its initial conditions "zi".

I'm confused. What is the content of "zf"?

Does it contain the latest relevant input? (in a clean FIR filter) the latest relevant exhaust samples? (in WORLD) what does he hold when both the last entrances and the last exits are relevant?

Many thanks

+4
source share
2 answers

, zf zi .

, : x newx filter, ,

[y,zf] = filter(b,a,x);
newy = filter(b,a,newx,zf); 

a b, ,

enter image description here

length(a) -1 y length(b) -1 x.

, max(length(a),length(b)) -1 .

1

y[n] = x[n] + 2 * x[n-1] + 3 * x[n-2];

,

a = 1;
b = [1 2 3];

:

x = [1     2     3     4     5     6     7     8     9];
y = [1     4    10    16    22    28    34    40    46];
zf = [42  27]';

newx,

newy[1] = newx[1] + 2*9 + 3*8 = newx[1] + 42 = newx[1] + zf[1];
newy[2] = newx[2] + 2 * newx[1] + 3*9 = newx[2] + 2 * newx[1] + zf[2];

2

x = 1 : 9;
b = [1 1 1];
a = [1 2];
[y,zf] = filter(b,a,x);

y[n] = x[n] + x[n-1] + x[n-2] - 2*y[n-1].

:

 x = [1     2     3     4     5     6     7     8     9];
 y = [1     1     4     1    10    -5    28   -35    94];
 zf = [-171 9]';

:

newy[1] = newx[1] + 9 + 8 - 2 * 94 = newx[1] - 171 = newx[1] + zf(1);
newy[2] = newx[2] + newx[1] + 9 - 2*newy[1] = newx[2] + newx[1] + zf(2) - 2*newy[1];

, , , zf.

+4

zf IIR. , , . ., , wikipedia . " 1" . " 2" . , , .

filter :

filter_state = []; % start with empty state

for i = 1:num_chunks
    input_chunk = get_chunk(i);
    [output_chunk, filter_state] = filter(b, a, input_chunk, filter_state);
    save_chunk(i, output_chunk)
end
+1

All Articles