> I am kind of new to DSP stuff....i want to convert 1/211 in to Q
> format. Can any one tell me how to find it. And I need to find the
> quantization error in general for any number how do i do tha???
Say you've got an n-bit number, such that i bits are the integer portion
and q bits are the "quotient" or fraction portion (i.e. i+q=n).
Now say x is the number you're trying to convert to fixed-point and x'
is the fixed-point representation.
x' = round(x * 2^q)
quantization error = x - ( x' / 2^q )
So take your example of x=1/211. Let's say you're dealing with 16-bit
numbers and you've decided to do q14 math. That means your total range
is [-2,2) and your precision is 2^-14 (~6.1e-5).
x' = round(1/211 * 2^(-14)
In binary this means you are representing 1/211 as 00.00 0000 0100 1110
You can now convert this back to decimal by doing 78 / 2^14 =
0.0047607421875. Therefore your quantization error is:
Eq = 1/211 - 78 / 2^14
I hope that helps you with q-math! I tried to make it general so you
could apply it anywhere.
Reply by rohini●June 22, 20062006-06-22
I am kind of new to DSP stuff....i want to convert 1/211 in to Q
format. Can any one tell me how to find it. And I need to find the
quantization error in general for any number how do i do tha???