annotate dsp/synth/expsin.m @ 61:eff6bddf82e3
tip
Finally implemented perceptual brightness thing.
author |
samer |
date |
Sun, 11 Oct 2015 10:20:42 +0100 |
parents |
c75bb62b90a9 |
children |
|
rev |
line source |
samer@34
|
1 function x=expsin(n,k,l,phi)
|
samer@34
|
2 % expsin - return real part of complex exponential.
|
samer@34
|
3 %
|
samer@34
|
4 % expsin ::
|
samer@34
|
5 % N:natural ~'length of signal to return',
|
samer@34
|
6 % real ~'normalised frequency 1=sample rate',
|
samer@34
|
7 % real ~'decay rate, 1/time constant'
|
samer@34
|
8 % -> [[N]].
|
samer@34
|
9 %
|
samer@34
|
10 % expsin ::
|
samer@34
|
11 % N:natural ~'length of signal to return',
|
samer@34
|
12 % real ~'normalised frequency 1=sample rate',
|
samer@34
|
13 % real ~'decay rate, 1/time constant'
|
samer@34
|
14 % real ~'initial phase'
|
samer@34
|
15 % -> [[N]].
|
samer@34
|
16 %
|
samer@34
|
17 % If initial phase not given, defaults to -pi/2 (so initial
|
samer@34
|
18 % value is zero with +ve slope).
|
samer@34
|
19
|
samer@34
|
20 if nargin<4, phi=pi/2; end
|
samer@34
|
21 t=0:n-1;
|
samer@34
|
22 x=real(exp((2*pi*k*i-l)*t-phi*i));
|