| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → System Identification Toolbox |
| Contents | Index |
| Learn more about System Identification Toolbox |
| On this page… |
|---|
The idfrd represents complex frequency-response data. Before you can create an idfrd object, you must import your data as described in Importing Frequency-Response Data into MATLAB.
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 sampling 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 kth output, input, and frequency value, respectively, is interpreted as the complex-valued frequency response from input ku to output ky at frequency f(kf).
Note When you work at the command line, you can only create idfrd objects from complex values of G(eiw). For a SISO system, response can be a vector. |
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)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 frequency-response 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 frequency-response data and frequency values, respectively.
MATLAB returns the following object properties and values:
ans =
Name: ''
Frequency: [100x1 double]
ResponseData: [1x1x100 double]
SpectrumData: []
CovarianceData: []
NoiseCovariance: []
Units: 'rad/s'
Ts: 0.0800
InputDelay: 0
EstimationInfo: [1x1 struct]
InputName: {'u1'}
OutputName: {'y1'}
InputUnit: {''}
OutputUnit: {''}
Notes: []
UserData: []
For a complete description of all idfrd object properties, see the idfrd reference page or type idprops idfrd at the prompt.
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)
Property names are not case sensitive. You do not need to type the entire property name if the first few letters uniquely identify the property.
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.
MATLAB returns the following object properties and values:
ans =
Name: 'DC_Converter'
Frequency: [100x1 double]
ResponseData: [1x1x100 double]
SpectrumData: []
CovarianceData: []
NoiseCovariance: []
Units: 'rad/s'
Ts: 0.0800
InputDelay: 0
EstimationInfo: [1x1 struct]
InputName: {'u1'}
OutputName: {'y1'}
InputUnit: {''}
OutputUnit: {''}
Notes: []
UserData: []You can reference specific data values in the idfrd object using the following syntax:
fr_data(outputchannels,inputchannels)
Reference specific channels by name or by channel index.
For example, the following command references frequency-response data from input channel 3 to output channel 2:
fr_data(2,3)
You can also access the data in specific channels using channel names. To list multiple channel names, use a cell array. For example, to retrieve the power output, and the voltage and speed inputs, use the following syntax:
fr_data('power',{'voltage','speed'})To retrieve only the responses corresponding to frequency values between 200 and 300, use the following command:
fr_data_sub = fselect(fr_data,[200:300])
You can also use logical expressions to subreference data. For example, to retrieve all frequency-response values between frequencies 1.27 and 9.3 in the idfrd object fr_data, use the following syntax:
fr_data_sub = fselect(fr_data,fr_data.f>1.27&fr_data.f<9.3)
Note You do not need to type the entire property name. In this example, f in fr_data.f uniquely identifies the Frequency property of the idfrd object. |
The horizontal and vertical concatenation of idfrd objects combine information in the ResponseData properties of these objects. ResponseData is an ny-by-nu-by-nf array that stores the response of the system, where ny is the number of output channels, nu is the number of input channels, and nf is a vector of frequency values (see idfrd Properties).
The following syntax creates a new idfrd object data that contains the horizontal concatenation of data1,data2,...,dataN:
data = [data1,data2,...,dataN]
data contains the frequency responses from all of the inputs in data1,data2,...,dataN to the same outputs. The following diagram is a graphical representation of horizontal concatenation of frequency-response data. The (j,i,:) vector of the resulting response data represents the frequency response from the ith input to the jth output at all frequencies.

Note Horizontal concatenation of idfrd objects requires that they have the same outputs and frequency vectors. If the output channel names are different and their dimensions are the same, the concatenation operation uses the names of output channels in the first idfrd object. Input channels must have unique names. |
The following syntax creates a new idfrd object data that contains the vertical concatenation of data1,data2,...,dataN:
data = [data1;data2;... ;dataN]
The resulting idfrd object data contains the frequency responses from the same inputs in data1,data2,...,dataN to all the outputs. The following diagram is a graphical representation of vertical concatenation of frequency-response data. The (j,i,:) vector of the resulting response data represents the frequency response from the ith input to the jth output at all frequencies.

Note Vertical concatenation of idfrd objects requires that they have the same inputs and frequency vectors. If the input channel names are different and their dimensions are the same, the concatenation operation uses the names of input channels in the first idfrd object you listed. Output channels must have unique names. |
When the idfrd objects contain the frequency-response data you measured or constructed manually, the concatenation operation combines only the ResponseData properties. Because the noise spectrum data does not exist (unless you also entered it manually), SpectrumData is empty in both the individual idfrd objects and the concatenated idfrd object.
However, when the idfrd objects are spectral models that you estimated, the SpectrumData property is not empty and contains the power spectra and cross spectra of the output noise in the system. For each output channel, the toolbox estimates one noise channel to explain the difference between the output of the model and the measured output.
When the SpectrumData property of individual idfrd objects is not empty, horizontal and vertical concatenation handle SpectrumData, as follows.
In case of horizontal concatenation, there is no meaningful way to combine the SpectrumData of individual idfrd objects and the resulting SpectrumData property is empty. An empty property results because each idfrd object has its own set of noise channels, where the number of noise channels equals the number of outputs. When the resulting idfrd object contains the same output channels as each of the individual idfrd objects, it cannot accommodate the noise data from all the idfrd objects.
In case of vertical concatenation, the toolbox concatenates individual noise models diagonally. The following shows that data.SpectrumData is a block diagonal matrix of the power spectra and cross spectra of the output noise in the system:

s in data.s is the abbreviation for the SpectrumData property name.
The following operations also create idfrd objects:
Transforming iddata objects. For more information, see Transforming Between Frequency-Domain and Frequency-Response Data.
Estimating nonparametric models using etfe, spa, and spafdr. For more information, see Identifying Frequency-Response Models.
Converting the Control System Toolbox frd object. For more information, see Using Models with Control System Toolbox Software.
![]() | Representing Time- and Frequency-Domain Data Using iddata Objects | Analyzing Data Quality | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |