Compute the frequency response and standard deviations of a theta format model.
Syntax
[g,phiv] = th2ff(th)
[g,phiv] = th2ff(th,ku,w,ky)
Description
th2ff computes the frequency functions of th, where th is a matrix in theta format containing a general model.
g is returned with the transfer function estimate (see (3.4), (3.23), and (3.25) in the Tutorial)

computed at the frequencies
given in row vector w. If th has several inputs and outputs, g is computed for the input and output numbers specified in row vectors ku and ky, respectively. The format of g is detailed under freqfunc. The default values of ku and ky are all input and output pairs contained in th.
For a time continuous model the frequency function
is obtained instead.
Phiv (
) is returned with the estimated noise spectrum for each of the outputs
where
is the estimated variance of e(t) (the loss function) specified by th. phiv is computed at the same frequencies as g. The normalization of the spectrum differs from the one used by spectrum in the Signal Processing Toolbox. See "Some Special Topics" on page 3-68 in the User's Guide, for a precise definition. Note that no cross-spectra between different outputs are computed.
The standard deviations of the frequency function(s) and the spectra are also computed, using the Gauss approximation formula. For models with complicated parameter dependencies, numerical differentiation is applied. The step sizes for the numerical derivatives are determined by nuderst.
The default values of the frequencies are in the discrete-time case are
w = [1:128]/128*pi/T
where T is the sampling interval specified by th (default = 1) and for the continuous-time case
w = logspace(log10(pi/abs(T)/100),log10(10*pi/ abs(T)),128)
where abs(T)is the "underlying" sampling interval for the continuous-time model.
The frequency functions can be graphed with bodeplot, ffplot, and
nyqplot.
Important: The command trf has the same syntax as th2ff but does not calculate the standard deviations, and can be considerably faster.
Examples
Compare the results from spectral analysis and an ARMAX model (input-output dynamics only).
th = armax(z,[2 2 2 1]);
gp = th2ff(th);
gs = spa(z);
bodeplot([gs gp])
Plot, but don't store, the frequency function g associated with th:
bodeplot(th2ff(th))
See Also
bodeplot, etfe, ffplot, nyqplot, sett, spa
[ Previous | Help Desk | Next ]