Generate input signals
u = idinput(N)
u = idinput(N,type,band,levels)
[u,freqs] = idinput(N,'sine',band,levels,sinedata)
u = idinput(N) generates input signals
which are typically used for identification.
the number of generated input data.
u is returned
as a matrix or column vector:
N is a scalar,
a column vector with this number of rows.
N = [N nu] gives an input with
channels each of length
N = [P nu M] gives a periodic input
nu channels, each of length
periodic with period
nu = 1 and
M = 1.
It is recommended that you create an
u, indicating sample time, input names, periodicity,
and so on:
u = iddata(,u);
u = idinput(N,type,band,levels) specifies
the type of input signal to be generated. This argument takes one
of the following values:
'rgs' — Gives a random,
'rbs' — Gives a random,
binary signal. This is the default.
'prbs' — Gives a pseudorandom,
'sine' — Gives a signal
that is a sum of sinusoids. The sinusoids are chosen from the frequency
freq = 2*pi*[1:Grid_Skip:fix(P/2)]/P intersected
pi*[band(1) band(2)]. For multi-input signals,
the different inputs use different frequencies from this grid. An
integer number of full periods is always delivered. The selected frequencies
are obtained as
[u,freqs] = idinput(....), where
freqs contains the
frequencies of input number
The frequency contents of the signal is determined by the argument
For the choices
type = 'rs',
'sine', this argument is a row vector with
band = [wlow, whigh]
that determine the lower and upper bound of the passband. The
expressed in fractions of the Nyquist frequency. A white noise character
input is thus obtained for
band = [0 1], which
is also the default value.
For the choice
type = 'prbs',
band = [0, B]
B is such that the signal is constant
over intervals of length
1/B (the clock period).
In this case the default is
band = [0 1].
levels defines the input level.
It is a row vector
levels = [minu, maxu]
such that the signal
u will always be between
type = 'rbs',
type = 'rgs',
the signal level is such that
minu is the mean
value of the signal, minus one standard deviation, while
the mean value plus one standard deviation. Gaussian white noise with
zero mean and variance one is thus obtained for
[-1, 1], which is also the default value.
[u,freqs] = idinput(N,'sine',band,levels,sinedata) specifies
sine wave as the generated signal where
No_of_Trials, Grid_Skip], meaning that
equally spread over the indicated
random, relative phases, until the lowest amplitude signal is found.
Default value of
sindedata is [10,10,1].
If more than one period is demanded (that is,
1), the length of the data sequence and the period of the
PRBS signal are adjusted so that an integer number of maximum length
PRBS periods is always obtained. If
M = 1, the
period of the PRBS signal is chosen to that it is longer than
= N. In the multiple-input case, the signals are maximally
shifted. This means
P/nu is an upper bound for
the model orders that can be estimated with such a signal.
'sine' case, the sinusoids are chosen
from the frequency grid
freq = 2*pi*[1:Grid_Skip:fix(P/2)]/P
pi*[band(1) band(2)]. For
see below. For multiple-input signals, the different inputs use different
frequencies from this grid. An integer number of full periods is always
delivered. The selected frequencies are obtained as the second output
freqs, where row
the frequencies of input number
ku. The resulting
signal is affected by a fifth input argument,
sinedata = [No_of_Sinusoids, No_of_Trials, Grid_Skip]
No_of_Sinusoids is equally spread
over the indicated
random, relative phases) are tried until the lowest amplitude signal
Default: sinedata = [10,10,1];
Grid_Skip can be useful for controlling odd
and even frequency multiples, for example, to detect nonlinearities
of various kinds.
Create an input consisting of five sinusoids spread over the whole frequency interval. Compare the spectrum of this signal with that of its square. The frequency splitting (the square having spectral support at other frequencies) reveals the nonlinearity involved.
u = idinput([100 1 20],'sine',,,[5 10 1]); u = iddata(,u,1,'per',100); u2 = u.u.^2; u2 = iddata(,u2,1,'per',100); spectrum(etfe(u),'r*',etfe(u2),'+')
Very simple algorithms are used. The frequency contents are
'rgs' by an eighth-order Butterworth,
noncausal filter, using
idfilt. The same filter
is used for the
'rbs' case, before making the signal
binary. This means that the frequency contents are not guaranteed
to be precise in this case.
'sine' case, the frequencies are
selected to be equally spread over the chosen grid, and each sinusoid
is given a random phase. A number of trials are made, and the phases
that give the smallest signal amplitude are selected. The amplitude
is then scaled so as to satisfy the specifications of
See Söderström and Stoica (1989), Chapter C5.3. For a general discussion of input signals, see Ljung (1999), Section 13.3.