21.07.2015 Views

"TMS320C55x DSP Library DSPLIB Programmer's Reference"

"TMS320C55x DSP Library DSPLIB Programmer's Reference"

"TMS320C55x DSP Library DSPLIB Programmer's Reference"

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Calculating the Reciprocal of a Q15 NumberThe method chosen in this example is (c). Successive approximation yieldsthe most optimum code versus speed versus accuracy option. The methodoutlined below yields an accuracy of 15 bits.Assume Ym(new) exact value of1Xnorm :Ym(new) 1XnormorYm(new)*X 1(c1)(c2)Assume Ym(old) estimate of value 1 X :Ym(old)*Xnorm 1 DyxorDxy Ym(old)*Xnorm 1where Dyx = error in calculationAssume that Ym(new) and Ym(old) are related as follows:Ym(new) Ym(old) Dywhere Dy = difference in valuesSubstituting (c2) and (c4) into (c3):Ym(old)*Xnorm Ym(new)*Xnorm Dxy(Ym(new) Dy)*Xnorm Ym(new)*Xnorm DxyYm(new)*Xnorm Dy * Xnorm Ym(new)*Xnorm DxyDy * Xnorm DxyDy Dxy *1XnormAssume that 1/Xnorm is approximately equal to Ym(old):Dy Dxy * Ym(old) (approx)Substituting (c6) into (c4):Ym(new) Ym(old) Dxy * Ym(old)Substituting for Dxy from (c3) into (c7):Ym(new) Ym(old) (Ym(old)*Xnorm 1) * Ym(old)Ym(new) Ym(old) Ym(old) 2 * Xnorm Ym(old)Ym(new) 2*Ym(old) Ym(old) 2 * Xnorm(c3)(c4)(c5)(c6)(c7)(c8)B-2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!