function y = soft_thresholding(x,t) % soft_thresholding -- Apply Soft Threshold, i.e. proximal operator of the (scalar) l1 norm. % Usage % y = soft_thresholding(x,t) = (1-lambda/|x|)_+*x = sign(x)(|x|-t)_+ % Inputs % x Input Data % t Threshold % y = max(0,1 - t./max(abs(x),1E-10)).*x;