GDAMPSIN

Purpose:

Generates a damped sine series.

Syntax:

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 x-axis.

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.

Returns:

A series, an exponentially damped sine wave.

Example:

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.

Example:

W2: gdampsin(1000, 0.001, 10, 0, -5)

 

Same as above.

Example:

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.

Example:

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)

 

gdampsin1.png

 

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.

Remarks:

For damping factor λ, time t, frequency f and phase θ, the damped sine wave is defined as:

 

image\gdampsin.gif

 

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.

See Also:

EXP

GSIN

GSWEEP

SIN

TRIGNOMETRIC FUNCTION GENERATORS