cours-m1-eea/455-Codage_Sources/Cours/quantif.m

8 lines
130 B
Mathematica
Raw Normal View History

2019-01-15 15:56:28 +01:00
function [y,idx] = quantif(x,M,Delta)
idx = floor(x/Delta);
idx = max(idx,-M/2);
idx = min(idx,M/2-1);
y = idx*Delta + Delta/2;