I tried to use the following command to convert a 5-bit (3-bit fraction) fixed-point data to a 2-bit (1-bit fraction) fixed-point data with a bias:
E = fi([-0.25+0.125i;0.25-0.75i;0.5+0.875i;-0.25-0.5i;-0.5-0.125i;],1,5,3)Q = numerictype(1,2,0.5,0.25)a = fi(E,Q)
Where E is the input 5-bit (3-bit fraction) embedded.fi fixed-point data and Q is a embedded.numerictype object specifying a to be a 2-bit (1-bit fraction) embedded.fi fixed-point data with a bias of 0.25.
The resulting output fixed-point data a is not quantized correctly.
Best Answer