Frequency-response data or model
h = idfrd(Response,Freq,Ts)
h = idfrd(Response,Freq,Ts,'CovarianceData',Covariance,'SpectrumData',Spec,'NoiseCovariance',Speccov)
h = idfrd(Response,Freq,Ts,...
'P1',V1,'PN',VN)
h = idfrd(mod)
h = idfrd(mod,Freqs)
h = idfrd(Response,Freq,Ts)
constructs
an idfrd
object that stores the frequency response, Response
,
of a linear system at frequency values, Freq
. Ts
is
the sample time. For a continuous-time system, set Ts=0
.
h = idfrd(Response,Freq,Ts,'CovarianceData',Covariance,'SpectrumData',Spec,'NoiseCovariance',Speccov)
also
stores the uncertainty of the response, Covariance
,
the spectrum of the additive disturbance (noise), Spec
,
and the covariance of the noise, Speccov
.
h = idfrd(Response,Freq,Ts,...
constructs an
'P1',V1,'PN',VN)idfrd
object
that stores a frequency-response model with properties specified by
the idfrd
model property-value pairs.
h = idfrd(mod)
converts a System Identification Toolbox™ or Control System Toolbox™ linear
model to frequency-response data at default frequencies, including
the output noise spectra and their covariance.
h = idfrd(mod,Freqs)
converts a System Identification Toolbox or Control System Toolbox linear
model to frequency-response data at frequencies Freqs
.
For a model
idfrd
object stores the transfer function
estimate , as well as the spectrum of
the additive noise (Φv)
at the output.
where λ is the estimated variance of e(t), and T is the sample time.
For a continuous-time system, the noise spectrum is given by:
Response
is a 3-D array of dimension ny
-by-nu
-by-Nf
,
with ny
being the number of outputs, nu
the
number of inputs, and Nf
the number of frequencies
(that is, the length of Freqs
). Response(ky,ku,kf)
is
thus the complex-valued frequency response from input ku
to
output ky
at frequency =Freqs(kf)
.
When defining the response of a SISO system, Response
can
be given as a vector.
Freqs
is a column vector of length Nf
containing
the frequencies of the response.
Ts
is the sample time. Ts = 0
means
a continuous-time model.
Intersample behavior: For discrete-time frequency response data
(Ts>0
), you can also specify the intersample
behavior of the input signal that was in effect when the samples were
collected originally from an experiment. To specify the intersample
behavior, use:
mf = idfrd(Response,Freq,Ts,'InterSample','zoh');
For multi-input systems, specify the intersample behavior using
an Nu-by-1 cell array, where Nu is
the number of inputs. The InterSample
property
is irrelevant for continuous-time data.
Covariance
is a 5-D array containing the
covariance of the frequency response. It has dimension ny
-by-nu
-by-Nf
-by-2-by-2.
The structure is such that Covariance(ky,ku,kf,:,:)
is
the 2-by-2 covariance matrix of the response Response(ky,ku,kf)
.
The 1-1 element is the variance of the real part, the 2-2 element
is the variance of the imaginary part, and the 1-2 and 2-1 elements
are the covariance between the real and imaginary parts. squeeze(Covariance(ky,ku,kf,:,:))
thus
gives the covariance matrix of the corresponding response.
The format for spectrum information is as follows:
spec
is a 3-D array of dimension ny
-by-ny
-by-Nf
,
such that spec(ky1,ky2,kf)
is the cross spectrum
between the noise at output ky1
and the noise at
output ky2
, at frequency Freqs(kf)
.
When ky1 = ky2
the (power) spectrum of the noise
at output ky1
is thus obtained. For a single-output
model, spec
can be given as a vector.
speccov
is a 3-D array of dimension ny
-by-ny
-by-Nf
,
such that speccov(ky1,ky1,kf)
is the variance of
the corresponding power spectrum.
If only SpectrumData
is to be packaged in
the idfrd
object, set Response = []
.
An idfrd
object can also be computed from
a given linear identified model, mod
.
If the frequencies Freqs
are not specified,
a default choice is made based on the dynamics of the model mod
.
Estimated covariance:
If you obtain mod
by identification,
the software computes the estimated covariance for the idfrd
object
from the uncertainty information in mod
. The software
uses the Gauss approximation formula for this calculation for all
model types, except grey-box models. For grey-box models (idgrey
),
the software applies numerical differentiation. The step sizes for
the numerical derivatives are determined by nuderst
.
If you create mod
by using commands
such as idss
, idtf
, idproc
, idgrey
,
or idpoly
, then the software sets CovarianceData
to []
.
Delay treatment: If mod
contains delays,
then the software assigns the delays of the idfrd
object, h
,
as follows:
h.InputDelay = mod.InputDelay
h.IODelay = mod.IODelay+repmat(mod.OutputDelay,[1,nu])
The expression repmat(mod.OutputDelay,[1,nu])
returns
a matrix containing the output delay for each input/output pair.
Frequency responses for submodels can be obtained by the standard
subreferencing, h = idfrd(m(2,3))
. h =
idfrd(m(:,[]))
gives an h
that just contains SpectrumData
.
The idfrd
models can be graphed with bode
, spectrum
,
and nyquist
, which accept mixtures of parametric
models, such as idtf
and idfrd
models
as arguments. Note that spa
, spafdr
,
and etfe
return their estimation results as idfrd
objects.
The idfrd
object represents complex frequency-response data. Before you
can create an idfrd
object, you must import your data as described
in Frequency-Response Data Representation.
Note
The idfrd
object can only encapsulate one
frequency-response data set. It does not support the iddata
equivalent
of multiexperiment data.
Use the following syntax to create the data
object fr_data
:
fr_data = idfrd(response,f,Ts)
Suppose that ny
is the number of output channels, nu
is
the number of input channels, and nf
is a vector
of frequency values. response
is an ny
-by-nu
-by-nf
3-D
array. f
is the frequency vector that contains
the frequencies of the response.Ts
is the sample
time, which is used when measuring or computing the frequency response.
If you are working with a continuous-time system, set Ts
to 0
.
response(ky,ku,kf)
, where ky
, ku
,
and kf
reference the k
th output,
input, and frequency value, respectively, is interpreted as the complex-valued
frequency response from input ku
to output ky
at
frequency f(kf)
.
You can specify object properties when you create the idfrd
object
using the constructor syntax:
fr_data = idfrd(response,f,Ts, 'Property1',Value1,...,'PropertyN',ValueN)
idfrd
object properties include:
|
Frequency response data. The |
|
Frequency points of the frequency response data. Specify |
|
Frequency units of the model. Units of the frequency vector in the
The units Changing this property changes the overall system behavior.
Use Default: |
|
Power spectra and cross spectra of the system output disturbances
(noise). Specify Specify For a single-output model, specify |
|
Response data covariance matrices. Specify
|
|
Power spectra variance. Specify |
|
Summary report that contains information about the estimation
options and results when the frequency-response model is obtained
using estimation commands, such as
The contents of f = logspace(-1,1,100); [mag,phase] = bode(idtf([1 .2],[1 2 1 1]),f); response = mag.*exp(1j*phase*pi/180); m = idfrd(response,f,0.08); m.Report.Method ans = '' If you obtain the frequency-response model using estimation
commands, the fields of load iddata3;
m = spa(z3);
m.Report.Method ans = SPA
For more information on this property and how to use it, see the Output Arguments section of the corresponding estimation command reference page and Estimation Report. |
|
Input intersample behavior. Specifies the behavior of the input signals between samples
for transformations between discrete-time and continuous-time. This
property is meaningful for discrete-time Set
For multi-input data, specify |
|
Transport delays. For continuous-time systems, specify transport delays in the
time unit stored in the For a MIMO system with Default: |
|
Input delay for each input channel, specified as a scalar value
or numeric vector. For continuous-time systems, specify input delays
in the time unit stored in the For a system with You can also set Default: 0 |
|
Output delays. For identified systems, like |
|
Sample time. For continuous-time models, Changing this property does not discretize or resample the model. Default: |
|
Units for the time variable, the sample time
Changing this property has no effect on other properties, and
therefore changes the overall system behavior. Use Default: |
|
Input channel names, specified as one of the following:
Alternatively, use automatic vector expansion to assign input
names for multi-input models. For example, if sys.InputName = 'controls'; The input names automatically expand to When you estimate a model using an You can use the shorthand notation Input channel names have several uses, including:
Default: |
|
Input channel units, specified as one of the following:
Use Default: |
|
Input channel groups. The sys.InputGroup.controls = [1 2]; sys.InputGroup.noise = [3 5]; creates input groups named sys(:,'controls') Default: Struct with no fields |
|
Output channel names, specified as one of the following:
Alternatively, use automatic vector expansion to assign output
names for multi-output models. For example, if sys.OutputName = 'measurements'; The output names automatically expand to When you estimate a model using an You can use the shorthand notation Output channel names have several uses, including:
Default: |
|
Output channel units, specified as one of the following:
Use Default: |
|
Output channel groups. The sys.OutputGroup.temperature = [1]; sys.InputGroup.measurement = [3 5]; creates output groups named sys('measurement',:) Default: Struct with no fields |
|
System name, specified as a character vector. For example, Default: |
|
Any text that you want to associate with the system, stored as a string or a cell array of
character vectors. The property stores whichever data type you
provide. For instance, if sys1.Notes = "sys1 has a string."; sys2.Notes = 'sys2 has a character vector.'; sys1.Notes sys2.Notes ans = "sys1 has a string." ans = 'sys2 has a character vector.' Default: |
|
Any type of data you want to associate with system, specified as any MATLAB® data type. Default: |
|
Sampling grid for model arrays, specified as a data structure. For arrays of identified linear (IDLTI) models that are derived by sampling one or more independent variables, this property tracks the variable values associated with each model. This information appears when you display or plot the model array. Use this information to trace results back to the independent variables. Set the field names of the data structure to the names of the sampling variables. Set the field values to the sampled variable values associated with each model in the array. All sampling variables should be numeric and scalar valued, and all arrays of sampled values should match the dimensions of the model array. For example, if you collect data at various operating points of a system, you can identify a model for each operating point separately and then stack the results together into a single system array. You can tag the individual models in the array with information regarding the operating point: nominal_engine_rpm = [1000 5000 10000];
sys.SamplingGrid = struct('rpm', nominal_engine_rpm) where For model arrays generated by linearizing a Simulink® model
at multiple parameter values or operating points, the software populates Default: |
The different channels of the idfrd
are retrieved
by subreferencing.
h(outputs,inputs)
h(2,3)
thus contains the response data from
input channel 3 to output channel 2, and, if applicable, the output
spectrum data for output channel 2. The channels can also be referred
to by their names, as in h('power',{'voltage','speed'})
.
Adding input channels,
h = [h1,h2,...,hN]
creates an idfrd
model h
,
with ResponseData
containing all the input channels
in h1,...,hN
. The output channels of hk
must
be the same, as well as the frequency vectors. SpectrumData
is
ignored.
Adding output channels,
h = [h1;h2;... ;hN]
creates an idfrd
model h
with ResponseData
containing
all the output channels in h1, h2,...,hN
. The input
channels of hk
must all be the same, as well as
the frequency vectors. SpectrumData
is also appended
for the new outputs. The cross spectrum between output channels of h1,
h2,...,hN
is then set to zero.
You can convert an idfrd
object to a frequency-domain iddata
object
by
Data = iddata(Idfrdmodel)
Seeiddata
.