# uniform quantizer for sine wave with amplitude -1 db

i have a signal sine wave with an amplitude of -1 db The quantizer step Δ is 1/7. The middle quantization level is 0 and the other levels are ±kΔ,, k=1-7. the output is 4-bit unsigned integer which values from 0 to 14 corresponding to the 15 quantization levels. how i can do this in matlab

• -1dB with respect to WHAT? – user_1818839 May 12 '20 at 17:30
• what am asking is how to create a uniform quantizer that has 15 level , and 0 is the middle level and other levels is k*delta , with a step of delta=1/7 – ayyoub May 12 '20 at 17:47
• You've just repeated what is in your question and haven't answered the comment. – Transistor May 12 '20 at 19:32
• - 1 db in amplitude it will be AM=10^(-1/20); signal = AMsin(2*pif*nT); – ayyoub May 12 '20 at 20:17
• So. 0.89, right? What is that in LSB (quantizer steps)? – user_1818839 May 12 '20 at 21:44

The same page describes the "matlab script" equivalent:

y = q * round(u/q)
where y is the quantized output, u is the input, and q is the Quantization interval.


This will provide an output in the same units as input. If you wish for the output to be a raw quantization count, just remove the multiplication by quantization interval.