%% Custom roll-off specification
% Create a tuning goal that constrains the response from a signal 'du' to a signal 'u' to roll off at 20 dB/decade at frequencies greater than 1. The tuning goal also specifies disturbance rejection (maximum gain of 1) in the frequency range [0,1].

gmax = frd([1 1 0.01],[0 1 100]);
Req = TuningGoal.Gain('du','u',gmax);

%
% These commands use a frd model to specify the gain profile as a function of frequency. The maximum gain of 1 dB at the frequency 1 rad/s, together with the maximum gain of 0.01 dB at the frequency 100 rad/s, specifies the desired rolloff of 20 dB/decade.
% The software converts  gmax into a smooth function of frequency that approximates the piecewise specified requirement. Display the gain profile using viewGoal.

viewGoal(Req)

% The dashed line shows the gain profile, and the region indicates where the requirement is violated.
% Copyright 2012 The MathWorks, Inc.