Dear Ravichandra,
As bhagawan said,
Multiplying two variables of x bits, u will get 2x bits. We have shift the 2x
bits by 1 bit left (to eliminate the effect of one of the sign bit I guess).
So your right hand side variable have to be greater than q30 format (nearly
double) and finally you can round of to Q30 format instead of keeping the right
hand side variable in Q30 format. This will be more accurate than the later.
Regards,
Venkat
On Tue, 03 May 2005 bhagawan reddy wrote :
>Dear Ravichandra,
>
> Here you are doing Multiply and Accumulate(MAC)
operation.Hence you cannot expect *pfltXformSubBark to be in Q30
format.
>
>Declare this as 40-bit or 64-bit, whatever your processor supports, and
balance betweeen the Integer and fractional bits you need.
>
>Regards,
>Bhagawan
>pai_raviin <p...@yahoo.co.in> wrote:
>Hi all,
>
>Can anybody help me with the fixed point conversion of following
>code:
>
>while (iCoef < iNextBandR)
>{
>*pfltXformSubBark = 0.0;
>i = 0;
>while (i < iWidth)
>{
>*pfltXformSubBark += *pfltOuterEarXform * *pfltOuterEarXform;
>i++;
>}
>iCoef += iWidth;
>pfltXformSubBark++;
>iWidth = (1< }
>
>I am taking the values of pfltOuterEarXform in as Q30 format in
>fixed point format (because the values of pfltOuterEarXform in
>between 1.02527 & 0.021747) and doing the squaring of
>pfltOuterEarXform and accumulating with pfltXformSubBark if and only
>if i < iWidth.
>
>And I observed the range of pfltXformSubBark values in between
>0.000945910 and 33.6377.
>
>When I do the multiplication there is overflow problem(?) i.e. it's
>exceeding Q30 format. How to convert this piece of code into fixed
>point??
>
>P. Ravichandra Reddy
>Yahoo! India Matrimony: Find your life partneronline.
Hi all,
Can anybody help me with the fixed point conversion of following
code:
while (iCoef < iNextBandR)
{
*pfltXformSubBark = 0.0;
i = 0;
while (i < iWidth)
{
*pfltXformSubBark += *pfltOuterEarXform * *pfltOuterEarXform;
i++;
}
iCoef += iWidth;
pfltXformSubBark++;
iWidth = (1< }
I am taking the values of pfltOuterEarXform in as Q30 format in
fixed point format (because the values of pfltOuterEarXform in
between 1.02527 & 0.021747) and doing the squaring of
pfltOuterEarXform and accumulating with pfltXformSubBark if and only
if i < iWidth.
And I observed the range of pfltXformSubBark values in between
0.000945910 and 33.6377.
When I do the multiplication there is overflow problem(?) i.e. it's
exceeding Q30 format. How to convert this piece of code into fixed
point??
P. Ravichandra Reddy
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EA3HyD/3MnJAA/79vVAA/GP4qlB/TM
--------------------------------~-
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/speechcoding/
<*> To unsubscribe from this group, send an email to:
s...@yahoogroups.com
<*
Yahoo! India Matrimony: Find your life partner
online.