Generates a damped sine series.
GDAMPSIN(length, spacing, frequency, phase, dampfac)
length |
- |
An integer, the length of the output series. |
spacing |
- |
A
real, the spacing (delta x) between each point on the |
frequency |
- |
Optional. A real, the frequency specified in cycles per second (Hertz). Defaults to 10. |
phase |
- |
Optional. A real, the phase specified in radians. Defaults to 0. |
dampfac |
- |
Optional. A real, the exponential damping factor. Defaults to -5.0. |
A series, an exponentially damped sine wave.
W1: gdampsin(1000, 0.001)
Creates a 1000 point 10 Hz damped sine wave with points spaced at an interval of 0.001 seconds (a sample rate of 1000 Hz) with a phase of 0 and a damping factor of -5.0.
W2: gdampsin(1000, 0.001, 10, 0, -5)
Same as above.
W3: 100*gdampsin(10000, 1/1000, 5, 0, -0.5) + 50
Generates 10000 samples of a 5 Hz damped sine wave sampled at 1 kHz with a damping factor of -0.5. The amplitude is 100 and the result is offset by 50.0.
t = 0..0.001..1;
f = 10;
k = -3;
W1: 5 * exp(k*t) * sin(2*pi*f*t + pi/2)
W2: 5 * gdampsin(length(w1), deltax(w1), f, pi/2, k)

Both W1 and W2 generate 1001 samples of a 10 Hz damped sine wave sampled at 1 kHz with a phase of 90 degrees, a damping factor of -3 and an amplitude of 5.
For damping factor λ, time t, frequency f and phase θ, the damped sine wave is defined as:
The formula used to generate y[n] for n = 1 to N is:
y[n] = exp(dampfac • spacing • (n-1)) • sin(2π • frequency • spacing • (n-1) + phase)
See GSWEEP to generate a linearly swept sine wave.
TRIGNOMETRIC FUNCTION GENERATORS