Technical discussions about the TI C54x DSPs (including the c5401, c5402, c5402a, c5404, c5407, c5409, c5409a, c5410, c5410a, c5416, c5420, c5421, c5441, c549, c5470 and c5471).
Hello: I would like to perform the following operation on C54xx x/y*abs(x). Where y is constant and always greater than x. X and Y are in Q15 notation. Though TI documents on how to perform division, but in those scenarios x is always greater than y. I am not sure how to tackle this scenario. Probably by applying some sort of scaling to x before the division. Also, in order to reduce quantization errors, I suppose the operation x/y should be performed before it is multiplied by abs(x). Any suggestions would be of great help. Thanks, Sachin
Just a correction to what I worte earlier. To reduce quantization error, x*abs(x) should be performed before the product is divided by y. That sounds correct now :-) Thanks, On 6/23/06, s...@gmail.com <s...@gmail.com> wrote: > > Hello: > I would like to perform the following operation on C54xx > x/y*abs(x). > Where y is constant and always greater than x. > X and Y are in Q15 notation. > Though TI documents on how to perform division, but in those scenarios x > is always greater than y. I am not sure how to tackle this > scenario. Probably by applying some sort of scaling to x before the > division. > Also, in order to reduce quantization errors, I suppose the operation x/y > should be performed before it is multiplied by abs(x). > Any suggestions would be of great help. > Thanks, > Sachin
Sachin- > Just a correction to what I worte earlier. > To reduce quantization error, x*abs(x) should be performed before > the product is divided by y. That sounds correct now :-) Attached is a 54xx .asm file that has both integer and fractional divide routines. The integer divide allows the numerator to be larger than the denominator, but both have to be 16-bit. Maybe this can give you some clue for doing it with 32-bit numerator. Please keep the copyrights in place if you use this code, thanks. -Jeff > On 6/23/06, s...@gmail.com <s...@gmail.com> wrote: > > Hello: > I would like to perform the following operation on C54xx > x/y*abs(x). > Where y is constant and always greater than x. > X and Y are in Q15 notation. > Though TI documents on how to perform division, but in those scenarios x > is always greater than y. I am not sure how to tackle this scenario. > Probably by applying some sort of scaling to x before the division. > Also, in order to reduce quantization errors, I suppose the operation x/y > should be performed before it is multiplied by abs(x). > Any suggestions would be of great help. > Thanks, > Sachin >