Engee documentation

square

Page in progress.

A rectangular signal.

Library

EngeeDSP

Syntax

Function call

  • x = square(t) — generates a rectangular signal with a period for time array elements t. The 'square` function is similar to the sine function, but it creates a rectangular signal with values of -1 and `1'.

  • x = square(t, duty::T) where T<:Number — generates a rectangular signal with the specified fill factor duty. The fill coefficient is the percentage of the signal period during which the rectangular signal is positive.

Arguments

Input arguments

# t — time array
Arbitrary type

Details

An array of time specified as a vector, matrix, or -D array. The 'square` function works with the first dimension of the array from t, the size of which is greater than `1'.

Data types

Float32, Float64

# duty — fill factor
nothing

Details

The fill factor, specified as a real scalar from 0 to `100'.

Data types

Float32, Float64

Output arguments

# x — rectangular signal

Details

A rectangular signal returned as a vector, matrix, or -D of the array.