I have enhanced this repo. The realtime FIR filter code is unchanged but I've added non-realtime code for processing an array of samples acquired using adc.read_timed(). It uses the inline assembler for performance with the STM FPU being employed to provide floating point processing.
It can perform circular or linear convolution with optional decimation. Coefficients may be in time order (correlation) or reverse time order (convolution). FIR filtering can use coefficients derived from the TFilter web application.
Results can be scaled and copied back to the sample array for in-place processing.
An example is provided which uses correlation to locate the time of arrival of an expected signal buried in noise.
Fast filter routines: FIR, correlation, convolution, decimation
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Fast filter routines: FIR, correlation, convolution, decimation
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.