| System Identification Toolbox | ![]() |
nk and InputDelay
What's the difference between the properties nk and InputDelay? InputDelay is defined for all idmodel and idfrd objects, while nk is defined for idarx and idpoly as well as for 'Free' and 'Canonical' idss models. Both properties indicate a delay from the input channels to the outputs. For idarx, nk is a matrix describing the delays in the different input/output channels, but otherwise both nk and InputDelay describe the delay from a certain input channel to all the output channels.
InputDelay is really a flag that tells the model to append the input delays as time lags when the model is simulated, or as phase lags when the frequency functions are computed. The InputDelay does not show up when the model is represented in state-space form, nor as transfer functions, nor in the input-output polynomials. InputDelay can be used both for continuous- and discrete-time models. In the latter case, the InputDelay is measured in number of samples. Moreover, InputDelay can assume negative values in order to handle noncausal models.
The property nk, on the other hand, is a model structure property, requiring the model to contain the indicated number of delays whatever the parameter values. This means that the state-space matrices, the transfer functions, etc., will show these delays in an explicit manner. Consequently, nk is not defined for continuous-time models. (Other than as a flag for free and canonical state-space models whether a D matrix is included (nk = 0) or set to zero (nk = 1).)
Otherwise the two properties can be used in the same way.
gives identical bode plots (up to minor variations due to end effects in the data records), while A1 and A2 are different. In fact while A1 is of size 4-by-4, the matrix A2 is of size 7-by-7, because three extra states are required to accommodate the extra 2+1 input delays.
For continuous-time data, nk can only be used to flag whether a D matrix should be included in a state-space model. Any real delays must be handled by InputDelay.
Df= fft(Dt) Df.Ts = 0: % Bandlimited data m = oe(Df.[1 3],'udel',5); % 5 seconds delay in estimated model
If you build a continuous-time model from discrete-time data, you could use
This will build estimate a preliminary model with a delay of 5 samples (using n4sid), which is then converted to continuous time, where the time delays are taken care of by InputDelay. The pem iterations are then carried out for this continuous-time model.
Note that setting nk to a certain value for a given model gives a model structure that has the indicated delay for any parameter values. The impulse response of the model might however change (not only be shifted) by this assignment.
| No Covariance | Linear Regression Models | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |