Mercurial > hg > ishara
diff dsp/synth/playarspec.m @ 34:c75bb62b90a9
Imported audio synthesis tools.
author | samer |
---|---|
date | Sun, 20 Jan 2013 19:05:05 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dsp/synth/playarspec.m Sun Jan 20 19:05:05 2013 +0000 @@ -0,0 +1,10 @@ +function X=playarspec(S,h) +% PLAYARSPEC - Return (or play) sound for a given power spectrum +% +% playarspec :: (S:spectrum,h:window)->x:signal +% S can be an array of spectra +% h is window or `grain shape' used to synthesis the sound +% (What about overlap? See stereo reconstrunction functions) + +x=poly2snd(ac2poly(spec2ac(S)),h.*randn(size(h))); +if nargout<1, sound(flatten(x),11025); else X=x; end