MATLAB: Do the plots using the Spectrum Analyzer block in Simulink not agree with the Bode plot of a continuous system

graphplotresultssimulinkwrong

I would like to use the "Simulink Extras -> Additional Sinks -> Spectrum Analyzer" block to compute the frequency response of my Simulink model so that I can compute an equivalent linear system.
However, I see a difference between the phase response computed by the Spectrum Analyzer and the actual phase response of the system. I have connected a "Simulink -> Sources -> Band-Limited White Noise" block to the input of a "Simulink -> Continuous -> Transfer Function" block which is configured to be a first-order lag, and then the phase lag shown by the spectrum analyzer is rolling off to minus infinity instead of approaching 90 degrees as expected.

Best Answer

The discrete-time spectrum analyzer coupled with a discrete-time input is not well suited to the task of identification of a continuous-time system.
If instead of using a white noise input, a continuous chirp signal is used, the spectrum analyzer shows a better approximation of the transfer function. This is because a discrete-time white noise signal is sampled and held (ZOH) when it is passed as an input to a continuous transfer function. Therefore, the output signal is the same as the output of the transfer function for a continuous white noise passed through the equivalent ZOH transfer function. Hence the spectrum of the output signal is not the same as when a continuous time white noise signal is fed to a continuous time transfer function. In essence in the above case the spectrum analyzer is displaying the frequency response of a ZOH and a first order continuous time transfer function connected in series. The ZOH causes a roll off in the phase.
There are several products which are better suited than the Spectrum Analyzer block for obtaining a linear estimate of a non-linear Simulink model.
First, Simulink has the ability to linearize a model. This can be done with functions such as LINMOD, LINMOD2, etc... For more information, execute the following command at the MATLAB prompt:
doc linmod
or visit the following URL:
Second, Simulink Control Design is an add-on to Simulink which has enhanced linearization features and includes the Simulink Control Design GUI. More information is available at the following URL:
Finally, there is the System Identification toolbox which allows you to retrieve system parameters based on measured input and output. More information is available at the following URL: