# Documentation

## Create Chirp Input Signals

### Create Chirp Signals Using Linear Analysis Tool

This example shows how to create a chirp input signal based upon a linearized model using the Linear Analysis Tool.

1. Obtain a linearized model, `linsys1`.

For example, see Linearize Simulink Model at Model Operating Point, which shows how to linearize a model.

2. In the Linear Analysis Tool, in the Estimation tab, in the Input Signal drop-down list, select Chirp.

The Create chirp input dialog box opens.

3. In the System list, select `linsys1`. Click .

The software automatically selects frequency points based on the dynamics of `linsys1`. The software also automatically determines other parameters of the chirp signal, including:

• frequency range at which the linear system has interesting dynamics (see the From and To boxes of Frequency Range).

• amplitude.

• sample time. To avoid aliasing, the Nyquist frequency of the signal is five times the upper end of the frequency range, $\frac{2\pi }{5*\mathrm{max}\left(FreqRange\right)}$.

• number of samples.

• initial phase.

• sweep method

• sweep shape.

4. Click to create the chirp input signal. A new input signal `in_chirp1` appears in the Linear Analysis Workspace.

### Create Chirp Signals Using MATLAB Code

Create a chirp signal in the most efficient way using a linear model that accurately represents your system dynamics:

`input = frest.Chirp(sys)`

`sys` can be the linear model you obtained using exact linearization techniques. You can also define a linear system based on your insight about the system using the `tf`, `zpk`, and `ss` commands.

For example, create a chirp signal from a linearized model:

```magball io(1) = linio('magball/Desired Height',1); io(2) = linio('magball/Magnetic Ball Plant',... 1,'output'); sys = linearize('magball',io); input = frest.Chirp(sys)```

The `input` signal is:

``` FreqRange : [0.0578598408615998 10065.3895573969] (rad/s) Amplitude : 1e-005 Ts : 0.00012484733494616 (sec) NumSamples : 1739616 InitialPhase : 270 (deg) FreqUnits (rad/s or Hz): rad/s SweepMethod(linear/ : linear quadratic/ logarithmic)```

You can plot your input signal using `plot(input)`.

For more information about chirp signal properties, see the `frest.Chirp` reference page.

The mapping between the parameters of the Create chirp input dialog box in the Linear Analysis Tool and the options of `frest.Chirp` is as follows:

Create chirp input dialog box`frest.Chirp` option
Frequency range > From First element associated with the `'FreqRange'` option
Frequency range > ToSecond element associated with the `'FreqRange'` option
Amplitude`'Amplitude'`
Sample time (sec)`'Ts'`
Number of samples`'NumSamples'`
Initial phase (deg)`'InitialPhase'`
Sweep method`'SweepMethod'`
Sweep shape`'Shape'`