## 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}(\omega )=T{\displaystyle \sum _{k=-M}^{M}{R}_{y}}(kT){e}^{-iwT}{W}_{M}(k)$$

where *W _{M}(k)* is
the lag window, and

*M*is the width of the lag window. The output covariance

*R*is given by the following discrete representation:

_{y}(kT)$${\widehat{R}}_{y}(kT)=\frac{1}{N}{\displaystyle \sum _{l=1}^{N}y(lT-kT)y(lT)}$$

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}(\omega )$$ 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}(t)=\frac{1}{2\pi}{\displaystyle {\int}_{-\pi /T}^{\pi /T}{\Phi}_{y}}(\omega )d\omega \\ S1\equiv E{y}^{2}(t)\\ S2\equiv \frac{1}{2\pi}{\displaystyle {\int}_{-\pi /T}^{\pi /T}{\Phi}_{y}}(\omega )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}(\omega )$$ between $$\omega =0$$ and $$\omega ={\scriptscriptstyle \raisebox{1ex}{$\pi $}\!\left/ \!\raisebox{-1ex}{$T$}\right.}$$ 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.