Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.
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!

share|improve this question
1  
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
add comment

1 Answer 1

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)).)

Then, you need to pick the smallest number of the form 2N (N is an integer) that is larger than the value determined in the previous step.

From there, the rest of the instructions should be straightforward.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.