SignalProcessing - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Signal Processing : Signal Generation : SignalProcessing/GenerateTriangle

SignalProcessing

 GenerateTriangle
 generate a triangle

 Calling Sequence GenerateTriangle( n, magnitude, frequency, phase, asymmetry )

Parameters

 n - posint, number of samples to generate magnitude - realcons, magnitude of the signal frequency - realcons, the frequency of the signal (0 <= frequency < 1/2) phase - realcons, the phase of the signal (0 <= phase < 2Pi) asymmetry - realcons, the asymmetry of the signal (-Pi <= asymmetry < Pi)

Options

 • container : Array, predefined Array for holding results

Description

 • The GenerateTriangle(n, magnitude, frequency, phase, asymmetry ) command generates n samples for a triangular signal. The result is returned in an Array with datatype float[8].
 • The value of the magnitude argument must be positive.
 • The value of the frequency argument must be non-negative and strictly less than $\frac{1}{2}$.
 • The phase argument must be non-negative and strictly less than $2\mathrm{\pi }$.
 • The asymmetry argument must be greater than or equal to $-\mathrm{\pi }$, and strictly less than $\mathrm{\pi }$. When the value of asymmetry is equal to 0, the resulting triangle is symmetric.
 • If the container=C option is provided, then the results are put into C and C is returned. With this option, no additional memory is allocated to store the result. The container must be an Array of size n having datatype float[8].

 • The SignalProcessing[GenerateTriangle] command is thread-safe as of Maple 17.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $\mathrm{GenerateTriangle}\left(10,1,\frac{1}{\mathrm{π}},\mathrm{π},2.3\right)$
 $\left[\begin{array}{cccccccccc}{-}{0.154659252903654}& {-}{0.889738163359818}& {0.684501431689789}& {-}{0.0505774787663750}& {-}{0.785656389222540}& {0.788583205827068}& {0.0535042953709036}& {-}{0.681574615085261}& {0.892664979964346}& {0.157586069508182}\end{array}\right]$ (1)
 > $c≔\mathrm{Array}\left(1..10,'\mathrm{datatype}'={'\mathrm{float}'}_{8},'\mathrm{order}'='\mathrm{C_order}'\right):$
 > $\mathrm{GenerateTriangle}\left(10,1,\frac{1}{\mathrm{π}},\mathrm{π},2.3,'\mathrm{container}'=c\right)$
 $\left[\begin{array}{cccccccccc}{-}{0.154659252903654}& {-}{0.889738163359818}& {0.684501431689789}& {-}{0.0505774787663750}& {-}{0.785656389222540}& {0.788583205827068}& {0.0535042953709036}& {-}{0.681574615085261}& {0.892664979964346}& {0.157586069508182}\end{array}\right]$ (2)
 > $c$
 $\left[\begin{array}{cccccccccc}{-}{0.154659252903654}& {-}{0.889738163359818}& {0.684501431689789}& {-}{0.0505774787663750}& {-}{0.785656389222540}& {0.788583205827068}& {0.0535042953709036}& {-}{0.681574615085261}& {0.892664979964346}& {0.157586069508182}\end{array}\right]$ (3)
 > $\mathrm{plots}:-\mathrm{listplot}\left(\mathrm{GenerateTriangle}\left(100,1,\frac{1}{\mathrm{π}},\mathrm{π},2.3\right)\right)$

Compatibility

 • The SignalProcessing[GenerateTriangle] command was introduced in Maple 17.