Source primitives

Signal generators of various types.

Source primitives are primitives with no inputs. They generate signals, and may represent external inputs to the system, constant data, or synthesized stimuli. In the data flow model of computation, they are always enabled, and hence can be fired at any time. In the synchronous data flow model, the frequency with which they are fired, relative to other primitives in the system, is determined by the solution to the balance equations. The source primitives are summarized below in no particular order.

Floating point sources

Const
Output a constant signal with value given by the level parameter (default 0.0).
Impulse
Generate a single impulse or an impulse train. Each impulse has an amplitude level (default 1.0). If period (default 0) is equal to 0, then only a single impulse is generated; otherwise, period specifies the period of the impulse train.
Ramp
Generate a ramp signal, starting at value (default 0.0) and incrementing by step size step (default 1.0) on each firing.
ReadFile
Read ASCII data from a file. The simulation can be halted on end-of-file, or the file contents can be periodically repeated, or the file contents can be padded with zeros.
Rect
Generate a rectangular pulse of height (default 1.0) and width (default 8). If period is greater than zero, then the pulse is repeated with the given period.
WaveForm
Output a waveform as specified by the array parameter value (default [1 −1]). You can get periodic signals with any period, and can halt a simulation at the end of the given waveform. Following operations are possible:

haltAtEnd periodic period operation
NO YES 0 The period is the length of the waveform.
NO YES N > 0 The period is N.
NO NO anything Output the waveform once, then zeros.
YES anything anything Stop after outputting the waveform once.

The first line of the table gives the default settings. This primitive may be used to read a file by simply setting value to something of the form < filename, preferably specifying a complete path.

Fixed-point sources

ConstFix
Constant source for fixed-point values.
RampFix
Ramp for fixed-point values.
RectFix
Generate a fixed-point rectangular pulse of height (default 1.0) and width (default 8). If period is greater than zero, then the pulse is repeated with the given period. The precision of height can be specified in bits.

Complex sources

ConstCx
Constant source for complex values.
WaveFormCx
Output a complex waveform as specified by the array parameter value (default "(1,0) (-1,0)"). Note that "(a,b)" means \fs1a+jb. The parameters work the same way as in the WaveForm primitive.
ExpGen
Generate a complex exponential with the given frequency (relative to the samplerate parameter).
RectCx
Generate a rectangular pulse of height (default "(1.0,0.0)") and width (default 240). If period is greater than zero, then the pulse is repeated with the given period.

Integer sources

ConstInt
Constant source for integer values.
RampInt
Ramp for integer values.
PCMReadInt
Read a binary µ-law encoded PCM file. Return one sample on each firing. The file format that is read is the same as the one written by the Play primitive. The simulation can be halted on end-of-file, or the file contents can be periodically repeated, or the file contents can be padded with zeros.