Mercurial > hg > ishara
view dsp/synth/expsin.m @ 58:ba866ae124c6
Now accepts single color index for all points.
author | samer |
---|---|
date | Fri, 09 Oct 2015 13:01:37 +0100 |
parents | c75bb62b90a9 |
children |
line wrap: on
line source
function x=expsin(n,k,l,phi) % expsin - return real part of complex exponential. % % expsin :: % N:natural ~'length of signal to return', % real ~'normalised frequency 1=sample rate', % real ~'decay rate, 1/time constant' % -> [[N]]. % % expsin :: % N:natural ~'length of signal to return', % real ~'normalised frequency 1=sample rate', % real ~'decay rate, 1/time constant' % real ~'initial phase' % -> [[N]]. % % If initial phase not given, defaults to -pi/2 (so initial % value is zero with +ve slope). if nargin<4, phi=pi/2; end t=0:n-1; x=real(exp((2*pi*k*i-l)*t-phi*i));