Quantization is a discretization process in which the continuous range of all possible values of a signal are replaced by a discrete range of values. In other words, a quantizer function
From the quantizer equation it can be inferred that most of the times quantization simply means to round off or truncate an analog value. This implementation corresponds to a uniform quantizer, which has a quantization step size
In this implementation mexCallMATLAB is used, a sine signal is simulated by calling the MATLAB command
A MEX function can be created by using the command:
mex -R2018a Quantizer_using_mexCallMATLAB.c
This function needs no output and takes only one argument, which is the number of bits used by the quantizer:
Quantizer_using_mexCallMATLAB(3)