From ControlTheoryPro.com

In Stochastic Controls there are essentially two parts to a frequency domain analysis. First, the disturbance and noise PSDs causing system error. Second, the system response. The system response is typically represented using a transfer function or statespace model.
In order to do a frequency domain analysis you must construct a frequency domain model (using transfer functions or statespace equations) to represent the system components. These components typically include
 the plant or system to be controlled,
 the feedback sensors, and
 the controller or compensator.
These component models must then be connected to form the
 open loop,
 closed loop, and
 disturbance rejection system models.
Then a standard disturbance PSD is applied to disturbance rejection model in order to determine residual error based on the disturbance at the plant's output. The influence of the noise PSD must be determined using the closed loop model. The 2 results are then RSS'd together determine the residual system error. This is fairly straight forward (if a little tedious) for simple SISO systems.
Even for simple SISO systems there are a few implementation issues to be aware of:
 The frequency vector of the PSD must be in the same units as the frequency vector of the system model.
 The elements of both the PSD and system model frequency vectors must be identical and the vectors must be the same size.
 The system model magnitude must be a raw magnitude for system response (to PSD) calculation  not in dB.
 MATLAB's bode command requires all frequency vector arguments be in rad/sec not Hz.
There are other implementation issues as well as these. All of the implementation issues are fiarly simple and straight forward to correct. However, it gets tedious fixing these issues for every analysis of every system since most real world systems are MIMO not SISO. Often the MIMO can be broken up into multiple decoupled SISO systems but then you have to add code or calls to helper function for each of these SISO models generated form the original MIMO.