Output power spectrum of time series models
ps = spectrum(sys,w)
[ps,w] = spectrum(sys)
[ps,w,sdps] = spectrum(sys)
an output power spectrum plot of the identified time series model
The frequency range and number of points are chosen automatically.
sys is a time series model, which represents
e(t) is a Gaussian white noise and
the observed output.
scaled by the variance of
e(t) and the sample time.
sys is an input-output model, it represents
u(t) is the measured input,
a Gaussian white noise and
y(t) is the observed
In this case,
spectrum plots the spectrum
of the disturbance component
You can specify a color, line style and marker for each model. For example:
For discrete-time models with sample time
z = exp(j*w*Ts) to map the unit
circle to the real frequency axis. The spectrum is only plotted for
frequencies smaller than the Nyquist frequency
and the default value 1 (time unit) is assumed when Ts is unspecified.
Minimum frequency of the frequency range for which the output power spectrum is plotted.
Maximum frequency of the frequency range for which the output power spectrum is plotted.
Frequencies for which the output power spectrum is plotted.
Identified systems for which the output power spectrum is plotted.
Power spectrum amplitude.
For amplitude values in dB, type
Frequency vector for which the output power spectrum is plotted.
Estimated standard deviation of the power spectrum.
Load the estimation data.
load iddata1 z1;
Estimate a single-input single-output state-space model.
sys = n4sid(z1,2);
Plot the noise spectrum for the model.
Load the time-series estimation data.
load iddata9 z9
Estimate a fourth-order AR model using a least-squares approach.
sys = ar(z9,4,'ls');
Plot the output spectrum of the model.
Create an input consisting of five sinusoids spread over the whole frequency interval. Compare the spectrum of this signal with that of its square. The frequency splitting (the square having spectral support at other frequencies) reveals the nonlinearity involved.
u = idinput([100 1 20],'sine',,,[5 10 1]); u = iddata(,u,1,'per',100); u2 = u.u.^2; u2 = iddata(,u2,1,'per',100); spectrum(etfe(u),'r*',etfe(u2),'+')