summaryrefslogtreecommitdiff
path: root/docs/man/man9/siggen.9
blob: c08ce403b342f3cc53317094a0e262f1ce9f9a2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.TH SIGGEN "9" "2007-01-16" "LinuxCNC Documentation" "HAL Component"
.de TQ
.br
.ns
.TP \\$1
..

.SH NAME
siggen \- signal generator
.SH SYNOPSIS
\fBloadrt siggen [num_chan=\fInum\fB | names=\fIname1\fB[,\fIname2...\fB]]



.SH DESCRIPTION
\fBsiggen\fR 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.

.P
\fBsiggen\fR supports a maximum of sixteen channels.  The number of
channels actually loaded is set by the \fBnum_chan\fR argument when
the module is loaded.  Alternatively, specify \fBnames=\fR and unique names
separated by commas.
.P
The \fBnum_chan=\fR and \fBnames=\fR specifiers are mutually exclusive.
If neither \fBnum_chan=\fR nor \fBnames=\fR are specified, the default
value is one.

.SH NAMING
The names for pins, parameters, and functions are prefixed as:
  \fBsiggen.N.\fR for N=0,1,...,num-1 when using \fBnum_chan=num\fR
  \fBnameN.\fR for nameN=name1,name2,... when using \fBnames=name1,name2,...\fR

The \fBsiggen.N.\fR format is shown in the following descriptions.


.SH FUNCTIONS
.TP 
\fBsiggen.\fIN\fB.update\fR (uses floating-point)
Updates output pins for signal generator \fIN\fR.  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.

.SH PINS

.TP
\fBsiggen.\fIN\fB.frequency\fR float in
The output frequency for signal generator \fIN\fR, in Hertz.  The default
value is 1.0 Hertz.
.TP
\fBsiggen.\fIN\fB.amplitude\fR float in
The output amplitude for signal generator \fIN\fR.  If \fBoffset\fR is
zero, the outputs will swing from -\fBamplitude\fR to +\fBamplitude\fR.
The default value is 1.00.
.TP
\fBsiggen.\fIN\fB.offset\fR float in
The output offset for signal generator \fIN\fR.  This value is added
directly to the output signal.  The default value is zero.
.TP
\fBsiggen.\fIN\fB.clock\fR bit out
The clock output.  Bit type clock signal output at the commanded
frequency.
.TP
\fBsiggen.\fIN\fB.square\fR float out
The square wave output.  Positive while \fBtriangle\fR and \fBcosine\fR
are ramping upwards, and while \fBsine\fR is negative.
.TP
\fBsiggen.\fIN\fB.sine\fR float out
The sine output.  Lags \fBcosine\fR by 90 degrees.
.TP
\fBsiggen.\fIN\fB.cosine\fR float out
The cosine output.  Leads \fBsine\fR by 90 degrees.
.TP
\fBsiggen.\fIN\fB.triangle\fR float out
The triangle wave output.  Ramps up while \fBsquare\fR is positive, and
down while \fBsquare\fR is negative.  Reaches its positive and negative
peaks at the same time as \fBcosine\fR.
.TP
\fBsiggen.\fIN\fB.sawtooth\fR 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 \fBtriangle\fR and \fBcosine\fR are at their positive peaks, and
coincides with the falling edge of \fBsquare\fR.

.SH PARAMETERS
.P
None