annotate dsp/synth/addsynth.m @ 34:c75bb62b90a9

Imported audio synthesis tools.
author samer
date Sun, 20 Jan 2013 19:05:05 +0000
parents
children 9e7be347b3a0
rev   line source
samer@34 1 function y=addsynth(N,A,F,phi)
samer@34 2 % addsynth - Additive synthesis
samer@34 3 %
samer@34 4 % addsynth ::
samer@34 5 % N:natural ~'size of buffers to produce',
samer@34 6 % seq([[K]]) ~'sequence of amplitudes for each component',
samer@34 7 % seq([[K]]) ~'sequence of frequencies of sine waves to generate',
samer@34 8 % [[K]] ~'initial phases'
samer@34 9 % -> seq([[1,N]]) ~'sum of components'.
samer@34 10
samer@34 11 phi=repmat_to(phi,size(F));
samer@34 12 y=sum(zipdata(@(a,x)spdiag(a)*x,2,A,blockdata(msine,N,phi,F)),1);
samer@34 13