Home > 16-Surface-Reconstruction > Profile-Reconstruction > fig_16_16_plot_weight_functions_asymmetric.m

fig_16_16_plot_weight_functions_asymmetric

PURPOSE ^

% Fig. 16.16 page 756

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

% Fig. 16.16 page 756
 compare weight functions for a/symmetric outliers

 Wolfgang Förstner 08/14
 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.16 page 756
0002 % compare weight functions for a/symmetric outliers
0003 %
0004 % Wolfgang Förstner 08/14
0005 % last changes: Susanne Wenzel 09/16
0006 % wfoerstn@uni-bonn.de, wenzel@igg.uni-bonn.de
0007 
0008 close all
0009 
0010 
0011 addpath(genpath('../../General-Functions'));
0012 
0013 %% plot settings
0014 ss = plot_init;
0015 
0016 %% set parameters
0017 
0018 % resolution
0019 MK = 1000;
0020 M = 50;
0021 k = 1;                % critical value
0022 g = 2*k;              % g-parameter for Kraus (taken negative)
0023 w = 2*k;              % w-parameter for Kraus
0024 
0025 % set plot range
0026 vK = -5:10/(MK-1):5;   % for Kraus
0027 v =  -5:10/(M-1):5;    % others
0028 
0029 %% determine Kraus' weight functions
0030 weights = zeros(MK,1);
0031 for m = 1:MK
0032     
0033     if vK(m) < g-w
0034         weights(m) = 0;
0035         
0036     elseif vK(m) > g
0037         weights(m) = 0.985;
0038         
0039     else
0040         weights(m) = 0.985/(1+(vK(m)-g)^4);
0041         
0042     end
0043 end
0044 w_kraus=weights;
0045 
0046 %% determine asymmetric L_1 weight function
0047 weights = max( min( 1,1./abs(v(1:M))/k+0.0001 ),...
0048                ( (sign(v(1:M))/k)+1 )/2 ...
0049            );
0050 w_L1 = weights;
0051 
0052 x = vK;
0053 y = w_kraus';
0054 rangeX = max(x) - min(x);
0055 rangeY = max(y) - min(y);
0056 Q = [diff(x) / rangeX; diff(y) / rangeY];
0057 L = [0, cumsum(sqrt(sum(Q .* Q)))];
0058 L = (length(L) / L(end)) * L;
0059 a = 1;  % start point
0060 b = 10; % gap width
0061 c = 60; % gap frequency
0062 index  = rem(round(L) + a, c) <= b;
0063 
0064 %% plot
0065 figure('name','Fig. 16.16 Weight functions for outliers','color','w',...
0066     'Position',[0.2*ss(1),0.2*ss(2),0.4*ss(1),0.4*ss(2)]);
0067 hold on
0068 %plot(v,w_kraus,'--r','LineWidth',4)
0069 %dashline(v,w_kraus,10,2,10,2,'color','r','LineWidth',4)
0070 plot(v,w_L1,'-b','LineWidth',6)
0071 plot(v,min(0.985,0.95./abs(v(1:M))/k+0.0001)-0.003,'.k','MarkerSize',20)
0072 
0073 yDashed = y;
0074 yDashed(index) = NaN;
0075 plot(x, yDashed,'color','r','LineWidth',6);
0076 
0077 xlim([-5,5])
0078 ylim([-0.003,1.05])
0079 title('Fig. 16.16: weight functions for a/symmetric outliers')
0080 xlabel('$y$');ylabel('$w$');
0081

Generated on Sat 21-Jul-2018 20:56:10 by m2html © 2005