I would really appreciate if I can get answers to following Fixed point queries(part-1):
Converting a real number x to fixed point fraction X(m,n)
- [1] says:
m = ceil(log2(max[abs(xmin,xmax)+1])) { assuming signed x>1) or
m = floor(log2(max[abs(xmin,xmax)+2])) { assuming signed x<1} (1.1)
and xmin,xmax define the known range of x. if WL desired is known = m+ n , then, n= WL - m.
Q1) Can this be used blindly? What if we don't know the expected range of x?
- [2] defines: if floating x had "d" fractional digits,
compute ceil(3.3 * d). (1.2)
Q2) Is Fraction Length n = ceil(3.3 * d) or n+1 = ceil(3.3 * d)
Q3) What about floor(3.3*f) or any other scheme?
Q4) Where would I use equation 1.1 over 1.2 and vice versa?
Suppose we have computed Fraction length n by any of the above methods. Now, The integer representation and the quantized value is computed as:
X= round/floor/fix(x*(2^n)); xq(Quantized value) = X/(2^n);
(Q5) Does choosing round/floor/fix here determine the type of quantizer? If yes, which option gives a rounding quantizer and which one does a truncation quantizer?
Reference:
1.http://www.superkits.net/whitepapers/Fixed%20Point%20Representation%20&%20Fractional%20Math.pdf( equation 9 and Equation 12)
2. DSP, a practical approach:Efeachor (page 809-810,second edition)
Thank You so much
sedy