function Dfrd = frd(D,freqs)
% Converts to ltipack.frddata.

%   Copyright 1986-2010 The MathWorks, Inc.
if nargin==1
   IC = D.IC;   freqs = IC.Frequency;
else
   IC = frd(D.IC,freqs);
end
if isempty(D.Blocks)
   % Preserve I/O delays
   Dfrd = IC;
else
   DB = ltipack_frddata(D.Blocks,freqs);
   [ny1,nu1] = iosize(IC);
   [ny2,nu2] = iosize(DB);
   % Close LFT
   Dfrd = lft(IC,DB,nu1-ny2+1:nu1,ny1-nu2+1:ny1,1:nu2,1:ny2);
end
