Adaptive filters

XCore Project reviews, ideas, videos and proposals.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Adaptive filters

Post by lilltroll »

Version: 0.1
Status: Under development
License: Custom Licence
Download: https://github.com/lilltroll77/sc_adapt_filt

** This project has moved to github **
This LMS example can be run with the XDE console only, but it uses UART to send data to MATLAB on the host for a much more complete analysis.
The project has restarted to have a slow but proven XC solution and therreafter to have fast ASM solutions.
Images:


Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

The first step is to implement a FIR filter of length N.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

I have implemented the "double-sized coefficient" structure for FIR-filters. This one I wrote my self for training without google, checking the ASM trace i believe that I probably could avoid one instruction.
Have compared it with the 'optimal' way of writing it found on the net, so it up for some further tuning.

But at least it runs over 10 miljon tamps / second on one thread including streaming channels to other threads.
I do not remberer exacly but without special FIR-hardware, you need about 7*N+C instructions for N-taps on a TI-DSP written the optimal way in ASM excluding communication.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

There must be 2 ADD and 2 LoadWord between each MACS.
Sometimes also a check that the last filter-tap has not been passed - every N:th tap.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Created a NLMS filter in MATLAB and used it on real (for the task relevant) Audio-data. Time to port it to XC.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

I'm writing a MATLAB program that can take a DUT Device under Test , to check if the total XMOS system is working without errors.
It feeds the XMOS inputs and records the XMOS outputs - finally it compares the result with MATLABs own functions and dispalys the amount of error in the output signal.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Both my MATLAB simulator and the adaptive XMOS filter is working now - the function of the adaptation is verified in the simulator.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

A linear feedforward FXLMS adaptive filter is working distributed over 3 threads. All thread intercommunication is based on streaming channels in this version. Very easy to implement - but I will compare the maximum taps/s if I use references to RAM instead.
The (correct) behaviour of the XMOS-FXLMS was verified in the MATLAB simulator.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Made a Leaky one as well and tried it on a channel with a rapidly changing transferfunction.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Resampling based on 10:th order Elliptic Minimum-phase filters are proven to work, and checked in the simulator. Its time to connect all theads together and thereafter it's time to try it out for real, outside the simulator.
Probably not the most confused programmer anymore on the XCORE forum.
Post Reply