Function File: [u, t] = gensig (sigtype, tau)
Function File: [u, t] = gensig (sigtype, tau, tfinal)
Function File: [u, t] = gensig (sigtype, tau, tfinal, tsam)

Generate periodic signal. Useful in combination with lsim.

Inputs

sigtype = "sin"

Sine wave.

sigtype = "cos"

Cosine wave.

sigtype = "square"

Square wave.

sigtype = "pulse"

Periodic pulse.

tau

Duration of one period in seconds.

tfinal

Optional duration of the signal in seconds. Default duration is 5 periods.

tsam

Optional sampling time in seconds. Default spacing is tau/64.

Outputs

u

Vector of signal values.

t

Time vector of the signal.

See also: lsim.

Package: control