ADAU1452 nLMS coefficients write to FIR filter
I am using a nLMS filter to learn a simple but varying response and I want to apply the learned response to a parallel path. Essentially I want to apply the learned path coefficients to a parallel FIR filter. In my digging into SigmaStudio, I have not found a nLMS block that supports a parallel path sharing the nLMS coefficients. Please let me know if this exists as this would solve my issue perfectly right away.
Alternatively, I have been experimenting with the "Parameter Read" and "Parameter Update" blocks. I am attaching the .dspproj file and a screenshot of what I am viewing. I can read the coefficients from nLMS1 with the "Parameter Read" (ParamRead1) block by clicking the “read” button and I am able to see the correct coefficients reported via a “Readback Values” popup window. I would like to send these coefficients to FIR2 via a "Parameter Update" (ParamUpdate1) block but I don’t see any way of doing this. Is there a method I am missing to make the connection between the nLMS1 coefficients and the FIR2 coefficients?
Is there another way of accomplishing copying nLMS coefficients to an FIR filter besides using an external micro? I don't require the coefficient updates to be fast, 500ms and perhaps slower intervals would do.
Thanks for your time and help with this.
nLMS coeff copy to FIR.dspproj
Audio Signal Processors
adau1452
parameter_update
fir_filter
parameters
nlms
SigmaDSP Audio Processors
Parameter change
Show More
Hello unitrobe,
This is a good question. The answer is yes, but...
Transferring coefficients between FIR filters can be done in SigmaStudio but it would be difficult to do using counters and other discrete logic to transfer one memory location every sample period, then once all 256 locations are transferred, wait 256 sample periods for the filter to fill up with correct data and then change a MUX to switch over to the new filter is just super complicated to do. It can be done but I think you would end up using as many MIPS as just using two nLMS filters.
The best solution would be as you suggested, being able to grow the inputs and outputs of the filters to have parallel paths that operate using the same adapted filter coefficients. Getting this done, tested and released is not a quick solution. We do have some 3rd party developers that may be able to get involved to design a custom block just for you. But you would have to negotiate with them as far as fees are concerned.
So this leaves you with using a Micro-Controller as the only quick solution.
Dave T
Thanks for confirming my notion! I will pursue the external micro controller solution.
Hello Dave,
I was able to use the uC solution for transferring nLMS coefficients to an FIR successfully and it has worked well and is in production for a while. Now I am revisiting this for another project using the ADAU1452.
In your last reply you mentioned "Transferring coefficients between FIR filters can be done in SigmaStudio but it would be difficult...". I was wondering if you could tell me how I could transfer even one nLMS coefficient to an FIR without the intervention of an external device?
I've looked for hours at the various tools and the toolbox wiki but I haven't found a way to make an nLMS coefficient value available to the DSP to write to a new location without the use of a uC. Please let me know the trick on how to do this.
Thanks for your help!
It may be a bit hacky, but since it looks like the FIR and the nLMS use the same memory for their coefficients (both DM0), it's quite easy to patch the code generated by SigmaStudio to make the FIR directly use the nLMS coefficients. The instruction used to setup a pointer to a coefficient buffer is the two-word sequence C0000000 82xFyyyy where the x varies and the yyyy is the 16-bit address of the buffer (relative to the start of DM0/DM1). Just search for the instruction that sets up a pointer to the FIR coeffs (as a sanity-check make sure it occurs only once) and change the bottom 16 bits of the second word to the address of the nLMS coefficients.
Thanks Matthijs!
That was just enough information for me to get this working here with a small nLMS and FIR. I am so happy for pointer information you gave me otherwise I never could have gotten this to work. You are a wizard! I am going to keep testing and see how it works out.
I ended up hacking the "TxBuffer_IC_1.dat" file and updating the ADAU1452 via a micro controller. Is there any way to get this hack into the .dspproj or any other file so the hack would be persistent? I'm trying to find a way to make iteration testing shorter and avoid having to edit the .dat file ever time I make a change to the schematic.
Still this hack is way better than the alternative of having a micro transfer all the coeffs.
I am wondering what the method is that Dave Thib was referring to where the DSP could get access to the individual coeffs? Even if it is inefficient, I would still like to know how it is possible. I don't see a way to do this with anything in the DSP toolbox. Do you know how it is possible to read back a specific coeff value and expose it to the schematic?
Thanks again for your time and help.
Please log in to reply.
