Home > 16-Profilereconstruction > fig_16_18_step_break.m

fig_16_18_step_break

PURPOSE ^

% Fig. 15.18 page 758

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Fig. 15.18 page 758
 Robust estimation for tackling steps and break points

 Wolfgang Förstner 2014-08-06
 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. 15.18 page 758
0002 % Robust estimation for tackling steps and break points
0003 %
0004 % Wolfgang Förstner 2014-08-06
0005 % last changes: Susanne Wenzel 09/16
0006 % wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de
0007 
0008 
0009 
0010 close all
0011 clear all
0012  
0013 addpath(genpath('../General_Functions/'));
0014 addpath('Functions')
0015  
0016 
0017 %% plot settings
0018 ss = plot_init;
0019 
0020 %% set parameters
0021 
0022 % params for generating the data
0023 
0024 init_rand   = 6;                % just changes the noise, may be changed for other example
0025 Nd          = 20;               % third of length of profile
0026 N           = 3*Nd;             % total number of points
0027 dens        = 1.0;              % percentage of observations
0028 sigma_e     = 0.15;             % process noise
0029 sigma_n     = 0.9;              % observation noise
0030 Poutlier    = 0.0;              % P(outlier) - fraction of outliers
0031 Max_outlier = 25;               % max(outlier)
0032 factor = 1.0;                   % vertical scaling of true signal
0033                                 % (for changing signal to noise ratio)
0034 type_outlier = 0;               % type of outlier (0=symm, 1=asymm)
0035 
0036 % params for estimation
0037 type_robust  = [0,...           %  [0 = L1, 1 = Kraus,g_factor,w_factor]
0038                 2,...           %  g
0039                 2,...           %  w
0040                 1];             %  [0: not robust,
0041                                 %   1: only points,
0042                                 %   2: only dem,
0043                                 %   3: both]
0044                         
0045 print_type = 0;
0046 plot_type  = 0;
0047                         
0048 if type_outlier ==0
0049     Niter = 1;
0050     if type_robust(4) > 0
0051         Niter = 6;
0052     end
0053     factor_sigma = 1;
0054 else
0055     Niter = 3;
0056     if type_roubust(1) == 0
0057         factor_sigma= 8;
0058     else
0059         factor_sigma= 1;
0060     end
0061 end
0062 
0063 
0064 %% initialize random number generation by fixed seed
0065 init_rand_seed(init_rand);
0066 
0067 %% generate profile
0068 [x,y,out_in,select,xs,ys] = ...
0069     generate_step_corner(Nd,sigma_e,sigma_n,Poutlier,Max_outlier,type_outlier,dens,factor);
0070 
0071 %% reconstruct profile non robust
0072 type_robust(4) = 0;   % reconstruction non robust
0073 xest_nonrob = estimate_profile_robust...
0074     (N,select,ys,sigma_e/factor_sigma,sigma_n,Niter,type_outlier,...
0075     type_robust,print_type,plot_type);
0076 
0077 %% reconstruct profile robust
0078 type_robust(4) = 1;     % reconstruction robust, only points
0079 [xest_robust,A,v,weights] = estimate_profile_robust...
0080     (N,select,ys,sigma_e/factor_sigma,sigma_n,Niter,type_outlier,...
0081     type_robust,print_type,plot_type);
0082 
0083 %% plot
0084 figure('name','Fig. 16.18: Robust estimation for tackling steps and break points',...
0085     'color','w', 'Position',[0.1*ss(1),0.2*ss(2),0.9*ss(1),0.4*ss(2)]);
0086 
0087 subplot(2,1,1);hold on
0088 plot(1:N,x,'--r','LineWidth',2)
0089 plot(1:N,xest_nonrob,'-k','LineWidth',2)
0090 plot(1:N,ones(N,1),'-k')
0091 plot(select,ys,'.b','MarkerSize',15)
0092 plot(2:N-1,weights(end-(N-3):end)+1,'.k','Markersize',15)
0093 ylim([0,N/3+8]); xlim([0,N+1]); axis equal
0094 xlabel('$x$'); ylabel('$z$');
0095 title('Fig. 16.18a: Without robust estimation');
0096 
0097 
0098 subplot(2,1,2);hold on
0099 plot(1:N,x,'--r','LineWidth',2)
0100 plot(1:N,xest_robust,'-k','LineWidth',2)
0101 plot(1:N,ones(N,1),'-k')
0102 plot(select,ys,'.b','MarkerSize',15)
0103 plot(2:N-1,weights(end-(N-3):end)+1,'.k','Markersize',15)
0104 xlim([0,N+1]); ylim([0,N/3+8]); axis equal
0105 xlabel('$x$'); ylabel('$z$');
0106 title({'Fig. 15.18b: With robust estimation.'...
0107     ['Iterations $1$ to $3$ use the $L_{12}$-norm,'...
0108     ' iterations $4$ to $6$ use the exponential weight function']});
0109 
0110 
0111 
0112 
0113 
0114

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