DynamicSystems
Square
generate a periodic square waveform
Calling Sequence
Parameters
Options
Description
Examples
Square( )
Square(yht, f, d, t0, y0, opts)
yht
-
(optional) algebraic; height of square wave; default is 1
f
(optional) algebraic; frequency of waveform; default is 1
d
(optional) algebraic; duty cycle from 0 to 1; default is 1/2
t0
(optional) algebraic; delay to start of square 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 Square command
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].
The Square command generates a periodic square waveform.
By default, Square returns an expression representing the waveform. If the option discrete is assigned true, Square 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 d specifies the duty-cycle of the square wave. A numeric value must be between 0 and 1, inclusive.
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.
with⁡DynamicSystems:
Square⁡
1t−2⁢π⁢trunc⁡t2⁢π<π0otherwise
Square⁡yht,f,d,t0,y0
y0t<t0y0+yhtt−t0−2⁢π⁢trunc⁡t−t0⁢f2⁢πf<2⁢d⁢πf0otherwiseotherwise
Square⁡discrete=true%T
1.1.1.1.0.0.0.1.1.1.
plot⁡Square⁡2,34,12,0,t=0..18
See Also
DynamicSystems[Chirp]
DynamicSystems[Ramp]
DynamicSystems[Sinc]
DynamicSystems[Sine]
DynamicSystems[Step]
DynamicSystems[Triangle]
Download Help Document