about the quantize function in the Matlab

1 view (last 30 days)
Gao
Gao on 18 May 2011
i don't know the difference between the fi and quantize. i write the function by myself as follow:
function y=F_bitize(V?N)
V=max(abs(V));%Get within the scope of the maximum
max=abs(x);
deltax=V/(2^?N-1?);%??????
xint=fix(ax./deltax+0.5);%???????
y=sign(x).*xint.*deltax;%????
***************************************************
V=firhalfband(26,0.0001,'dev');%26?????????
quantiz_N=8;%??????????
Vqua1=fi(V,1,quantiz_N+1)
Vqua1_double=double(Vqua1);
[xint,Vqua2]=F_bqtize(V,quantiz_N,2);%????????
q=quantizer([9 8],'roundMode','nearest')
y=quantize(q,V)
plot(y)
errorpencentage1=sum((V-Vqua2).^2)%?????????
errorpencentage2=sum((V-Vqua1_double).^2)%matlab????????
errorpencentage3=sum((V-y).^2)%matlab????????
i doubt the bit of quantize in the fi function.obviously, in my function ,8bit quantize of result is the same to 9bit quantize of result in the Matlab function. i can't understand.who can give me a hand? thx

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!