ADAU1452 HexArray format in compiler XML output
Hello all,
I use the xml-file which is generated by SigmaStudio to create an update file for our product which includes an ADAU1452 DSP and a microcontroller, connected with a I2C bus. In this DSP, FIR filters are implemented and the microcontroller reads the FIR coefficients from an external eeprom and writes them into the DSP. So far, no troubles :-)
To write the FIR coefficients into the right places in the DSP, I include the _PARAM.h file (which is also generated by the SigmaStudio compiler) in the microcontroller program, to obtain the various I2C addresses of the used DSP components (cells). Both the xml file and the _PARAM.h file give me a I2C starting address of a FIR filter, say 2350. But this seems to be the last coefficient of the fir filter. Is that correct?
When I create a 5-tap fir filter in Sigma Studio and hit the 'Table' button of the cell, and enter '1', '2', '3', '4' and '5' as coeffcient 1,2,3,4 and 5, they are stored reversed in both the xml data node and in the _PARAM.h header file:
entered in Sigma Studio
XML file snippet:
and in the headerfile:
You can see, the array elements are a reversed representation of the coefficients entered in SigmaStudio.
That is no problem, but what if I load a coefficient table, generated with a tool like RePhase, or the one downloaded from mds.com Do I have to reverse the coefficient array of these tools too? It does not seem so (I tested a few fir filyer designs), but, if not, why is the order of entered coefficients (in Sigma Studio) reversed by the compiler in it's output?
With kind regards,
Reini
Edit Notes
'a external' replaced by 'an external'
[edited by: Reini at 2:21 PM (GMT 0) on 28 Apr 2020]
Audio Signal Processors
adau1452
reverse
SigmaDSP Audio Processors
fir
Hello Reini,
The FIR filter algorithm for ADAU1452 stores coefficients in reverse order in the DSP memory. You are exactly correct that the starting address in memory is the last coefficient of the FIR filter.
Joshua
Reini,
The Wiki page for FIR filter is now updated with example microcontroller code.
https://wiki.analog.com/resources/tools-software/sigmastudio/toolbox/filters/firfilter
Joshua
Hi All! i am not undestand why SS not converting FIR coefficients to <data> in "<ModuleParameter>" in XML file
can i fix it?
Hello Insane,
Actually SigmaStudio has converted it and truncated it.so you ended up getting zeroes.
Here you are converting a high precision and very small floating point numbers to a fixed point number (finite precision).Actually it is running out of precisions.You cannot represent 1.94661303925561e-22 to a 8.24 format fixed point number.
when you convert this(1.94661303925561e-22) exponent number to decimal(8.24 format).You will get 0.000000000000000000000194661303925561 as a decimal number.
It cannot be represented in 8.24 format.So you ended up getting only zeroes.
If you use small precision numbers(In a consideration of 8.24 format) as a coefficient of the filter then you will be able to get the data in that xml file.
Regards,
Harish
Please log in to reply.
