Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Public Member Functions | List of all members
sbl::dsp::HysteresisQuantizer Class Reference

#include <hysteresis_quantizer.hpp>

Collaboration diagram for sbl::dsp::HysteresisQuantizer:

Public Member Functions

int process (uint16_t value, uint8_t n_steps)
 
int step () const
 Current quantized step (valid after first process() call).
 
void set_hysteresis (uint8_t h)
 Set hysteresis amount (0-255). 0 = no hysteresis, 26 ≈ 10%, 128 = 50%.
 
void reset ()
 Reset — next process() call will snap to the raw value.
 

Detailed Description

Definition at line 25 of file hysteresis_quantizer.hpp.

Member Function Documentation

◆ process()

int sbl::dsp::HysteresisQuantizer::process ( uint16_t  value,
uint8_t  n_steps 
)
inline

Process a raw value into a quantized step index.

Parameters
valueInput value (0-65535, typically from ADC or pot).
n_stepsNumber of output steps (2-256).
Returns
Step index (0 to n_steps-1).

Definition at line 31 of file hysteresis_quantizer.hpp.

◆ reset()

void sbl::dsp::HysteresisQuantizer::reset ( )
inline

Reset — next process() call will snap to the raw value.

Definition at line 81 of file hysteresis_quantizer.hpp.

◆ set_hysteresis()

void sbl::dsp::HysteresisQuantizer::set_hysteresis ( uint8_t  h)
inline

Set hysteresis amount (0-255). 0 = no hysteresis, 26 ≈ 10%, 128 = 50%.

Definition at line 78 of file hysteresis_quantizer.hpp.

◆ step()

int sbl::dsp::HysteresisQuantizer::step ( ) const
inline

Current quantized step (valid after first process() call).

Definition at line 75 of file hysteresis_quantizer.hpp.


The documentation for this class was generated from the following file: