


Purpose: -To determine the window size for order statistics filtering of a signal. The determination of the window size is based on the work of Bhuiyan et al. Inputs: -Two 1D extrema maps Outputs: -Calculated value of the window size Written by Mruthun Thirumalaisamy Graduate Student Department of Aerospace Engineering University of Illinois at Urbana-Champaign March 30 2018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


0001 function window_size = filter_size1D(imax, imin) 0002 % 0003 % Purpose: 0004 % -To determine the window size for order statistics filtering of a signal. 0005 % The determination of the window size is based on the work of Bhuiyan et 0006 % al. 0007 % 0008 % Inputs: 0009 % -Two 1D extrema maps 0010 % 0011 % Outputs: 0012 % -Calculated value of the window size 0013 % 0014 % Written by Mruthun Thirumalaisamy 0015 % Graduate Student 0016 % Department of Aerospace Engineering 0017 % University of Illinois at Urbana-Champaign 0018 % March 30 2018 0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0020 0021 edge_len_max = diff(imax); 0022 edge_len_min = diff(imin); 0023 0024 0025 %Window size calculations 0026 0027 d1 = min( min(edge_len_max) , min(edge_len_min) ); 0028 d2 = max( min(edge_len_max) , min(edge_len_min) ); 0029 d3 = min( max(edge_len_max) , max(edge_len_min) ); 0030 d4 = max( max(edge_len_max) , max(edge_len_min) ); 0031 d5 = (d1+d2+d3+d4)/4 ; 0032 0033 %making sure w_size is an odd integer 0034 window_size = 2*(floor(d4/2))+1; 0035 0036 if(window_size<3) 0037 warning('WARNING: Calculated Window size less than 3\n '); 0038 warning('Overriding calculated value and setting window size = 3'); 0039 window_size = 3; 0040 end 0041 0042 0043 0044 0045