cr.nimble.dsp.energy_threshold

cr.nimble.dsp.energy_threshold(signal, fraction)[source]

Keeps only as much coefficients in signal so as to capture a fraction of signal energy

Parameters
  • x (jax.numpy.ndarray) – A signal

  • fraction (float) – The fraction of energy to be preserved

Returns

A tuple comprising of:
  • Signal after thresholding

  • A binary mask of the indices to be kept

Return type

(jax.numpy.ndarray, jax.numpy.ndarray)

Note

This function doesn’t change the length of signal and can be JIT compiled

See also

hard_threshold()