Mercurial > hg > ishara
annotate dsp/synth/specsynth.m @ 34:c75bb62b90a9
Imported audio synthesis tools.
author | samer |
---|---|
date | Sun, 20 Jan 2013 19:05:05 +0000 |
parents | |
children |
rev | line source |
---|---|
samer@34 | 1 function Y=specsynth(S,gen,N,M) |
samer@34 | 2 % specsynth - Spectral synthesis by FIR filtering white noise |
samer@34 | 3 % |
samer@34 | 4 % specsynth :: |
samer@34 | 5 % seq([[L]]) ~'sequence of L-point power spectra', |
samer@34 | 6 % (N:natural=>[[1,N]]) ~'generator of noise buffers', |
samer@34 | 7 % N:natural ~'size of buffers of noise signals to take' |
samer@34 | 8 % M:natural ~'frame overlap' |
samer@34 | 9 % -> seq([[1,M]]) ~'sequence of signal buffers'. |
samer@34 | 10 |
samer@34 | 11 % NOTE: this should really take gen to be seq natural -> seq [[1,_]] |
samer@34 | 12 % eg |
samer@34 | 13 % gen = @(n)rndzip(sampler(gaussian),n,getrndstate) |
samer@34 | 14 % this should be the basic type of a buffered signal generator |
samer@34 | 15 |
samer@34 | 16 if nargin<4, M=N; end |
samer@34 | 17 U=rndmap(gen,repeat(N),getrndstate); |
samer@34 | 18 Y=unbuffer(zipwith(@conv,map(@(s)spec2fir(sqrt(s)),S),U),M); |