Home > 16-Profilereconstruction > fig_16_9_demo_profile_reconstruction.m

fig_16_9_demo_profile_reconstruction

PURPOSE ^

% Fig. 16.9 page 740

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Fig. 16.9 page 740
 demo profile smoothing 

 Wolfgang Förstner 2014-10-07
 last changes: Susanne Wenzel 09/16
 wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %% Fig. 16.9 page 740
0002 % demo profile smoothing
0003 %
0004 % Wolfgang Förstner 2014-10-07
0005 % last changes: Susanne Wenzel 09/16
0006 % wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de
0007 
0008 addpath('Functions')
0009 
0010 close all
0011 
0012 %% plot settings
0013 ss = plot_init;
0014 figure('name','Fig. 16.9: Profile smoothing','color','w',...
0015     'Position',[0.2*ss(1),0.2*ss(2),0.5*ss(1),0.5*ss(2)]);
0016 
0017 %% set parameters
0018 N = 45;
0019 factor_sigma = 1.5;    % factor for displying std of estimated profile
0020 Niter = 0;
0021 type_robust = zeros(4,1);
0022 print_type = 0;
0023 plot_type  = 0;
0024 
0025 %% generate point
0026 xs = [15,20,25,30]';
0027 zs = [-1.8,-2,2,0]'*2.5;
0028 out_in = [0,0,0]';
0029 
0030 %% reconstruct profile flat
0031 sigma_e = 1.0;    % process noise
0032 sigma_n = 0.25;   % observation noise
0033 
0034 [zest,x1,x2,x3,Cov] = estimate_profile_robust_flat...
0035     (N,xs,zs,sigma_e,sigma_n,Niter,0,type_robust,print_type);
0036 
0037 subplot(2,2,1); hold on
0038 plot(1:N,zest,'-k','LineWidth',2)
0039 plot(xs,zs,'.b','MarkerSize',20)
0040 axis equal
0041 title('flat reconstruction')
0042 xlim([5,50]);ylim([-20,15])
0043 
0044 
0045 %% show precision
0046 subplot(2,2,3); hold on
0047 plot(xs,zs,'.b','MarkerSize',15)
0048 plot(1:N,zest,'-k','LineWidth',2)
0049 plot(1:N,zest+3*factor_sigma*sqrt(diag(Cov)),'-r','LineWidth',1)
0050 plot(1:N,zest-3*factor_sigma*sqrt(diag(Cov)),'-r','LineWidth',1)
0051 title(['blow up factor for $\sigma_z = ',num2str(factor_sigma),'$'])
0052 axis equal; xlim([5,50]); ylim([-20,15]);
0053 
0054 
0055 %% reconstruct profile smooth
0056 sigma_e = 1.0;     % process noise
0057 sigma_n = 0.25;    % observation noise
0058 
0059 [zest,A,ver,weights,Cov] = estimate_profile_robust...
0060     (N,xs,zs,sigma_e,sigma_n,Niter,0,type_robust,print_type,plot_type);
0061 
0062 subplot(2,2,2);hold on;
0063 plot(1:N,zest,'-k','LineWidth',2)
0064 plot(xs,zs,'.b','MarkerSize',20)
0065 title('smooth reconstruction')
0066 axis equal;xlim([5,50]);ylim([-20,15]);
0067 
0068 %% show precision
0069 subplot(2,2,4);hold on;
0070 plot(xs,zs,'.b','MarkerSize',20)
0071 plot(1:N,zest,'-k','LineWidth',2)
0072 plot(1:N,zest+3*factor_sigma*sqrt(diag(Cov)),'-r','LineWidth',1)
0073 plot(1:N,zest-3*factor_sigma*sqrt(diag(Cov)),'-r','LineWidth',1)
0074 title(['blow up factor for $\sigma_z = ',num2str(factor_sigma),'$'])
0075 axis equal; xlim([5,50]);ylim([-20,15]);
0076 
0077

Generated on Mon 19-Sep-2016 01:11:04 by m2html © 2005