DynamicSystems - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Dynamic Systems : Signal Generation Tools : DynamicSystems/Triangle

DynamicSystems

 Triangle
 generate a periodic triangular waveform

 Calling Sequence Triangle( ) Triangle(yht, f, shape, t0, y0) Triangle(yht, f, shape, t0, y0, opts)

Parameters

 yht - (optional) algebraic; height of triangle wave; default is 1 f - (optional) algebraic; frequency of waveform; default is 1 shape - (optional) algebraic; shape factor from 0 to 1; default is 1 t0 - (optional) algebraic; delay to start of triangle wave; default is 0 y0 - (optional) algebraic; initial value; default is 0 opts - (optional) equation(s) of the form option = value; specify options for the Triangle command

Options

 • discrete = truefalse

Specifies that the output is a Vector containing samples of the waveform. Elements of the Vector are samples of the waveform. The number of elements in the Vector is given by samplecount. The i-th element corresponds to a sample at time t=(i-1)*sampletime. The default is the value of discrete in DynamicSystems[SystemOptions].

 • samplecount = posint

Specifies the number of samples in the output Vector. It is used with the discrete option. The default is the value of samplecount in DynamicSystems[SystemOptions].

 • sampletime = positive

Specifies the time between samples in the output Vector. It is used with the discrete option. The default is the value of sampletime in DynamicSystems[SystemOptions].

 • hertz = truefalse

Specifies that frequency is in hertz (cycles/second); otherwise frequency is in radians/second. The default is the value of hertz in DynamicSystems[SystemOptions].

Description

 • The Triangle command generates a periodic triangular waveform.
 • By default, Triangle returns an expression representing the waveform. If the option discrete is assigned true, Triangle returns a Vector of data points.
 • The optional parameter yht specifies the height of the signal. Its default value is one.
 • The optional parameter f specifies the frequency of the waveform. The default is one. The units of f are determined by the keyword parameter hertz.
 • The optional parameter shape specifies the shape of the triangle. A numeric value must be between 0 and 1, inclusive. The value of shape corresponds to the relative duration of the initial slope to the period. The default of 1 generates a saw-tooth waveform with a step falling edge.
 • The optional parameter t0 specifies the start time of the waveform. Its default value is zero.
 • The optional parameter y0 specifies the initial value. Its default value is zero.

Examples

 > $\mathrm{with}\left(\mathrm{DynamicSystems}\right):$
 > $\mathrm{Triangle}\left(\right)$
 $\frac{{t}{-}{2}{}{\mathrm{\pi }}{}{\mathrm{trunc}}{}\left(\frac{{t}}{{2}{}{\mathrm{\pi }}}\right)}{{2}{}{\mathrm{\pi }}}$ (1)
 > $\mathrm{Triangle}\left(\mathrm{hertz}=\mathrm{true}\right)$
 ${t}{-}{\mathrm{trunc}}{}\left({t}\right)$ (2)
 > ${\mathrm{evalf}}_{2}\left({\mathrm{Triangle}\left(1,1,\frac{1}{2},0,0,\mathrm{samplecount}=8,\mathrm{sampletime}=\frac{1}{4},\mathrm{hertz}=\mathrm{true},\mathrm{discrete}=\mathrm{true}\right)}^{\mathrm{%T}}\right)$
 $\left[\begin{array}{cccccccc}{0.}& {0.50}& {1.}& {0.50}& {0.}& {0.50}& {1.}& {0.50}\end{array}\right]$ (3)
 > $\mathrm{plot}\left(\mathrm{Triangle}\left(1,1,\frac{2}{3},\frac{1}{2},\frac{1}{4},\mathrm{hertz}=\mathrm{true}\right),t=0..3\right)$ 