Engee documentation

square

A rectangular signal.

Library

EngeeDSP

Syntax

Function call

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

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

Arguments

Input arguments

# t — time array

+ vector | matrix | N-dimensional array

Details

An array of time specified as a vector, matrix, or - dimensional array. Function square works with the first dimension of an array of t, the size of which is larger 1.

Data types

Float32, Float64

# duty — fill factor

+ 50 (by default) | real scalar

Details

The fill factor, given as a real scalar of 0 before 100.

Data types

Float32, Float64

Output arguments

# x is a rectangular signal

+ vector | matrix | N-dimensional array

Details

A rectangular signal returned as a vector, matrix, or - dimensional array.