?? vanishing_num.m
字號:
function N = Vanishing_num(h)
% compute the number of vanishing moments by the nubmer of zeros at the
% origin of the highpass frequency response
% input: h -- highpass filter coefficients
% output: N -- order of at the origin
% Copyright (c) 2006 Yi Chen
% check the vanishing moments
N = 1;
hx(1) = 0;
sizeh = size(h);
n0 = -(sizeh(1)-1)/2:(sizeh(1)-1)/2;
n1 = -(sizeh(2)-1)/2:(sizeh(2)-1)/2;
[n1,n0] = meshgrid(n1,n0);
ind = 1;
while max(abs(hx)) < 1e-3
for j = 0:N-1
for k = 0:j;
matrix_h = (n0.^k).*(n1.^(j-k));
hx(ind) = sum(sum(matrix_h.*h));
ind = ind + 1;
end
end
ind = 1;
N = N + 1;
end
N = N - 2;
hx = hx(:)';
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -