Skip to main content

PermutationEntropyEstimator

Struct PermutationEntropyEstimator 

Source
pub struct PermutationEntropyEstimator<const W: usize> { /* private fields */ }
Expand description

Permutation Entropy (PE) estimator for order m=3 (six ordinal patterns).

§Theoretical Basis: Bandt & Pompe (2002)

PE measures the complexity of a time series by examining the rank-order (ordinal) structure of consecutive m-tuples, completely ignoring amplitude. This critical property makes PE significantly more robust to measurement noise than Shannon entropy on amplitude histograms (Zanin et al. 2012 §III).

PE is uniquely powerful for RF diagnostics because cyclostationary jammers and low-power periodic structures produce ordinal patterns with a decidedly non-uniform distribution — detectable even at −20 dB SNR where amplitude distributions are indistinguishable from thermal noise.

Normalized PE ∈ [0, 1]:

  • 0.0: maximally ordered — single pattern dominates (strong periodic structure)
  • 1.0: maximally disordered — uniform over 3! = 6 patterns (pure AWGN)

§References

  • Bandt, C. & Pompe, B. (2002). “Permutation entropy: A natural complexity measure for time series.” Phys. Rev. Lett. 88(17):174102.
  • Zanin, M. et al. (2012). “Permutation entropy and its main biomedical and econophysics applications.” Entropy 14(8):1553–1577.
  • Manis, G. et al. (2017). “Bubble entropy: An entropy almost free of parameters.” IEEE Trans. Biomed. Eng. 64(11):2711–2718.

§Design

  • no_std, no_alloc, zero unsafe
  • Fixed circular window of W norm values
  • O(W) PE computation per query (query is optional; push is O(1))
  • m = 3 is optimal for RF residual analysis (Manis et al. 2017)

Implementations§

Source§

impl<const W: usize> PermutationEntropyEstimator<W>

Source

pub const fn new() -> Self

Create a new estimator (all zeros).

Source

pub fn push(&mut self, norm: f32) -> PermEntropyResult

Push a new norm observation. Returns the current PE result.

Source

pub fn compute(&self) -> PermEntropyResult

Compute normalized PE from all valid values in the window.

Scans all consecutive triplets (W − 2 patterns when full). Returns PermEntropyRegime::Insufficient if fewer than 3 values.

Source

pub fn reset(&mut self)

Reset the estimator.

Trait Implementations§

Source§

impl<const W: usize> Default for PermutationEntropyEstimator<W>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.