%function [dl,dr] = mkdfrv(d,blk,diml,dimr)
function [dl,dr] = mkdfrv(d,blk,diml,dimr)
 [nblk,dum] = size(blk);
 dl = zeros(diml); dr = zeros(dimr);
 pl = 1; pr = 1; loc = 1;
 for i=1:nblk
   if blk(i,2) == 0
     tmp = zeros(blk(i,1),blk(i,1));
     for j=1:blk(i,1)
       tmp(j,:) = d(loc:loc+blk(i,1)-1);
       loc = loc + blk(i,1);
     end
     plp = pl + blk(i,1) - 1; prp = pr + blk(i,1) - 1;
     [u,s,v] = svd(tmp);
     dl(pl:plp,pl:plp) = v*s*v';
     dr(pr:prp,pr:prp) = v*s*v';
     pl = plp + 1; pr = prp + 1;
   else
     plp = pl + blk(i,2) - 1; prp = pr + blk(i,1) - 1;
     dl(pl:plp,pl:plp) = eye(blk(i,2))*abs(d(loc));
     dr(pr:prp,pr:prp) = eye(blk(i,1))*abs(d(loc));
     pl = plp + 1; pr = prp + 1; loc = loc + 1;
   end
 end
%
% Copyright MUSYN INC 1991,  All Rights Reserved
