www.pudn.com > tfarma10.rar > plot_tfar.m, change:2004-06-28,size:7072b


function plot_tfar(MAR0, LAR0, N0, re_im, fig)
% function plot_tfar(MAR0, LAR0, N0, re_im, fig)
%   This file is part of the TFPM toolbox v1.0 (c)
%   michael.jachan@tuwien.ac.at and underlies the GPL.
% 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MAR0= 3;
LAR0= 2;
N0= 256;

plot_tfar(MAR0, LAR0, N0, 'i', 1)

clear;tfpm;
re_im= 'i';
%n= 6;N= 2^n;
%MAR= 1;
%LAR= 1;
fig= 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

exp= 'tfar';

nmin= 6;
MARmin= 1;
LARmin= 1;

nmax= 9;
MARmax= 5;
LARmax= 3;

style= ['- '; ': '; '-.'; '--'; '- '];

if(0)
% Check for presence of files;)
for n= nmax:-1:nmin;N= 2^n;
   for MAR= MARmax:-1:MARmin
      for LAR= LARmax:-1:LARmin
         resultname= sprintf('data/%04d/%s%d%d%s.mat', N, exp, MAR, LAR, re_im)
         load(resultname)
      end;
   end;
end;
end;

%esti= size(EInfo, 1);
esti= 8


filename= sprintf('/users/mjachan/tex/prj/TF/figures/tfar%02d%02d%02d%1s', MAR0, LAR0, log2(N0), re_im);

figure(fig);clf;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot MSE/VAR/BIQ over N:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSEn= [];
VARn= [];
BIQn= [];
for n= nmin:nmax;N= 2^n;
   resultname= sprintf('data/%04d/%s%d%d%s.mat', N, exp, MAR0, LAR0, re_im)
   load(resultname);
   MSEnee= [];
   VARnee= [];
   BIQnee= [];
   for ee= 1:esti
      MSEnee= [MSEnee; sum(sum(MSE(:, :, 1, ee)))/sum(sum(abs(par).^2))];
      VARnee= [VARnee; sum(sum(VAR(:, :, 1, ee)))/sum(sum(abs(par).^2))];
      BIQnee= [BIQnee; sum(sum(BIQ(:, :, 1, ee)))/sum(sum(abs(par).^2))];
   end;
   MSEn= [MSEn MSEnee];
   VARn= [VARn VARnee];
   BIQn= [BIQn BIQnee];
end;

MAXn= max(max([MSEn VARn BIQn]));
MAXn= ceil(10*MAXn)/9.5;

subplot(3, 3, 1);cla;hold on
for ee= 1:esti
   plot(MSEn(ee, :), 'Linewidth', 2, 'Linestyle', deblank(style(ee, :)), 'Color', 'k')
end;
if(nmax~=nmin)
   axis([1 nmax-nmin+1 0 MAXn]);
   box;grid
end;
set(gca, 'XTick', 1:nmax-nmin+1)
set(gca, 'XTicklabel', 2.^(nmin:nmax))
ylabel('MSE')
%xlabel('N')
title(sprintf('M0= %d, L0= %d', MAR0, LAR0));

subplot(3, 3, 4);cla;hold on
for ee= 1:esti
   plot(VARn(ee, :), 'Linewidth', 2, 'Linestyle', deblank(style(ee, :)), 'Color', 'k')
end;
if(nmax~=nmin)
   axis([1 nmax-nmin+1 0 MAXn]);
   box;grid
end;
set(gca, 'XTick', 1:nmax-nmin+1)
set(gca, 'XTicklabel', 2.^(nmin:nmax))
ylabel('VAR')
%xlabel('N')

subplot(3, 3, 7);cla;hold on
for ee= 1:esti
   plot(BIQn(ee, :), 'Linewidth', 2, 'Linestyle', deblank(style(ee, :)), 'Color', 'k')
end;
if(nmax~=nmin)
   axis([1 nmax-nmin+1 0 MAXn]);
   box;grid
end;
set(gca, 'XTick', 1:nmax-nmin+1)
set(gca, 'XTicklabel', 2.^(nmin:nmax))
ylabel('BIQ')
xlabel('N')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot MSE/VAR/BIQ over MAR:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSEmar= [];
VARmar= [];
BIQmar= [];
for MAR= MARmin:MARmax;
   resultname= sprintf('data/%04d/%s%d%d%s.mat', N0, exp, MAR, LAR0, re_im)
   load(resultname);
   MSEnee= [];
   VARnee= [];
   BIQnee= [];
   for ee= 1:esti
      MSEnee= [MSEnee; sum(sum(MSE(:, :, 1, ee)))/sum(sum(abs(par).^2))];
      VARnee= [VARnee; sum(sum(VAR(:, :, 1, ee)))/sum(sum(abs(par).^2))];
      BIQnee= [BIQnee; sum(sum(BIQ(:, :, 1, ee)))/sum(sum(abs(par).^2))];
   end;
   MSEmar= [MSEmar MSEnee];
   VARmar= [VARmar VARnee];
   BIQmar= [BIQmar BIQnee];
end;

MAXmar= max(max([MSEmar VARmar BIQmar]));
MAXmar= ceil(10*MAXmar)/9.5;

subplot(3, 3, 2);cla;hold on
for ee= 1:esti
   plot(MSEmar(ee, :), 'Linewidth', 2, 'Linestyle', deblank(style(ee, :)), 'Color', 'k')
end;
if(MARmax~=MARmin)
   axis([1 MARmax-MARmin+1 0 MAXmar]);
   box;grid
end;
set(gca, 'XTick', 1:MARmax-MARmin+1)
set(gca, 'XTicklabel', MARmin:MARmax)
%ylabel('MSE')
%xlabel('M')
title(sprintf('N0= %d, L0= %d', N0, LAR0));

subplot(3, 3, 5);cla;hold on
for ee= 1:esti
   plot(VARmar(ee, :), 'Linewidth', 2, 'Linestyle', deblank(style(ee, :)), 'Color', 'k')
end;
if(MARmax~=MARmin)
   axis([1 MARmax-MARmin+1 0 MAXmar]);
   box;grid
end;
set(gca, 'XTick', 1:MARmax-MARmin+1)
set(gca, 'XTicklabel', MARmin:MARmax)
%ylabel('VAR')
%xlabel('M')

subplot(3, 3, 8);cla;hold on
for ee= 1:esti
   plot(BIQmar(ee, :), 'Linewidth', 2, 'Linestyle', deblank(style(ee, :)), 'Color', 'k')
end;
if(MARmax~=MARmin)
   axis([1 MARmax-MARmin+1 0 MAXmar]);
   box;grid
end;
set(gca, 'XTick', 1:MARmax-MARmin+1)
set(gca, 'XTicklabel', MARmin:MARmax)
%ylabel('BIQ')
xlabel('M')

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot MSE/VAR/BIQ over LAR:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MSElar= [];
VARlar= [];
BIQlar= [];
for LAR= LARmin:LARmax;
   resultname= sprintf('data/%04d/%s%d%d%s.mat', N0, exp, MAR0, LAR, re_im)
   load(resultname);
   MSEnee= [];
   VARnee= [];
   BIQnee= [];
   for ee= 1:esti
      MSEnee= [MSEnee; sum(sum(MSE(:, :, 1, ee)))/sum(sum(abs(par).^2))];
      VARnee= [VARnee; sum(sum(VAR(:, :, 1, ee)))/sum(sum(abs(par).^2))];
      BIQnee= [BIQnee; sum(sum(BIQ(:, :, 1, ee)))/sum(sum(abs(par).^2))];
   end;
   MSElar= [MSElar MSEnee];
   VARlar= [VARlar VARnee];
   BIQlar= [BIQlar BIQnee];
end;

MAXlar= max(max([MSElar VARlar BIQlar]));
MAXlar= ceil(10*MAXlar)/9.5;

subplot(3, 3, 3);cla;hold on
for ee= 1:esti
   plot(MSElar(ee, :), 'Linewidth', 2, 'Linestyle', deblank(style(ee, :)), 'Color', 'k')
end;
if(LARmax~=LARmin)
   axis([1 LARmax-LARmin+1 0 MAXlar]);
   box;grid
end;
set(gca, 'XTick', 1:LARmax-LARmin+1)
set(gca, 'XTicklabel', LARmin:LARmax)
%ylabel('MSE')
%xlabel('L')
title(sprintf('N0= %d, M0= %d', N0, MAR0));

subplot(3, 3, 6);cla;hold on
for ee= 1:esti
   plot(VARlar(ee, :), 'Linewidth', 2, 'Linestyle', deblank(style(ee, :)), 'Color', 'k')
end;
if(LARmax~=LARmin)
   axis([1 LARmax-LARmin+1 0 MAXlar]);
   box;grid
end;
set(gca, 'XTick', 1:LARmax-LARmin+1)
set(gca, 'XTicklabel', LARmin:LARmax)
%ylabel('VAR')
%xlabel('L')

subplot(3, 3, 9);cla;hold on
for ee= 1:esti
   plot(BIQlar(ee, :), 'Linewidth', 2, 'Linestyle', deblank(style(ee, :)), 'Color', 'k')
end;
if(LARmax~=LARmin)
   axis([1 LARmax-LARmin+1 0 MAXlar]);
   box;grid
end;
set(gca, 'XTick', 1:LARmax-LARmin+1)
set(gca, 'XTicklabel', LARmin:LARmax)
%ylabel('BIQ')
xlabel('L')

legend(EInfo(1:esti, :))

print('-depsc2', filename);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if(0)% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;tfpm;
for MAR0= 1:3
   for LAR0= 1:3
      for n0= 6:7
	 plot_tfar(MAR0, LAR0, 2^n0, 'r', 1);
         plot_tfar(MAR0, LAR0, 2^n0, 'i', 2);
      end
   end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end;% TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%