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

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