view sequences/@seq/dynfilter.m @ 36:9e7be347b3a0

Renamed sequence classes to avoid clashes with seq methods; Fixed default slicing dimension while retaining behaviour of window.m; Updated use of sequences in dsp/synth.
author samer
date Thu, 24 Jan 2013 14:51:23 +0000
parents 79038cbcce00
children
line wrap: on
line source
function y=dynfilter(ab,x,z,dim)
% dynfilter - filter for sequences of array with dynamically varying filter coeffs
%
% dynfilter :: seq {[[P]],[[P]]}, seq [Size], [[P]], D:natural -> seq [Size].
% dynfilter :: seq {[[P]],[[P]]}, seq [Size], [[P]]  -> seq [Size].
% dynfilter :: seq {[[P]],[[P]]}, seq [Size]  -> seq [Size].
%
% filtering is done along Dth dimension of the array (default=1)

if nargin<5, 
	dim=find(size(x)>1,1);
	if nargin<4, z=[]; end
end

y = zipaccum(@(ab1,x1,z1)filter(ab1{1},ab1{2},x1,z1,dim),z,ab,x);