% three-level shifted discretization of signal fy in [-1,1] function [yd,IS]=mdiscry(fy,dis,m,my,mu,Ify) sma=0.01; uni=ones(1,my*mu); % m-2 alternative discretizations IS=(sma/(my-1))*ones(my,my*mu); % the ideal probability of yd yl=-1; % lower bound of fy yu=1; % upper bound of fy yr=(yu-yl)/m; % increment of fy y1=yl+dis*yr; % lower bound of the narrow % band of dis-th convertor y2=yl+(dis+1)*yr; % upper bound of the narrow % band of dis-th convertor if fy<=y1 yd=1; % discretized signal elseif fy<=y2 yd=2; else yd=3; end %construction of the ideal if Ify<=y1 IS(1,:)=(1-sma)*uni; % the ideal of discretized output elseif Ify<=y2 IS(2,:)=(1-sma)*uni; % the ideal of discretized output else IS(3,:)=(1-sma)*uni; % the ideal of discretized output end