⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dead_zone_q.m

📁 zerotree的寫法,給大家參考
💻 M
字号:
function Y=dead_zone_q(X,qstep)
%x = dead_zone_q(x,qstep)
%Version: 1.00, Date: 2004/12/01, author: Nikola Sprljan
%Quantisation with a dead-zone around zero 
%
%Input: 
% X - original matrix
% qstep - quantisation step (threshold)
%
%Output:
% Y - quantised matrix
%
%Note:
% Dead zone is equal to the quantisation step, i.e. all coefficients whose
% absolute value is <qstep get quantised to 0.
%
%Example:
% Y=dead_zone_q(X,0.5);

if (~isfloat(X)) X = double(X);end;  
Xs = sign(X);
Y = abs(X);
Y(Y<qstep) = 0;
Y = floor(Y/qstep);
Y(Y~=0) = Y(Y~=0)+0.5;
Y = Xs.*Y*qstep;

⌨️ 快捷键说明

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