www.pudn.com > Quantization_simulink.rar > law13.m, change:2008-12-01,size:490b


function [y]=law13s(x)
y=x*16;
I=find(abs(x)>1/64);
y(I)=2/8*sign(x(I))+(x(I)-sign(x(I))/64)*8;
I=find(abs(x)>1/32);
y(I)=3/8*sign(x(I))+(x(I)-sign(x(I))/32)*4;
I=find(abs(x)>1/16);
y(I)=4/8*sign(x(I))+(x(I)-sign(x(I))/16)*2;
I=find(abs(x)>1/8);
y(I)=5/8*sign(x(I))+(x(I)-sign(x(I))/8);
I=find(abs(x)>1/4);
y(I)=6/8*sign(x(I))+(x(I)-sign(x(I))/4)/2;
I=find(abs(x)>1/2);
y(I)=7/8*sign(x(I))+(x(I)-sign(x(I))/2)/4;
%LAW13 Summary of this function goes here
%   Detailed explanation goes here