Hello,

I'm quite new to DSP and am trying to implement an adaptive FIR filter for active noise cancellation on the ADZS-21369-EZLITE evaluation Board.

The desired number of coefficients is around 300. The first thing that came to my mind, was whether the processing to adapt the coefficients (using LLMS) and generate an output sample is fast enough. I've adapted the block-based talk through (C) to give my processing function one sample at a time.

Programming my algorithm straightforward (without using compiler/hardware-specific code) got me two loops. The compiler optimized the first one to have 4 cycles (trip count is half the number of coefficients-1):

[Info] This loop executes 2 iterations of the original loop in estimated 4 cycles.

[Info] Trip count = 149

and the other one is executed in 9 cycles (trip count=no. of coefficients-1)

[Info] This loop executes 1 iteration of the original loop in estimated 9 cycles.

[Info] Trip count = 299

This gives me 3287 instructions to be carried out between to samples (for my estimation I ignored the overhead). Multiplying it with the instruction cycle time (2.5ns) tells me that the generation of each output sample takes around 8,2µs. Given a sample frequency of 96kHz (2 channels, each 48kHz) means that the SPORTisr is called every 10.4µs. Enough time for my algorithm... At least in theory. Can anyone who has a better understanding of DSP confirm my estimation**?** Problem is, when I run the code (even with only 150 coefficients) it stucks in the "ProcessingTooLong" function

After running into this problem I dug deeper into the compiler manual and found the builtin-functions for fir filtering. I tried to use them for my problem but I don't know how: I get an error signal from the ADC which I use to adapt the FIR coefficients. The FIR is then applied to a sound template which is stored in the SDRAM (the noise I'm targeting is periodic about every 0.5s). My understanding is, that I apply the coefficients to the template's samples (depends on how many coefficients) and get ONE new value which I then send to the DAC. Why does the fir_vec function alter an ARRAY of output samples**?**

Please excuse any using of wrong terminology and don't hesitate to correct it . Sadly there's no DSP lecture in my studies so I have to figure everything out by myself for my master's thesis :/.

Thanks in advance,

JohnPower

Hi John,

Regarding your queries:

1. The fir_vec as name suggests is a filters a vector (input buffer) generating buffer length of outputs(used for block processing). There is a scalar version of fir function as well, which i think you need. This sample based function returns a filtered output sample for an input sample. The State[] buffer needs to be zero initialized only very first time, and later, on every fir function call, current input sample will be pushed into this buffer so that state buffer would always contain the pervious Taps-1 input samples. [Please refer VDSP run-time library Manual for more details.]

" float fir (float sample, const float pm coeffs[],float dm state[], int taps); " // scalar function

2. There was an error using the interrupt dispatcher, correct one is

interrupt(SIG_P9, DMA0_Isr); //Please refer signal.h file.

The asm(" "); codes need to be removed.

Regards,

Hemanth