DSPRelated.com
Forums

Need advice - Generating LUT

Started by Mr.Bilou October 17, 2005
Hello All

Due to a lack of memory space , I'm trying to compute my Look-up table 
at startup.
My target is a 16bits fixed point DSP (TI C54x). I need 16 bits  sinus 
table

I first try Taylor interpolation, but did not succeed. (May be this is 
best method, but if so, i should use 32 bits precision)
I already implement floating point operation, and will try in this 
way.

What other approximation could I use ?

Since this table will be initialized at startup, speed time ist not a 
constraint.

Thank you for your advice.


Mr.Bilou wrote:
> Hello All > > Due to a lack of memory space , I'm trying to compute my Look-up table > at startup. > My target is a 16bits fixed point DSP (TI C54x). I need 16 bits sinus > table > > I first try Taylor interpolation, but did not succeed. (May be this is > best method, but if so, i should use 32 bits precision) > I already implement floating point operation, and will try in this > way. > > What other approximation could I use ? > > Since this table will be initialized at startup, speed time ist not a > constraint. > > Thank you for your advice.
You did not say how large the table has to be. What I sometimes do is store tables up in the extended program memory space of the 'C54X and copy them down to data memory as needed. Depending on what processor version you are using, you might have significant *program* memory available up there. John
I have used the 28x family of processors, which has a sine table
embedded in the bootrom already.  In response to your question, I
became curious as to wether or not the C54 family has the table built
in too, so I did a seach on Ti's web page and picked the first C54
device on the list.  According to the boot rom documentation, the
device has a 256 word (by 16 bit) sine table from 0 to 360 degrees
already stored in rom.

You didn't specify which device in the C54x family you are using but I
would imagine this would apply to all of them.

Thanks both for your answer

|  According to the boot rom documentation, the
| device has a 256 word (by 16 bit) sine table from 0 to 360 degrees
| already stored in rom.
|

You are right.
I totally forgot this point since i did not have access to the on-chip 
ROM (MP/MC=1).

Again, thank you





hello,

i would recommend to calculate the
whole lookup-table elsewhere, like on
a PC, in some language with a proper
sin-function and perhaps using floats
in between.
once you filled the table, just dump
all the values to some textfile, so you
can include the data-table into your
sources for the target-platform.

if you are really low on memory or want
to get more precision with less memory,
keep in mind that
sin(x) = -sin(x - 180) for x between 180 and 360
and
sin(x) = sin(180 - x) for x between 90 and 180

so you can get on only by storing values
from 0 to 90 degrees dont really need to use
a sign bit.


hope it helps,

carsten neubauer
http://www.c14sw.de/
http://www.edcomponents.com/

cn@c14sw.de wrote:
> hello, > > i would recommend to calculate the > whole lookup-table elsewhere, like on > a PC, in some language with a proper > sin-function and perhaps using floats > in between. > once you filled the table, just dump > all the values to some textfile, so you > can include the data-table into your > sources for the target-platform. > > if you are really low on memory or want > to get more precision with less memory, > keep in mind that > sin(x) = -sin(x - 180) for x between 180 and 360 > and > sin(x) = sin(180 - x) for x between 90 and 180 > > so you can get on only by storing values > from 0 to 90 degrees dont really need to use > a sign bit. > > > hope it helps, > > carsten neubauer > http://www.c14sw.de/ > http://www.edcomponents.com/
I didn't really understand why the OP needed to compute it on the fly, unless he has run out of room in his nonvolatile program storage area. John
>
| I didn't really understand why the OP needed to compute it on the fly, | unless he has run out of room in his nonvolatile program storage area.| That's exactly the reason why.
Mr.Bilou wrote:
> Hello All > > Due to a lack of memory space , I'm trying to compute my Look-up table > at startup. > My target is a 16bits fixed point DSP (TI C54x). I need 16 bits sinus > table > > I first try Taylor interpolation, but did not succeed. (May be this is > best method, but if so, i should use 32 bits precision) > I already implement floating point operation, and will try in this > way. > > What other approximation could I use ?
You could try to generate the sine table with an oscillator. You'll find lot's in the archives about how to do this.