IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
How to calculate x^(4/3)
encai
post Mar 5 2002, 10:36
Post #1





Group: Members
Posts: 17
Joined: 5-March 02
Member No.: 1445



Hi, all
I am doing a Fixed-point AAC decoder and have
some questions:
1. how to calculate pow(x, 4.0/3.0) for x = 0, 1, ..., 8191
2. what does DRC stand for in AAC decoder.
3. where can I find some info. for Fixed-point implementation
of AAC decoder, such as paper, precision info. and so on.

regards

encai
:confused:
Go to the top of the page
+Quote Post
sam
post Mar 5 2002, 12:26
Post #2





Group: Members
Posts: 75
Joined: 19-January 02
Member No.: 1086



1. how to calculate pow(x, 4.0/3.0) for x = 0, 1, ..., 8191

What about a look up table? Be quicker and you can tune the results how you wish. I can provide the answeres for you to any number of dp.
Go to the top of the page
+Quote Post
encai
post Mar 5 2002, 12:58
Post #3





Group: Members
Posts: 17
Joined: 5-March 02
Member No.: 1445



QUOTE
Originally posted by sam
1. how to calculate pow(x, 4.0/3.0) for x = 0, 1, ..., 8191 

What about a look up table? Be quicker and you can tune the results how you wish. I can provide the answeres for you to any number of dp.


Thanks a lot for fast reply.
A look up table is really a solution for it, but the table size
is so large...
and a small size table can not satisfy the precison request
for a AAC decoder...
Any more advice is very appreciated.

regards
Go to the top of the page
+Quote Post
sam
post Mar 5 2002, 13:37
Post #4





Group: Members
Posts: 75
Joined: 19-January 02
Member No.: 1086



Yeah, guess it depends what your developing it for. I just assumed a PC prog, and 8192 double precisson numbers (64 bit) is about 64K.
Go to the top of the page
+Quote Post
Gabriel
post Mar 5 2002, 14:07
Post #5


LAME developer


Group: Developer
Posts: 2950
Joined: 1-October 01
From: Nanterre, France
Member No.: 138



First of all, be carefull because in layer3 the max value is 8207 and not 8192.

A common solution is to use only a small table of let's say 1026 values

if i <1026 then direct lookup
if i >1025 then i = i/8, then lookup, then i = i*16

This involves only lookups and shiftings so it's quite fast, and reduces a lot the table size
Go to the top of the page
+Quote Post
sam
post Mar 5 2002, 14:41
Post #6





Group: Members
Posts: 75
Joined: 19-January 02
Member No.: 1086



But wont there be a bit of round off error in the i /= 8 operation?
Go to the top of the page
+Quote Post
encai
post Mar 6 2002, 01:28
Post #7





Group: Members
Posts: 17
Joined: 5-March 02
Member No.: 1445



Hi, guys! Thank you for your advice.
I am doing a prog. for DSP, So even a 8K table is
too large for me.
Go to the top of the page
+Quote Post
Gabriel
post Mar 6 2002, 11:04
Post #8


LAME developer


Group: Developer
Posts: 2950
Joined: 1-October 01
From: Nanterre, France
Member No.: 138



A 8k table is probably too big, but with my proposal you only have a 4k table (assuming you're using 32bits fixed-point).

In any way you'll have to find another way than real computation of pow(4/3), as this is too much expensive for dsp.


Perhaps it should also be possible to not compute this at all. After all, for decoding you have to compute this power after Huffman decoding, so perhaps it could be directly included into this decoding.
Go to the top of the page
+Quote Post
smack
post Mar 6 2002, 11:42
Post #9





Group: Members
Posts: 187
Joined: 16-January 02
Member No.: 1046



I had also encountered the problem of pow(x,4/3) computation when I implemented a Layer 3 decoder for a DSP. After testing some approximation calculations which took too much computing power and were not accurate enough I simply used a full (8K) lookup table.
Btw. what DSP are you using? I managed to implement a MPEG-1 layer 3 decoder (including the 8K table) on a Motorola DSP with a total of 32 KWords of memory.
(source codes available under GNU GPL ;-)
Go to the top of the page
+Quote Post
Gabriel
post Mar 6 2002, 11:53
Post #10


LAME developer


Group: Developer
Posts: 2950
Joined: 1-October 01
From: Nanterre, France
Member No.: 138



<mode="source code hunter">
Where could I find this source code?
<mode="regular">
Go to the top of the page
+Quote Post
encai
post Mar 6 2002, 12:01
Post #11





Group: Members
Posts: 17
Joined: 5-March 02
Member No.: 1445



QUOTE
Originally posted by Gabriel
Perhaps it should also be possible to not compute this at all. After all, for decoding you have to compute this power after Huffman decoding, so perhaps it could be directly included into this decoding.

More info. in details please!
It is so exciting to avoid such calculation.
Go to the top of the page
+Quote Post
encai
post Mar 6 2002, 12:08
Post #12





Group: Members
Posts: 17
Joined: 5-March 02
Member No.: 1445



QUOTE
Originally posted by smack
I had also encountered the problem of pow(x,4/3) computation when I implemented a Layer 3 decoder for a DSP. After testing some approximation calculations which took too much computing power and were not accurate enough I simply used a full (8K) lookup table.


Did you use a sigle-precision table(16bit)?
was it accurate enough?

QUOTE
Btw. what DSP are you using? I managed to implement a MPEG-1 layer 3 decoder (including the 8K table) on a Motorola DSP with a total of 32 KWords of memory.
(source codes available under GNU GPL ;-)

I am using TI's 16 bit fixed-point DSP.
BTW: where can I find your code.
Go to the top of the page
+Quote Post
smack
post Mar 6 2002, 12:45
Post #13





Group: Members
Posts: 187
Joined: 16-January 02
Member No.: 1046



The Motorola DSP has 24bit words, I found the accuracy of the single precision table good enough. (IIRC the error is less than 0.5%)
I had posted the links to my programs in another thread:
http://www.hydrogenaudio.org/forums/showth...hp?threadid=840

Huffman decoding and pow(x,4/3) computation are not releated in any way, they are just two steps in the decoding process. No magic involved here, no possibility to do only one and skip the other. sorry. :-|
Go to the top of the page
+Quote Post
Ivan Dimkovic
post Mar 6 2002, 14:06
Post #14


Nero MPEG4 developer


Group: Developer
Posts: 1466
Joined: 22-September 01
Member No.: 8



Check out the:

AES Paper #5363
"Optimized DSP Implementation of Non-Linear Quantization"

(Raghunath K. Rao and Girish P. Subramaniam)

Presented at the 110th Convention
2001 May 1215 Amsterdam, The Netherlands

ABSTRACT
Non-linear quantization of the type INT(x M/N + constant) is commonly used in audio compression techniques,
particularly MPEG-1 and MPEG-2 layer III (MP3) and MPEG Advanced Audio Coding (AAC). Finding a
suitable DSP implementation is a problem since lookup table methods are prohibitive due to excessive storage
requirements, conventional series approximation methods do not give sufficient precision, and not all processors
have log/exp assist functions. This paper describes a method which utilizes the property of geometric periodicity
of the x M/N function to first normalize the problem to a small range of input x. Subsequently one can choose to
perform the x M/N in this limited range based on lookup, interpolation, or series expansion, and finally re-normalize
the output to obtain the overall answer. Using a hybrid scheme based on lookup and interpolation very
good overall precision is achieved. Compared to direct application of any of the above techniques, there is very
little additional computational burden, and the improvement in precision is very significant. Mathematically, this
method is shown to be a special case of log-exp based computation where the log is quantized.
Go to the top of the page
+Quote Post
encai
post Mar 7 2002, 05:44
Post #15





Group: Members
Posts: 17
Joined: 5-March 02
Member No.: 1445



QUOTE
Originally posted by Ivan Dimkovic
Check out the:

AES Paper #5363
"Optimized DSP Implementation of Non-Linear Quantization"

(Raghunath K. Rao and Girish P. Subramaniam)

Presented at the 110th Convention
2001 May 12?5 Amsterdam, The Netherlands


That is what I need. How can I get a E-version(such as PDF file etc...)
of it.
Go to the top of the page
+Quote Post
encai
post Mar 7 2002, 05:48
Post #16





Group: Members
Posts: 17
Joined: 5-March 02
Member No.: 1445



QUOTE
Originally posted by smack
The Motorola DSP has 24bit words, I found the accuracy of the single precision table good enough. (IIRC the error is less than 0.5%)
I had posted the links to my programs in another thread:
http://www.hydrogenaudio.org/forums/showth...hp?threadid=840


I have dl the source, but i have not use a Motorola DSP ever. :-(
Thanks any way.
Go to the top of the page
+Quote Post
Delirium
post Mar 7 2002, 06:13
Post #17





Group: Members
Posts: 300
Joined: 3-January 02
From: Santa Cruz, CA
Member No.: 891



QUOTE
Originally posted by encai
That is what I need. How can I get a E-version(such as PDF file etc...)
of it.
It's generally not possible to (legally) get free versions of these sorts of journal articles. Your best bet is probably a university library, if you have access to any; the AES is big enough that many research libraries will carry the proceedings of their conferences.

I did a bit of Google searching, and the only reference I found to the abstract Ivan pasted was at the AES website, which has pre-prints of papers from conference proceedings available for sale -- this paper's pre-print # is 5363 and you can order pre-prints of it (either in hard copy or PDF) for $10 ($5 for AES members) -- same price either way, though there's probably shipping added for the hard copy version.

The search is here:
http://www.aes.org/publications/preprints/search.html

Type 5363 into the "Preprint number" box and it'll come up with an order form.
Go to the top of the page
+Quote Post
Gabriel
post Mar 7 2002, 08:58
Post #18


LAME developer


Group: Developer
Posts: 2950
Joined: 1-October 01
From: Nanterre, France
Member No.: 138



I downloaded this paper last week, but I can't remember from where...
Go to the top of the page
+Quote Post
Ivan Dimkovic
post Mar 7 2002, 09:03
Post #19


Nero MPEG4 developer


Group: Developer
Posts: 1466
Joined: 22-September 01
Member No.: 8



I have the AES version, but it might be possible to find it on Cirrus web site.
Go to the top of the page
+Quote Post
encai
post Mar 7 2002, 10:38
Post #20





Group: Members
Posts: 17
Joined: 5-March 02
Member No.: 1445



Hi, guys
Would you please tell me the URL or some info.
or sent the paper to .
I have searched in google and find nothing.

Thanks!
Go to the top of the page
+Quote Post
ashok
post Mar 7 2002, 10:49
Post #21





Group: Members
Posts: 9
Joined: 7-March 02
Member No.: 1456



Hello
the best method is u can go for Newton Rahpson method
it will converge in 6 or at max 7 iterations and with same accuracy as table look up

personnaly u can contact me at
cool.gif


--------------------
thanks alot
Go to the top of the page
+Quote Post
DSPguru
post Mar 7 2002, 10:58
Post #22


BeSweet Developer


Group: Developer
Posts: 235
Joined: 14-December 01
From: sitting on top of a supercompact cardinal
Member No.: 643



QUOTE
Originally posted by Gabriel
A common solution is to use only a small table of let's say 1026 values

if i <1026 then direct lookup
if i >1025 then i = i/8, then lookup, then i = i*16

This involves only lookups and shiftings so it's quite fast, and reduces a lot the table size
i would go with Gabriel here. just instead of using table for the 1026 results, i would implement a high-order polynom (the order depends on the accuracy, but it won't get up to 1000 - that's for sure) .

btw,
you could use MATLAB's polyfit function, in order to generate the polynom coefficients, and polyval, in order to estimate the error.

Dg.


--------------------
DSPguru's Webpage - home of BeSweet & The OggMachine.
BeSplit - 7kb of A loseless AC3/AAC/MP3/MP2/WAV Cutter :)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 25th November 2014 - 23:19