perform_quantization.m

来自「This document is intended to serve as an」· M 代码 · 共 19 行

M
19
字号
function [y, y_quant] = perform_quantization(x, T, dir)

% perform_quantization - perform a nearly uniform quantization of the signal.
%
% If x is a double array (or a cell collection of arrays) 
% to be quantized, use
%   [y, y_quant] = perform_quantization(x, T, 1);
% y is the quantified value
% y_quant is the signed token representing each entry of y 
% (this is an exexinteger).
% If y_quant is an int32
%   x = perform_quantization(y_quant, T, -1);
%
%   The quantizer is defined by y=Q_T(x) where:
%       Q_T(x) = 0    if  |x|<T
%       Q_T(x) = sign(x) * ([x/T]+0.5)*T      where [.]=floor
%   (i.e. a nearly uniform quantizer with twice larger zero bin).
%
%   Copyright (c) 2004 Gabriel Peyr

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?