# Matlab : Exploring the effects of co-efficient quantization

b = [0.9355,-3.6135,5.3603,-3.6135,0.9355]
a = [1,-3.7339,5.3562,-3.4929,0.8752]


Use MATLAB to quantize the coefficients in the vectors a and b to 16 bits of precision. First, take each vector and divide by the smallest power of two such that, after division, the magnitude of the largest filter coefficient is no larger than 1. Next, multiply the resulting vectors by 215, and round to the nearest integer. (You can use the round function.) Divide the resulting vectors by 215. The resulting values should be no less than -1 and no larger than 1. Finally, multiply these values by the power of two by which you originally divided.

I do not understand what that smallest power of two is! Can someone help me out with the code? Thanks!

-
Welcome to dsp.se. We're happy to help you suggest approaches for your problems/projects, or clarify some part of theory. Some people provide code to demonstrate their approach, but this is not a please-code-this-for-me site. Also, we do like to see people asking the questions put in some effort in the solution themselves: what have you tried? What exactly do you not understand, what do you think it means? Finally, if this is a homework question, you should tag it as such. – penelope Dec 7 '12 at 9:54

For each of the vectors "a" and "b", you need to find the element with the largest absolute magnitude. (I'm not sure of the specific Matlab code for this; probably something like max (abs (a)).)