ΣSigmaStudio Ask AI Русский Log in

ADAU1452 HexArray format in compiler XML output

SigmaDSP & SigmaStudio Reini Apr 28, 2020 00:00 4 replies Original on forum ↗
Thread Summary

Thread Summary

The user is implementing FIR filters on an ADAU1452 DSP and notices that the coefficients are stored in reverse order in the DSP memory and in the _PARAM.h file. The final answer confirms this behavior and explains that the starting address corresponds to the last coefficient. The user should reverse the coefficient array when loading coefficients from external tools like RePhase or mds.com to match the DSP's expected format.
AI Generated Content
Subscribe
Reini Question
Apr 28, 2020 00:00

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

FIR-5-taps-table.PNG
FIR-5-taps-table.PNG
FIR-5-taps-xml.PNG
FIR-5-taps-xml.PNG
FIR-5-taps-PARAM.PNG
FIR-5-taps-PARAM.PNG
ADIApproved Reply
Jun 10, 2020 00:00

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

ADIApproved Reply
Jun 15, 2020 00:00

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

INSANE Reply
Jan 2, 2022 00:00

Hi All! i am not undestand why SS not converting FIR coefficients to <data> in "<ModuleParameter>" in XML file

can i fix it?

pastedimage1641125375255v1.png
pastedimage1641125375255v1.png
Harishgowtham Reply
Jan 6, 2022 00:00

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