This documentation is no longer maintained. For documentation of the current version of emc2, please see http://www.linuxcnc.org/docview/html

SIGGEN

NAME
SYNOPSIS
DESCRIPTION
FUNCTIONS
PINS
PARAMETERS

NAME

siggen − signal generator

SYNOPSIS

loadrt siggen num_chan=num

DESCRIPTION

siggen is a signal generator that can be used for testing and other applications that need simple waveforms. It produces sine, cosine, triangle, sawtooth, and square waves of variable frequency, amplitude, and offset, which can be used as inputs to other HAL components.

siggen supports a maximum of sixteen channels. The number of channels actually loaded is set by the num_chan argument when the module is loaded. If numchan is not specified, the default value is one.

FUNCTIONS

siggen.N.update (uses floating-point)

Updates output pins for signal generator N. Each time it is called it calculates a new sample. It should be called many times faster than the desired signal frequency, to avoid distortion and aliasing.

PINS

siggen.N.frequency float in

The output frequency for signal generator N, in Hertz. The default value is 1.0 Hertz.

siggen.N.amplitude float in

The output amplitude for signal generator N. If offset is zero, the outputs will swing from -amplitude to +amplitude. The default value is 1.00.

siggen.N.offset float in

The output offset for signal generator N. This value is added directly to the output signal. The default value is zero.

siggen.N.square float out

The square wave output. Positive while triangle and cosine are ramping upwards, and while sine is negative.

siggen.N.sine float out

The sine output. Lags cosine by 90 degrees.

siggen.N.cosine float out

The cosine output. Leads sine by 90 degrees.

siggen.N.triangle float out

The triangle wave output. Ramps up while square is positive, and down while square is negative. Reaches its positive and negative peaks at the same time as cosine.

siggen.N.sawtooth float out

The sawtooth output. Ramps upwards to its positive peak, then instantly drops to its negative peak and starts ramping again. The drop occurs when triangle and cosine are at their positive peaks, and coincides with the falling edge of square.

PARAMETERS

None