Fast filter routines: FIR, correlation, convolution, decimation

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Fast filter routines: FIR, correlation, convolution, decimation

Post by pythoncoder » Fri Mar 30, 2018 12:19 pm

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.
Peter Hinch
Index to my micropython libraries.

Post Reply