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

%   Copyright 2020 The MathWorks, Inc.

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