
function X = laplacian_deviates(n,m,lambda)
% SYNOPSIS generates n x m iid samples of laplacian pdf
%   p(x;lambda) = (lambda/2) exp{-lambda|x|} w/ lambda > 0

U = rand(n,m); % iid samples of uniform dist on (0.0,1.0)
E = -log(U)/lambda;  % exponenetially distributed, x > 0 w/ p(x) = lambda exp{ - lambda x }
S = sign(randn(n,m));  % iid +1/-1 bernoulli w/ P(+1)=P(-1)=0.5
X = S .* E;  % laplacian samples w/ p(x) = (lambda/2) exp{ - lambda |x| } for all real x
