% afilter - Linear filter arrow
%
% afilter :: 
%    [[P]] ~'filter B coefficients',
%    [[Q]] ~'filter A coefficients',
% -> arrow({[[N]]},{[[N]]},[[O]]).
%
% The arrow afilter(B,A) is equivalent to using filter(B,A,X)
% on a signal in an array.

function o=afilter(b,a,zi)

	if nargin<3, zi=[]; end
	o = loop(@filt,@(s)zi);
	function [y,z]=filt(x,z)
		[y,z]=filter(b,a,x,z);
	end
end
