Skip to content
Oakfield Operator Calculus Function Reference Site

Thresholding

For threshold τ\tau and scalar xx,

Tτ(x)={0,x<τ,x,xτT_{\tau}(x) = \begin{cases} 0, & x < \tau,\\[4pt] x, & x \ge \tau \end{cases}

Variants include:

  • hard thresholding to a constant level (e.g. xτ1xτx\mapsto \tau\,\mathbf{1}_{x\ge \tau}),
  • soft (shrinkage) thresholding Sτ(x)=sgn(x)max(xτ,0)S_{\tau}(x) = \operatorname{sgn}(x)\max(|x|-\tau,0).

Domain: real numbers (extendable componentwise). For the definition above, the codomain is {0}[τ,)\{0\}\cup[\tau,\infty).


Idempotent. For τ0\tau\ne 0 it is discontinuous at x=τx=\tau (a jump from 00 to τ\tau); for τ=0\tau=0 it reduces to the ReLU map and is continuous but not differentiable at the origin.

Soft-thresholding SτS_\tau is continuous and 11-Lipschitz (non-expansive), and is commonly used when stability under perturbations is desired.


As τ\tau \to -\infty, thresholding becomes the identity; as τ\tau \to \infty, it maps all values to 00.


  • τ\tau\to-\infty approaches identity.
  • τ\tau\to\infty maps everything to 00.

Clamping enforces two-sided bounds; gain control can be applied after thresholding to rescale retained components.


Oakfield uses thresholding mainly as a “gate” on features and diagnostics:

  • Phase feature extraction (phase_feature operator) suppresses samples with magnitude below threshold before writing features.
  • Phase coherence diagnostics ignore samples below a magnitude gate derived from configured absolute/relative thresholds before computing coherence order parameters.
  • Operator logic commonly uses small epsilons/thresholds to avoid division by zero (e.g. when forming unit directions like z/zz/|z|).

Thresholding is the simplest nonlinear sparsification primitive and appears in denoising and compressed representations as a hard “keep/drop” rule.

It is used when exact sparsity or strict cutoffs are desired; smooth surrogates are often used when differentiability is required.


  • Mallat, A Wavelet Tour of Signal Processing