idfrd - Frequency-response data or model

Syntax

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)

Description

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 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 uncertainty of the noise Speccov.

h = idfrd(Response,Freq,Ts,...
     'P1',V1,'PN',VN)
constructs an 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. If the linear model has an input-to-output delay, this delay is converted to a phase lag.

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

stores the transfer function estimate G

as well as the spectrum of the additive noise ( ) at the output

where is the estimated variance of e(t), and T is the sampling interval.

Creating idfrd from Given Responses

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 sampling interval. T = 0 means a continuous-time model.

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 information about spectrum is optional. The format 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. Normally, no information is included about the covariance of the nondiagonal spectrum elements.

If only SpectrumData is to be packaged in the idfrd object, set Response = [].

Creating idfrd from a Given Model

idfrd can also be computed from a given model mod (defined as any idmodel object).

If the frequencies Freqs are not specified, a default choice is made based on the dynamics of the model mod.

If mod has InputDelay different from zero, these are appended as phase lags, and h will then have an InputDelay of 0.

The estimated covariances are computed using the Gauss approximation formula from the uncertainty information in mod. For models with complicated parameter dependencies, numerical differentiation is applied. The step sizes for the numerical derivatives are determined by nuderst.

Frequency responses for submodels can be obtained by the standard subreferencing, h = idfrd(m(2,3)). See idmodel. In particular, h = idfrf(m('measured')) gives an h that just contains the ResponseData (G) and no spectra. Also h = idfrd(m('noise')) gives an h that just contains SpectrumData.

The idfrd models can be graphed with bode, ffplot, and nyquist, which all accept mixtures of idmodel and idfrd models as arguments. Note that spa, spafdr, and etfe return their estimation results as idfrd objects.

idfrd Properties

Note that you can set or retrieve all properties either with the set and get commands or by subscripts. Autofill applies to all properties and values, and these are case insensitive:

h.ts = 0
loglog(h.fre,squeeze(h.spe(2,2,:)))

For a complete list of property values, use get(m). To see possible value assignments, use set(m). See also idprops idfrd.

Subreferencing

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'}).

h('m') 

contains the information for measured inputs only, that is, just ResponseData, while

h('n')

('n' for 'noise') just contains SpectrumData.

Horizontal Concatenation

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.

Vertical Concatenation

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 is then set to zero.

Converting to iddata

You can convert an idfrd object to a frequency-domain iddata object by

Data = iddata(Idfrdmodel)

See iddata.

Examples

Compare the results from spectral analysis and an ARMAX model.

m = armax(z,[2 2 2 1]);
g = spa(z)
g = spafdr(z,[],{0,10})
bode(g,m)

Compute separate idfrd models, one containing the frequency function and the other the noise spectrum.

g = idfrd(m('m'))
phi = idfrd(m('n'))

See Also

bode 
etfe 
ffplot 
freqresp 
nyquist 
spa 
spafdr 

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS