📄 lpfbfb.m
字号:
% [h0,h1,f0,f1] = lpfbfb(N,NP)
% lpfbfb --- The input integer N is the number of the independent
coefficient
% of allpass filter. NP is the point number of the frequency response
plot.
% This M-file will call the function M-file ap.m, which will design the
allpass
% filter according to the input N. M=2*N-1 is the order of the allpass
filter.
% So, M+1 is its length. The performance of the allpass filter will
infulence
% the qualify of the lowpass filter H0. The reference of this program is
% "A New Class of Two-Channel Biorthogonal Filter Banks and Wavelet
Bases"
% IEEE TRANS. ON SIGNAL PROCESSING, VOL.43 NO.3,MARCH 1995
function [h0,h1,f0,f1] = lpfbfb(N,NP);
M = 2*N-1;
v = ap(M);
for I = 1:M+1
h(2*I-1) = 0.5*v(I);
h(2*I) = 0;
v1(2*I-1) = v(I);
v1(2*I) = 0;
end
h(M+1) = 0.5;
for I = 1:2*M+1
h0(I) = h(I);
v2(I) = v1(I);
end
% v2 is v(exp(j*2*w))
h1 = conv(-v2,h0);
h1((max(size(h1))+1)/2) =h1((max(size(h1))+1)/2)+1;
% Synthesis Filter
for I = 1:max(size(h0))
f1(I) = (-1)^(I-1)*h0(I);
end
for I = 1:max(size(h1))
f0(I) = -(-1)^(I-1)*h1(I);
end
% draw the frequency response
H0 = freqz(h0,1,NP); H1 = freqz(h1,1,NP);
F0 = freqz(f0,1,NP); F1 = freqz(f1,1,NP);
x = 0.5/(NP-1)*(0:(NP-1));
plot(x,dbvalue(abs(H0)),'r');
hold on
plot(x,dbvalue(abs(F0)),'g');
plot(x,dbvalue(abs(H1)),'r')
plot(x,dbvalue(abs(F1)),'g');
title('Frequency Response of LPFBFB');
ylabel('Magnitude (dB)');
xlabel('Normalized Frequency');
hold off
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -