3 unstable releases
0.5.1 | Sep 20, 2023 |
---|---|
0.4.1 | Sep 5, 2023 |
0.4.0 | Apr 18, 2023 |
#760 in Embedded development
14KB
253 lines
cic-fixed
A CIC filter implementation for fixed point numbers.
Implemented for use in converting PDM to PCM.
WIP
- CIC decimation filter
- CIC interpolation filter
no_std
cic-fixed works with no_std by default. No setup is needed.
lib.rs
:
cic-fixed
A CIC filter implementation for fixed point numbers.
Implemented for use in converting PDM to PCM.
Example
use cic_fixed::CicDecimationFilter;
let mut filter = CicDecimationFilter::<4, 2>::new();
let result = filter.process_sample(&0);
assert!(result.is_none());
let result = filter.process_sample(&1);
assert!(result.is_none());
let result = filter.process_sample(&2);
assert!(result.is_none());
let result = filter.process_sample(&3);
assert!(result.is_some());
assert_eq!(result.unwrap(), 10);