Example Code for FIR

All technical discussions and projects around startKIT
DSPguy
Junior Member
Posts: 7
Joined: Sat Mar 04, 2017 3:47 pm

Example Code for FIR

Postby DSPguy » Fri Nov 10, 2017 9:28 am

Hello everybody,
I am new to the field of DSP Processing and I'd like to implement a FIR Filter on the startKIT with the Audio Expansion Board.

Does anyone have an example code which does an FIR Filter? I already calculated the coefficients for it but I am not a programmer so it would be great to see how an implementation could look like. Number of taps doesn't matter for now.

Thanks in advance!

Matt
User avatar
infiniteimprobability
XCore Expert
Posts: 874
Joined: Thu May 27, 2010 10:08 am
Contact:

Postby infiniteimprobability » Mon Nov 13, 2017 4:17 pm

lib_dsp has a fir example in it - https://github.com/xmos/lib_dsp/blob/ma ... _filters.c

FIR tends to get written quite a lot as making it super efficient can depend on how many taps you need (fixing that to say a multiple of 12 is good due to addressing modes). You'll find FIR implementations in lib_src and lib_mic_array too..

Most of these implementations rely on the double load and store (2 x 32 coeffs or data) and loop unrolling to get to approaching 2 cycles per tap. Normally there is a saturate and extract at the end to get back to 32b from the 64b accumulator

Return to “startKIT”

Who is online

Users browsing this forum: No registered users and 5 guests