view dsp/synth/poly2snd.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
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