1 % Returns a scalar/matrix weights (window function) for the LPA estimates
\r
2 % function w=function_Window2D(X,Y,window,sig_wind, beta);
\r
3 % X,Y scalar/matrix variables
\r
4 % window - type of the window weight
\r
5 % sig_wind - std scaling for the Gaussian ro-weight
\r
6 % beta -parameter of the degree in the weights
\r
7 %----------------------------------------------------------------------------------
\r
8 % V. Katkovnik & A. Foi - Tampere University of Technology - 2002-2005
\r
11 function w=function_Window2D(X,Y,window,sig_wind, beta,ratio);
\r
17 IND=(abs(X)<=1)&(abs(Y)<=1);
\r
18 IND2=((X.^2+Y.^2)<=1);
\r
19 IND3=((X.^2+(Y*ratio).^2)<=1);
\r
22 if window==1 % rectangular symmetric window
\r
25 if window==2 %Gaussian
\r
29 w = IND.*exp(-(X.^2 + Y.^2)/2); %*(abs(Y)<=0.1*abs(X));%.*IND2; %((X.^2+Y.^2)<=1);
\r
32 if window==3 % Quadratic window
\r
33 w=(1-(X.^2+Y.^2)).*((X.^2+Y.^2)<=1); end
\r
35 if window==4 % triangular symmetric window
\r
36 w=(1-abs(X)).*(1-abs(Y)).*((X.^2+Y.^2)<=1); end
\r
39 if window==5 % Epanechnikov symmetric window
\r
40 w=(1-X.^2).*(1-Y.^2).*((X.^2+Y.^2)<=1);
\r
43 if window==6 % Generalized Gaussian
\r
47 w = exp(-((X.^2 + Y.^2).^beta)/2).*((X.^2+Y.^2)<=1); end
\r
54 w = exp(-abs(X) - abs(Y)).*IND; end
\r
56 if window==8 % Interpolation
\r
58 w=(1./(abs(X).^4+abs(Y).^4+0.0001)).*IND2;
\r
61 if window==9 % Interpolation
\r
63 NORM=(abs(X)).^2+(abs(Y)).^2+0.0001;
\r
64 w=(1./NORM.*(1-sqrt(NORM)).^2).*(NORM<=1);
\r
74 temp=asin(Y./sqrt(X.^2+Y.^2+eps));
\r
75 temp=temp*0.6; % Width of Beam
\r
76 temp=(temp>0)*min(temp,1)+(temp<=0)*max(temp,-1);
\r
78 w=max(0,IND.*cos(pi*temp));
\r
87 temp=asin(Y./sqrt(X.^2+Y.^2+eps));
\r
88 temp=temp*0.8; % Width of Beam
\r
89 temp=(temp>0)*min(temp,1)+(temp<=0)*max(temp,-1);
\r
91 w=max(0,IND3.*(cos(pi*temp)>0));
\r
92 % w=((X.^2+Y.^2)<=1);
\r
97 temp=atan(Y/(X+eps));
\r
98 %temp=temp*0.8; % Width of Beam
\r
99 %temp=(temp>0)*min(temp,1)+(temp<=0)*max(temp,-1);
\r
100 w=max(0,IND3.*((abs(temp))<=pi/4));
\r
101 % w=((X.^2+Y.^2)<=1);
\r