function Z0 = rndsas0(m,n,a)
% RNDSAS0 random sample generation from zero mean and unit dispersion complex circular 
%         symmetric alpha-stable distribution. The characteristic function is Phi(z) = exp(-|z|^a), and   
%         the characteristic generator is phi(u)=exp(-u^{a/2})
%
% INPUT 
% 	n, m 	size of the sample
%	a       characteristic exponent
% OUTPUT 
%   Z0          sample of size m X n S_alpha(0,1)
% 
% (c) Samuli Visuri and Esa Ollila, contact: esollila AT wooster.hut.fi
%
% If you use this program, please cite 
%    E. Ollila, J. Eriksson, V. Koivunen, "Complex univariate elliptically symmetric distribution", 
%       submitted to IEEE Transactions on Signal Processing, Dec. 2009. 
%--------------------------------------------------------------------------


Z0 = sqrt(2)*(randn(m,n)+ j*randn(m,n)); % random sample from CN(mu=0,var=2)

if a < 2
   A = stabrnd(a/2, 1, cos(pi*a/4)^(2/a), 0, m, n);
   Z0 = A.^(1/2).*Z0;
end

   
   
