view arrows/dsp/afilter.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents 672052bd81f8
children
line wrap: on
line source
% 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