gensig {control} | R Documentation |
Generate periodic signal
Description
gensig
generates a periodic signal. More useful when used in combination with lsim
Usage
gensig(signal, tau, tfinal, tsam)
Arguments
signal |
A string input containing either values of: 'sq' or 'square' - Square wave 'si' or 'sine' - Sine wave 'co' or 'cos' - Cosine wave 'pu' or 'pulse' - Periodic pulse |
tau |
Duration of one period in seconds. Default is 5 |
tfinal |
Duration of the signal in seconds. Default is 30 |
tsam |
sampling time in seconds. Default is 0.01 |
Details
gensig
generates a periodic signal of the following types: square, sin, cos, pulse
Possible usage: gensig(signal)
Value
Returns a list of two single column matrices, u
and t
u
is the vector of signal values
t
is the time vector of the signal
See Also
Examples
## Not run: A square wave signal
sig <- gensig('square', 4, 10, 0.1)
plot(sig$t, sig$u, type = "l", col = "blue")
grid(5,5, col = "lightgray")
## Not run: A sine wave signal
sig <- gensig('sin')
plot(sig$t, sig$u, type = "l", col = "blue")
grid(5,5, col = "lightgray")
[Package control version 0.2.5 Index]