39 downsample_factor_ = downsample_factor;
47 bitcrush_factor_ = bitcrush_factor;
48 bits_to_crush_ = (uint32_t)(bitcrush_factor * kMaxBitsToCrush);
50 = 2.0f - (bitcrush_factor * 16.0f) + (
float)(bits_to_crush_);
58 bits_to_crush_ = bits <= kMaxBitsToCrush ? bits : kMaxBitsToCrush;
59 smooth_crushing_ =
false;
67 smooth_crushing_ = smooth_crushing;
84 const uint8_t kMaxBitsToCrush = 16;
85 float downsample_factor_, bitcrush_factor_;
86 uint32_t bits_to_crush_;
87 float downsampled_, bitcrushed_;
88 uint32_t inc_, threshold_;
89 bool smooth_crushing_;
Definition decimator.h:20
void SetSmoothCrushing(bool smooth_crushing)
Definition decimator.h:65
int GetBitsToCrush()
Definition decimator.h:81
void SetDownsampleFactor(float downsample_factor)
Definition decimator.h:37
float GetBitcrushFactor()
Definition decimator.h:78
bool GetSmoothCrushing()
Definition decimator.h:72
void SetBitcrushFactor(float bitcrush_factor)
Definition decimator.h:45
void SetBitsToCrush(const uint8_t &bits)
Definition decimator.h:56
float GetDownsampleFactor()
Definition decimator.h:75
float Process(float input)
Definition decimator.cpp:17
void Init()
Definition decimator.cpp:5
FIR Filter implementation, generic and ARM CMSIS DSP based.
Definition adenv.h:16