### Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: MP3 decoding x^4/3 (Read 3289 times)
0 Members and 1 Guest are viewing this topic.

## MP3 decoding x^4/3

##### 2004-06-21 09:31:21
Hi All, I am designing my own MP3 decoder. I am having some problems in implimenting 'Requantizaion and Scaling' formula given in ISO 11173-3 specs.  Does any body know what is the best way to evaluate x^(4/3) or x^(1/3) i.e cube root of x?
Kind regards,
Aviral Mittal

## MP3 decoding x^4/3

##### Reply #1 – 2004-06-21 10:28:25
IMHO the best way is to use table of precalculated values.

## MP3 decoding x^4/3

##### Reply #2 – 2004-06-21 11:00:18
I am designing a hardware MP3 decoder. My problem is how do I calculate cube root of a number, which can range from 0to8192. A look up table I guess will consume a lot of memory. So I need is some kind of algorithm, which impliments x^4/3 or x^1/3 and save me area.
Kr,
Avi

## MP3 decoding x^4/3

##### Reply #3 – 2004-06-21 11:18:57
That will probably be very slow. What is the CPU you are using?

## MP3 decoding x^4/3

##### Reply #4 – 2004-06-21 11:32:12
Quote
I am designing a hardware MP3 decoder. My problem is how do I calculate cube root of a number, which can range from 0to8192.

I think that you want more than 8192:
http://www.mail-archive.com/mp3encoder@gee...e/msg05012.html

Regarding your question, an usual solution is to use a table that is only 1/4 the size and to use interpolation between values.

You might find interesting info in the papers that are in the programmer's corner of mp3-tech.org

## MP3 decoding x^4/3

##### Reply #5 – 2004-06-21 14:10:56
Quote
I think that you want more than 8192

I dont understand when you say 'I think that you want more than 8192'.
There are ONLY 8192 possible values for the frequency lines? so how come I will want more that that?
Kr,
Avi

## MP3 decoding x^4/3

##### Reply #6 – 2004-06-21 14:29:54
You can skip SOME values in a lookup table by only having the top of the range, and multiplying the intial value (if lower) by X and dividing the result by the cube root of X - the easy example (though it doesn't save much) is 8 and 2 so by bit-shifting the initial value 3 places up, you shift the result one place down - ok, so it only saves on 1/8th of the places in a lookup table, but it's accurate and easy.

PS. The maximum according to link - is actually 8206 - and there is a famous test sample (artificial) that can provoke a bug in decoders which only support the supposed standard limit of 8191, instead of the architectural maximum of 8206.

There are proponents of sticking to 8191, while others say - use EVERY bit available, and use 8206 - you can't gurantee NOT to meet something in the 8192-8206 range, and if you don't choose to be accurate for it, then at least detect and return the same value as for 8191 - giving less aberration than falling off the end of a lookup table!

## MP3 decoding x^4/3

##### Reply #7 – 2004-06-21 16:16:33
I have already thought what you suggested, and indeed it will reduce the size of the table. But this is not enouth, so I was trying to ask if there exist any other algorithm e.g Newton-Raphson method, or any other method which s'body has succesfully implimented.
Kr,
Avi

## MP3 decoding x^4/3

##### Reply #8 – 2004-06-21 21:27:11
A table-based method suitable for hardware implementations is described in the IEEE paper by Tsung-Han Tsai and Chuh-Chu Yen:

"A High Quality Re-quantization/Quantization Mehtod for MP3 and MPEG-4 AAC Audio Coding"

/Pontus