% three-level shifted discretization of signal fu in [-1,1] function [ud,IS]=mdiscr(fu,dis,m,my,mu) % m-2 alternative discretizations IS=ones(mu,my)/mu; % the uniform ideal probability of ud ul=-1; % lower bound of fu uu=1; % upper bound of fu ur=(uu-ul)/m; % increment of fu u1=ul+dis*ur; % lower bound of the narrow % band of dis-th convertor u2=ul+(dis+1)*ur; % upper bound of the narrow % band of dis-th convertor if fu<=u1 ud=1; % discretized signal elseif fu<=u2 ud=2; else ud=3; end