view dsp/synth/poly2snd.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 c75bb62b90a9
children
line wrap: on
line source
function X=poly2snd(A,u)
% POLY2SND  - Convert array of filter polynomial coeffs to one long sound by filtering noise
% Filter state is preserved as the function processes a number of filters
%
% poly2snd :: 
% 	(A:array 1..N of Poly, signal~'noise to filter')
%	->signal~'N concatentated sounds'
%
% Each ROW of A contains coefficients for one filter

Z=[];
for k=1:size(A,1)
	[x,Z]=filter(1,A(k,:),u,Z);
	if any(isnan(Z)), Z=[]; end;
	X(:,k)=0.999*x/max(abs(x));
end