# cra

Estimate impulse response using input/output data prewhitening before correlation analysis

## Syntax

## Description

The `cra`

command estimates a single-input, single-output
impulse response from time-domain data by first prewhitening the data and then computing the
covariance and cross-correlation functions. An alternative to `cra`

is
`impulseest`

, which uses a high-order FIR model to estimate the impulse response,
and which may return better results. `impulseest`

also handles MIMO
data.

estimates
the SISO impulse response for the time-domain data `ir`

=cra(`data`

)`data`

, which can be
in the form of a `timetable`

, comma-separated pair of numeric
matrices, or `iddata`

object.

`cra`

estimates the impulse response by first estimating an
autoregressive model with which to prewhiten the data and, after prewhitening, computing,
and scaling the cross-correlation function between the input and output data. For more
information about the computation sequence, see Algorithms.

If `data`

is a timetable that contains more than two variables, you
must select a single input channel and single output channel to use for estimation by
specifying the channel names in the `InputName`

and
`OutputName`

name-value arguments. You must also use the
`OutputName`

argument if `data`

contains only two
variables but the output data is in the first variable rather than the second
variable.

uses additional model options specified by one or more name-value arguments. `sys`

= cra(___,`Name,Value`

)

For example, specify the input and output signal variable names using ```
sys =
cra(data,'InputName',"u1",'OutputName',"y1")
```

.

You can use this syntax with any of the previous input-argument combinations.

## Examples

## Input Arguments

## Output Arguments

## Algorithms

The `cra`

command estimates the impulse response by performing the
following steps:

Compute an autoregressive model for the input

*u*as $$A(q)u(t)=e(t)$$, where*e*is uncorrelated (white) noise,*q*is the time-shift operator, and*A*(*q*) is a polynomial of order`na`

.Filter both

*u*and the output*y*with*A*(*q*) to obtain the prewhitened data.Compute the covariance functions of the prewhitened

*u*and*y*data and the cross-correlation function between them.Plot the functions with 99% confidence levels.

Scale the correlation function to correspond to an impulse of height 1/

*T*and duration*T*, where`T`

is the sample time of the data, so that the scaled function represents an estimate of the system impulse response, and return this function in the`ir`

output argument.

Positive values of the lag variable correspond to an influence from
*u* to later values of *y*. In other words, significant
correlation for negative lags is an indication of feedback from *y* to
*u* in the data. The first entry of the impulse response
`ir`

corresponds to lag zero. `ir`

excludes negative
lags.

## Version History

**Introduced before R2006a**

## See Also

`impulse`

| `step`

| `impulseest`

| `spa`