view dsp/synth/addsynth.m @ 36:9e7be347b3a0

Renamed sequence classes to avoid clashes with seq methods; Fixed default slicing dimension while retaining behaviour of window.m; Updated use of sequences in dsp/synth.
author samer
date Thu, 24 Jan 2013 14:51:23 +0000
parents c75bb62b90a9
children
line wrap: on
line source
function y=addsynth(N,A,F,phi)
% addsynth - Additive synthesis
%
% addsynth ::
%    N:natural    ~'size of buffers to produce',
%    seq([[K]])   ~'sequence of amplitudes for each component',
%    seq([[K]])   ~'sequence of frequencies of sine waves to generate',
%    [[K]]        ~'initial phases'
% -> seq([[1,N]]) ~'sum of components'.

phi=repmat_to(phi,size(F));
y=zipwith(@(a,x)a'*x,A,blockdata(msine,N,phi,F));