Mercurial > hg > ishara
view dsp/synth/expsin.m @ 42:ae596261e75f
Various fixes and development to audio handling
author | samer |
---|---|
date | Tue, 02 Dec 2014 14:51:13 +0000 |
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));