mctrans.m

来自「PDTDFB toolbox The filter bank is des」· M 代码 · 共 29 行

M
29
字号
function h = mctrans(b,t)% MCTRANS McClellan transformation%   H = mctrans(B,T) produces the 2-D FIR filter H that%   corresponds to the 1-D FIR filter B using the transform T.% Convert the 1-D filter b to SUM_n a(n) cos(wn) formn = (length(b)-1)/2;b = rot90(fftshift(rot90(b,2)),2); % Inverse fftshifta = [b(1) 2*b(2:n+1)];inset = floor((size(t)-1)/2);% Use Chebyshev polynomials to compute hP0 = 1; P1 = t;h = a(2)*P1; rows = inset(1)+1; cols = inset(2)+1;h(rows,cols) = h(rows,cols)+a(1)*P0;for i=3:n+1,    P2 = 2*conv2(t,P1);    rows = rows + inset(1); cols = cols + inset(2);    P2(rows,cols) = P2(rows,cols) - P0;    rows = inset(1) + [1:size(P1,1)];    cols = inset(2) + [1:size(P1,2)];    hh = h;    h = a(i)*P2; h(rows,cols) = h(rows,cols) + hh;    P0 = P1;    P1 = P2;endh = rot90(h,2); % Rotate for use with filter2

⌨️ 快捷键说明

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