Documentation Center 
Frequencyresponse 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 sampling time interval. For a continuoustime 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,...
'P1',V1,'PN',VN) constructs an idfrd object
that stores a frequencyresponse model with properties specified by
the idfrd model propertyvalue pairs.
h = idfrd(mod) converts a System Identification Toolbox™ or Control System Toolbox™ linear model to frequencyresponse 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 frequencyresponse data at frequencies Freqs.
For a model
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 sampling interval.
Response is a 3D array of dimension nybynubyNf, 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 complexvalued 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 sampling interval. Ts = 0 means a continuoustime model.
Intersample behavior: For discretetime 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 multiinput systems, specify the intersample behavior using an Nuby1 cell array, where Nu is the number of inputs. The InterSample property is irrelevant for continuoustime data.
Covariance is a 5D array containing the covariance of the frequency response. It has dimension nybynubyNfby2by2. The structure is such that Covariance(ky,ku,kf,:,:) is the 2by2 covariance matrix of the response Response(ky,ku,kf). The 11 element is the variance of the real part, the 22 element is the variance of the imaginary part, and the 12 and 21 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 3D array of dimension nybynybyNf, 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 singleoutput model, spec can be given as a vector.
speccov is a 3D array of dimension nybynybyNf, 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 greybox models. For greybox 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 represents complex frequencyresponse data. Before you can create an idfrd object, you must import your data as described in FrequencyResponse Data Representation.
Note: The idfrd object can only encapsulate one frequencyresponse 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 nybynubynf 3D array. f is the frequency vector that contains the frequencies of the response.Ts is the sampling time, which is used when measuring or computing the frequency response. If you are working with a continuoustime system, set Ts to 0.
response(ky,ku,kf), where ky, ku, and kf reference the kth output, input, and frequency value, respectively, is interpreted as the complexvalued 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:
ResponseData 
Frequency response data. The 'ResponseData' property stores the frequency response data as a 3D array of complex numbers. For SISO systems, 'ResponseData' is a vector of frequency response values at the frequency points specified in the 'Frequency' property. For MIMO systems with Nu inputs and Ny outputs, 'ResponseData' is an array of size [Ny Nu Nw], where Nw is the number of frequency points. 
Frequency 
Frequency points of the frequency response data. Specify Frequency values in the units specified by the FrequencyUnit property. 
FrequencyUnit 
Frequency units of the model. FrequencyUnit is a string that specifies the units of the frequency vector in the Frequency property. Set FrequencyUnit to one of the following values:
The units 'rad/TimeUnit' and 'cycles/TimeUnit' are relative to the time units specified in the TimeUnit property. Changing this property changes the overall system behavior. Use chgFreqUnit to convert between frequency units without modifying system behavior. Default: 'rad/TimeUnit' 
SpectrumData 
Power spectra and cross spectra of the system output disturbances (noise). Specify SpectrumData as a 3D array of complex numbers. Specify SpectrumData as a 3D array with dimension nybynybyNf. Here, ny is the number of outputs and Nf is the number of frequency points. SpectrumData(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 singleoutput model, specify SpectrumData as a vector. 
CovarianceData 
Response data covariance matrices. Specify CovarianceData as a 5D array with dimension nybynubyNfby2by2. Here, ny, nu, and Nf are the number of outputs, inputs and frequency points, respectively. CovarianceData(ky,ku,kf,:,:) is the 2by2 covariance matrix of the response data ResponseData(ky,ku,kf). The 11 element is the variance of the real part, the 22 element is the variance of the imaginary part, and the 12 and 21 elements are the covariance between the real and imaginary parts. squeeze(Covariance(ky,ku,kf,:,:)) 
NoiseCovariance 
Power spectra variance. Specify NoiseCovariance as a 3D array with dimension nybynybyNf. Here, ny is the number of outputs and Nf is the number of frequency points. NoiseCovariance(ky1,ky1,kf) is the variance of the corresponding power spectrum. To eliminate the influence of the noise component from the model, specify NoiseVariance as 0. Zero variance makes the predicted output the same as the simulated output. 
Report 
Information about the estimation process. Report contains the following fields:

InterSample 
Input intersample behavior. Specifies the behavior of the input signals between samples for transformations between discretetime and continuoustime. This property is meaningful for discretetime idfrd models only. Set InterSample to one of the following:
For multiinput data, specify InterSample as an Nuby1 cell array, where Nu is the number of inputs. 
ioDelay 
Transport delays. ioDelay is a numeric array specifying a separate transport delay for each input/output pair. For continuoustime systems, specify transport delays in the time unit stored in the TimeUnit property. For discretetime systems, specify transport delays in integer multiples of the sampling period, Ts. For a MIMO system with Ny outputs and Nu inputs, set ioDelay to a NybyNu array. Each entry of this array is a numerical value that represents the transport delay for the corresponding input/output pair. You can also set ioDelay to a scalar value to apply the same delay to all input/output pairs. Default: 0 for all input/output pairs 
InputDelay 
Input delay for each input channel, specified as a scalar value or numeric vector. For continuoustime systems, specify input delays in the time unit stored in the TimeUnit property. For discretetime systems, specify input delays in integer multiples of the sampling period Ts. For example, InputDelay = 3 means a delay of three sampling periods. For a system with Nu inputs, set InputDelay to an Nuby1 vector. Each entry of this vector is a numerical value that represents the input delay for the corresponding input channel. You can also set InputDelay to a scalar value to apply the same delay to all channels. Default: 0 
OutputDelay 
Output delays. For identified systems, like idfrd, OutputDelay is fixed to zero. 
Ts 
Sampling time. For continuoustime models, Ts = 0. For discretetime models, Ts is a positive scalar representing the sampling period expressed in the unit specified by the TimeUnit property of the model. To denote a discretetime model with unspecified sampling time, set Ts = 1. Changing this property does not discretize or resample the model. Use c2d and d2c to convert between continuous and discretetime representations. Use d2d to change the sampling time of a discretetime system. Default: 1 
TimeUnit 
String representing the unit of the time variable. For continuoustime models, this property represents any time delays in the model. For discretetime models, it represents the sampling time Ts. Use any of the following values:
Changing this property changes the overall system behavior. Use chgTimeUnit to convert between time units without modifying system behavior. Default: 'seconds' 
InputName 
Input channel names. Set InputName to a string for singleinput model. For a multiinput model, set InputName to a cell array of strings. Alternatively, use automatic vector expansion to assign input names for multiinput models. For example, if sys is a twoinput model, enter: sys.InputName = 'controls'; The input names automatically expand to {'controls(1)';'controls(2)'}. When you estimate a model using an iddata object, data, the software automatically sets InputName to data.InputName. You can use the shorthand notation u to refer to the InputName property. For example, sys.u is equivalent to sys.InputName. Input channel names have several uses, including:
Default: Empty string '' for all input channels 
InputUnit 
Input channel units. Use InputUnit to keep track of input signal units. For a singleinput model, set InputUnit to a string. For a multiinput model, set InputUnit to a cell array of strings. InputUnit has no effect on system behavior. Default: Empty string '' for all input channels 
InputGroup 
Input channel groups. The InputGroup property lets you assign the input channels of MIMO systems into groups and refer to each group by name. Specify input groups as a structure. In this structure, field names are the group names, and field values are the input channels belonging to each group. For example: sys.InputGroup.controls = [1 2]; sys.InputGroup.noise = [3 5]; creates input groups named controls and noise that include input channels 1, 2 and 3, 5, respectively. You can then extract the subsystem from the controls inputs to all outputs using: sys(:,'controls') Default: Struct with no fields 
OutputName 
Output channel names. Set OutputName to a string for singleoutput model. For a multioutput model, set OutputName to a cell array of strings. Alternatively, use automatic vector expansion to assign output names for multioutput models. For example, if sys is a twooutput model, enter: sys.OutputName = 'measurements'; The output names to automatically expand to {'measurements(1)';'measurements(2)'}. When you estimate a model using an iddata object, data, the software automatically sets OutputName to data.OutputName. You can use the shorthand notation y to refer to the OutputName property. For example, sys.y is equivalent to sys.OutputName. Output channel names have several uses, including:
Default: Empty string '' for all input channels 
OutputUnit 
Output channel units. Use OutputUnit to keep track of output signal units. For a singleoutput model, set OutputUnit to a string. For a multioutput model, set OutputUnit to a cell array of strings. OutputUnit has no effect on system behavior. Default: Empty string '' for all input channels 
OutputGroup 
Output channel groups. The OutputGroup property lets you assign the output channels of MIMO systems into groups and refer to each group by name. Specify output groups as a structure. In this structure, field names are the group names, and field values are the output channels belonging to each group. For example: sys.OutputGroup.temperature = [1]; sys.InputGroup.measurement = [3 5]; creates output groups named temperature and measurement that include output channels 1, and 3, 5, respectively. You can then extract the subsystem from all inputs to the measurement outputs using: sys('measurement',:) Default: Struct with no fields 
Name 
System name. Set Name to a string to label the system. Default: '' 
Notes 
Any text that you want to associate with the system. Set Notes to a string or a cell array of strings. Default: {} 
UserData 
Any type of data you wish to associate with system. Set UserData to any MATLAB^{®} data type. Default: [] 
SamplingGrid 
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 sys is an array containing three identified models obtained at rpms 1000, 5000 and 10000, respectively. Default: [] 
To view the properties of the idfrd object, you can use the get command. The following example shows how to create an idfrd object that contains 100 frequencyresponse values with a sampling time interval of 0.08 s and get its properties:
% Create the idfrd data object fr_data = idfrd(response,f,0.08) % Get property values of data get(fr_data)
response and f are variables in the MATLAB Workspace browser, representing the frequencyresponse data and frequency values, respectively.
To change property values for an existing idfrd object, use the set command or dot notation. For example, to change the name of the idfrd object, type the following command sequence at the prompt:
% Set the name of the f_data object set(fr_data,'name','DC_Converter') % Get fr_data properties and values get(fr_data)
If you import fr_data into the System Identification Tool GUI, this data has the name DC_Converter in the GUI, and not the variable name fr_data.
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 frequencydomain iddata object by
Data = iddata(Idfrdmodel)
See iddata.
Compare the results from spectral analysis and an ARMAX model.
load iddata1 z1; m = armax(z1,[2 2 2 1]); g = spa(z1) g = spafdr(z1,[],{1e3,10}) bode(g,m)