www.gusucode.com > control 案例程序 matlab源码代码 > control/FrequencyDependentAttenuationProfileExample.m

    %% Frequency-Dependent Attenuation Profile
% Create a tuning requirement that enforces an attenuation factor of at
% least 100 (40 dB) below 1 rad/s, gradually  dropping to 1 (0 dB) past 10
% rad/s. The requirement applies to a disturbance entering a control system
% at a point identified as |'u'|.
%%
attfact = frd([100 100 1 1],[0 1 10 100]); 
Req = TuningGoal.Rejection('u',attfact);
%%
% These commands use a |frd| model to specify the minimum attenuation
% profile as a function of frequency. The minimum attenuation of 100 below
% 1 rad/s, together with the minimum attenuation of 1 at the frequencies of
% 10 and 100 rad/s, specifies the desired rolloff of the requirement.
%
% |attfact| is converted into a smooth function of frequency that
% approximates the piecewise specified requirement. Display the error
% requirement using |viewSpec|.
viewSpec(Req)
%%
% The yellow region indicates where the requirement is violated.