SAC Command Reference Manual

FUNCGEN

SUMMARY

Generates a function and stores it in memory.

SYNTAX

FUNCGEN {type},{DELTA v},{NPTS n},{BEGIN v}

where type is one of the following:

IMPULSE
STEP
BOXCAR
TRIANGLE
SINE {frequency phase}
LINE {slope intercept}
QUADRATIC {a b c}
CUBIC {a b c d}
SEISMOGRAM
RANDOM {nfiles seed}
IMPSTRIN {n1 n2 ... nN}

INPUT

IMPULSE:

Impulse at central data point.

IMPSTRIN:

A series of impulses at the specified sample points.

STEP:

Step function. Zero in first half. One in second half.

BOXCAR:

Boxcar function. Zero in first and last thirds. One in middle third.

TRIANGLE:

Triangle function. Zero in first and last quarters. Linearly increasing from zero to one in second quarter and decreasing from one to zero in third quarter.

SINE {frequency phase}:
 

Sine wave with frequency in Hz and phase angle in degrees. Amplitude is one.

Note There is a factor of 2*pi in the phase argument:

function = 1.0 * sin (2 * Pi * f * t)
LINE {slope intercept}:
 

Linear function with slope given and intercept

QUADRATIC {a b c}:
 

Quadratic function of the form:

a*t^{2} + b*t + c
CUBIC {a b c d}:
 

Cubic function of the form:

a*t^{3} + b*t^{2} + c*t + d
SEISMOGRAM:

Sample seismogram. This differs from other function options for fg in that there are no further options. Specifically, DELTA, NPTS, and BEGIN options are ignored for seismogram (abbreviated seis).

RANDOM {nfiles seed}:
 

Random sequence (Gausian white noise) generator. Number of random sequence files to generate is first and the "seed" used to generate the first random number is second. This seed value is stored in USER0 so that you can regenerate the same random sequence at a later time if desired.

Note This is not really random, not even psuedo-random.

DELTA v:

Set increment between samples to v. Stored in header as DELTA.

NPTS n:

Set number of data points in function to n. Stored in header as NPTS.

BEGIN v:

Set begin time to v. Stored in header as BEGIN.

DEFAULT VALUES

FUNCGEN IMPULSE NPTS 100 DELTA 1.0 BEGIN 0.
FUNCGEN SINE 0.05 0.0
FUNCGEN LINE 1 1
FUNCGEN QUADRATIC 1 1 1
FUNCGEN CUBIC 1 1 1
FUNCGEN RANDOM 1 12357
FUNCGEN SEISMO [there are no further options]

DESCRIPTION

Executing this command is equivalent to reading a single file (except for the RANDOM option in which more than one file can be generated) into memory whose name is the name of the function generated. Any data previously in memory is destroyed. Other functions will be added as needed.

Any command which loads data into memory is monitored to maintain a level of confidence in the event infomation when transfered from the SAC data buffer to the CSS data buffer. When FUNCGEN is used, the confidence is set to LOW, indicating that SAC should consider any matching event IDs as artifacts and reassign the event ID of the incoming file. For more details, use HELP READ.

HEADER CHANGES

A header is set up in memory which accurately describes the function generated.

SEE COMMANDS

DATAGEN

LATEST REVISION

October 11, 1984 (Version 9.1)