{{<figuresrc="/ox-hugo/siso_identification_schematic.png"caption="<span class=\"figure-number\">Figure 1: </span>Block diagram of the SISO system identification">}}
{{<figuresrc="/ox-hugo/siso_identification_schematic_simplier.png"caption="<span class=\"figure-number\">Figure 2: </span>Simpler Block diagram of the SISO system identification">}}
<divclass="note">
If the open-loop system is unstable, first design a simple controller that stabilizes the system and then identify the closed-loop system.
</div>
### Design of the Excitation Signal {#design-of-the-excitation-signal}
#### Introduction {#introduction}
There are several choices for excitation signals:
- Impulse, Steps
- Sweep Sinus
- Random noise, Periodic signals
#### Random noise with specific ASD {#random-noise-with-specific-asd}
And we want the effect of the excitation signal to be much higher than the effect of the exogenous signals (measurement noise, input noise, disturbances).
Note that \\(\Gamma\_d(\omega)\\) can be estimated by measuring the system output in the absence of any excitation signal.
The plant magnitude \\(|G(j\omega)|\\) can be roughly estimated from a first identification with bad coherence.
In order to design a random excitation signal with specific spectral characteristics, first a signal with an ASD equal to one is generated (i.e. white noise with unity ASD):
```matlab
Ts = 1e-4; % Sampling Time [s]
t = 0:Ts:10; % Time Vector [s]
%% Signal with an ASD equal to one
u_norm = sqrt(1/2/Ts)*randn(length(t), 1);
```
Then, a transfer function whose magnitude \\(|G\_u(j\omega)|\\) has the same shape as the wanted excitation ASD \\(\Gamma\_u(\omega)\\) is designed:
```matlab
%% Transfer function representing the wanted ASD
G_u = tf([1], [1/2/pi/100 1]);
```
Finally `lsim` is used to compute the shaped excitation signal.
```matlab
%% Shape the ASD of the excitation signal
u = lsim(G_u, u_norm, t);
```
#### Choose Sampling Frequency and Duration of Excitation {#choose-sampling-frequency-and-duration-of-excitation}
<divclass="important">
The sampling frequency \\(F\_s\\) will determine the maximum frequency \\(F\_{\text{max}}\\) that can be estimated (see Nyquist theorem):
\begin{equation}
F\_{\text{max}} = \frac{1}{2} F\_s
\end{equation}
</div>
<divclass="important">
The duration of excitation \\(T\_{\text{exc}}\\) will determine the minimum frequency \\(F\_{\text{min}}\\) that can be estimated:
\begin{equation}
F\_{\text{min}} = \frac{1}{T\_{\text{exc}}}
\end{equation}
It will also corresponds to the frequency resolution \\(\Delta f\\):
\begin{equation}
\Delta f = \frac{1}{T\_{\text{exc}}}
\end{equation}
</div>
In order to increase the estimation quality, averaging can be use with a longer excitation duration.
A factor 10 is usually good enough, therefore the excitation time can be taken as:
<divclass="csl-entry"><aid="citeproc_bib_item_1"></a>Pintelon, Rik, and Johan Schoukens. 2012. <i>System Identification : a Frequency Domain Approach</i>. Hoboken, N.J. Piscataway, NJ: Wiley IEEE Press. doi:<ahref="https://doi.org/10.1002/9781118287422">10.1002/9781118287422</a>.</div>
<divclass="csl-entry"><aid="citeproc_bib_item_2"></a>Schoukens, Johan, Rik Pintelon, and Yves Rolain. 2012. <i>Mastering System Identification in 100 Exercises</i>. John Wiley & Sons.</div>