function Dfrd = frd(D,freqs)
% Converts to FRD using the frequency grid FREQS (in rad/TimeUnit)

%   Copyright 1986-2010 The MathWorks, Inc.

% Compute frequency response, keeping I/O delays separate to get correct
% phase shift in Bode plots and PID tuning
Delay = D.Delay;
[ny,nu] = iosize(D);
D.Delay = ltipack.utDelayStruct(ny,nu,false);
Dfrd = ltipack.frddata(fresp(D,freqs),freqs,D.Ts);
Dfrd.Delay = Delay;
