weight_sep.m

来自「MATLAB Code for Optimal Quincunx Filter 」· M 代码 · 共 19 行

M
19
字号
function w = weight_sep(N, M1, M2, ws, wp)
% compute the weighting matrix for separable model for diamond lowpass 
% e.g., w = weight_sep(64, 10, 6, 1, 0.1)
% input:  N -- total size, N must be even
%        M1 -- for stopband
%        M2 -- for passband
%        ws -- weight for stopband
%        wp -- weight for passband
% Copyright (c) 2006 Yi Chen

% % M1+M2-1 is the width of the transition band
w1 = diamond(N-1+2*M1, N-1+2*M1);
w2 = diamond(N+1-2*M2, N+1-2*M2);

% weights for the stopband
w = ws*(1-w1(M1:N+M1, M1:N+M1));
% plus weights for the passband
w(M2+1:N+1-M2, M2+1:N+1-M2) = wp*w2 + w(M2+1:N+1-M2, M2+1:N+1-M2); 
% figure; mesh(w)

⌨️ 快捷键说明

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