Mercurial > hg > ishara
view dsp/synth/srdata.m @ 34:c75bb62b90a9
Imported audio synthesis tools.
author | samer |
---|---|
date | Sun, 20 Jan 2013 19:05:05 +0000 |
parents | |
children | 9e7be347b3a0 |
line wrap: on
line source
function x=srdata(gen,s0,varargin) % srdata - Signal as a sequence of blocks from signal generator object % % srdata :: % gen(A,B{1:N}) ~'signal generator object', % A ~'initial state', % seq(B{1} ~'sequence of 1st param values', % ... % seq(B{N} ~'sequence of Nst param values', % -> seq([[1,_]]). % % The main point of this construct is to maintain state % between calls to the block method of the signal generator, and % also to supply the generator with a sequence of parameter % values. x=mapaccum(@blockgen,s0,zip(varargin{:}),'sizecheck',1); function [y,state]=blockgen(theta,state) % this is weird - for some reason Matlab crashes if I call block % directly from here, but is ok if I go via the non-nested bblock [y,state]=bblock(gen,state,theta); end end function [y,s]=bblock(gen,s,theta) [y,s]=block_sr(gen,s,theta{:}); end