text: Q format
  
  Started by June 22, 2006
  ```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???
  
  Thanks,
  Rohini.
  
  ```
  ```rohini wrote:
  > 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???
  >
  > Thanks,
  > Rohini.
  >
  
  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)
  = round(77.649)
  = 78
  = 0x004E
  
  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
  = -2.14e-5
  
  I hope that helps you with q-math!  I tried to make it general so you
  could apply it anywhere.
explanation: The document contains a math question and a detailed answer to the question. The question is about converting a fraction (1/211) into Q format and finding the quantization error. The answer provides a step-by-step explanation of the process.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: Q format
  
  Started by June 22, 2006
  ```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???
  
  Thanks,
  Rohini.
  
  ```
  ```rohini wrote:
  > 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???
  >
  > Thanks,
  > Rohini.
  >
  
  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)
  = round(77.649)
  = 78
  = 0x004E
  
  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
  = -2.14e-5
  
  I hope that helps you with q-math!  I tried to make it general so you
  could apply it anywhere.
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The document contains a math question and a detailed answer to the question. The question is about converting a fraction (1/211) into Q format and finding the quantization error. The answer provides a step-by-step explanation of the process.
  
  Label: question-and-answer