%%%%%%%%%% crmz_plerror.m %%%%%%%%%%
% plot error magnitude, real phase rotated error, 
%      error real part, error imaginary part. 
%
clf;
EE1 = EE(iext(1));
EE_pl = []; grd_pl = []; i = 1; l = 0;
while (i < (length(indx_edges)-1))
  lo = l + 1;
  l = l + length([indx_edges(i):indx_edges(i+1)]);
  grd_pl = [grd_pl;grd(lo:l);nan];
  EE_pl = [EE_pl;EE(lo:l);nan];
  i = i + 2;
end;
lo = l + 1;
l = l + length([indx_edges(i):indx_edges(i+1)]);
grd_pl = [grd_pl;grd(lo:l)];
EE_pl = [EE_pl;EE(lo:l)];
EEE_pl = [real(EE_pl * conj(EE1/abs(EE1)) )-3*abs(delta),...
abs(EE_pl), real(EE_pl)-6*abs(delta),...
imag(EE_pl)-9*abs(delta)];  %-- plottting offset
EEE = [real(EE * conj(EE1/abs(EE1)) )-3*abs(delta),...
abs(EE), real(EE)-6*abs(delta),...
imag(EE)-9*abs(delta)];  %-- plottting offset
delr = real(delta);   deli = imag(delta);
axis('auto')
plot( grd_pl, EEE_pl, '-', [grd(1), 0.5], abs(delta)*[1;1], 'w--',...
 [grd(1), 0.5], abs(delta)*[1 -1;1 -1]-3*abs(delta), 'w:',...
 [grd(1), 0.5], delr*[1 -1;1 -1]-6*abs(delta),'w:',...
 [grd(1), 0.5], deli*[1 -1;1 -1]-9*abs(delta),'w:',...
 grd(jext), EEE(jext,:), 'o', grd(iext), EEE(iext,:), '+')
V = axis;
axis([-0.5*flag 0.5 V(3) V(4)])
xlabel('normalized frequency')
title('Weighted Error: 1.magnitude  2.real-rotated  3.real part '...
'4.imag. part')
%%%%%%%%%% End crmz_plerror.m %%%%%%%%%%
