Hi
The setup
I am working on a prototype for a one channel feedforward active noise cancellation. I am using the C5517EVM.
I have been adviced to use the following code:
- The audio codec example: "McBSP_Master_AIC3204_48kbps_DMA" from the Chip support library
- The dlmsfast function from the DSP library
The problem
But I have run into problems using the dlmsfast function. The block diagram below is refered to in the following text.
1. Issue: The error microphone will measure e(n). But dlmasfast expects to get d(n) as input. But I can calculate d(n), so no problem.
2. Issue: The algoritm does not seem to work when it decrease the buffer size of input (x(n)) and output (y(n)) to 2 samples.
The reasion for using a buffer size of 2 is (ideally one):
- The LMS algorithm uses the error e(n) as input
- For every input sample new filter coefficients are calculated
- The new calculated coefficients affects the value of the e(n)
- So I cannot process N input samples using N samples of e(n), because I cannot predict e(n). e(n) depends on the filter adaption from previous iteration.
Using abuffer size of 2, the dmsfast function did not update the dbuffer with the old input values, it only saved two values and the circular buffer index remained zero all the time. In order for the LMS algorithm to function, it needs to save a number previous input values that equals the number of coefficients in the FIR filter.
I tried to update the circular buffer index from the code, but I still got incorrect results.
A more thorough documentation of dlmsfast would be great.I cannot deduce from the documentation if updating the dbuffer is handled by the dlmsfast function or if it should be addressed by the application code. I speculate if the input/output buffer length is required to be longer than the number of coefficients.
The questions
Can someone help me with the above described problems using dlmsfast?
Maybe there is a better DSP library function for active noise cancellation? If so can anyone recommend a better one?
Any help will be appreciated.