Documentation

## Spectrum Normalization

The spectrum of a signal is the square of the Fourier transform of the signal. The spectral estimate using the commands `spa`, `spafdr`, and `etfe` is normalized by the sample time T:

`${\Phi }_{y}\left(\omega \right)=T\sum _{k=-M}^{M}{R}_{y}\left(kT\right){e}^{-iwT}{W}_{M}\left(k\right)$`

where WM(k) is the lag window, and M is the width of the lag window. The output covariance Ry(kT) is given by the following discrete representation:

`${\stackrel{^}{R}}_{y}\left(kT\right)=\frac{1}{N}\sum _{l=1}^{N}y\left(lT-kT\right)y\left(lT\right)$`

Because there is no scaling in a discrete Fourier transform of a vector, the purpose of T is to relate the discrete transform of a vector to the physically meaningful transform of the measured signal. This normalization sets the units of ${\Phi }_{y}\left(\omega \right)$ as power per radians per unit time, and makes the frequency units radians per unit time.

The scaling factor of T is necessary to preserve the energy density of the spectrum after interpolation or decimation.

By Parseval's theorem, the average energy of the signal must equal the average energy in the estimated spectrum, as follows:

`$\begin{array}{l}E{y}^{2}\left(t\right)=\frac{1}{2\pi }{\int }_{-\pi /T}^{\pi /T}{\Phi }_{y}\left(\omega \right)d\omega \\ S1\equiv E{y}^{2}\left(t\right)\\ S2\equiv \frac{1}{2\pi }{\int }_{-\pi /T}^{\pi /T}{\Phi }_{y}\left(\omega \right)d\omega \end{array}$`

To compare the left side of the equation (`S1`) to the right side (`S2`), enter the following commands. In this code, `phiy` contains ${\Phi }_{y}\left(\omega \right)$ between $\omega =0$ and $\omega =\pi }{T}$ with the frequency step given as follows:

`$\left(\frac{\pi }{T\cdot \text{length(phiy)}}\right)$`

`load iddata1`

Create a time-series iddata object.

`y = z1(:,1,[]);`

Define sample interval from the data.

`T = y.Ts;`

Estimate the frequency response.

`sp = spa(y);`

Remove spurious dimensions

`phiy = squeeze(sp.spec);`

Compute average energy of the signal.

`S1 = sum(y.y.^2)/size(y,1)`
```S1 = 19.4646 ```

Compute average energy from the estimated energy spectrum, where S2 is scaled by T.

`S2 = sum(phiy)/length(phiy)/T`
```S2 = 19.2076 ```

Thus, the average energy of the signal approximately equals the average energy in the estimated spectrum.