Learning · Step 3

Pick Q for your data

Q15 was a choice, not a law. Q is set by your data: you need enough integer bits to hold the largest value you'll ever see, and every bit you don't spend on the integer side becomes resolution. Pick Q wrong and you either overflow or throw away precision.

Measure your data's peak — the largest magnitude max|x|. The integer side must reach at least that far; the rest is fraction. The best Q is the largest one whose range still covers the peak: maximum resolution, no overflow.

Too much Q → the integer range is smaller than the peak → values saturate. Too little Q → integer bits sit unused while resolution is coarser than it needed to be. The app's Q auto-suggest tool does this measurement for you; the explorer below shows what it's deciding.

Try it

Set your data's peak, slide Q, switch the word width — the bit budget recolours and the verdict updates live.

integer — needed integer — spare fraction overflow
Example peaks:

What to notice

Step exam

Answer all 3 questions correctly to complete this step.

  1. Your data's largest magnitude is 12. The Q-format's integer side must:

  2. Choosing too large a Q — too many fractional bits — for your data causes:

  3. The best Q for a dataset is: