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

📄 bio1.m

📁 里面囊括了基于matlab滤波器设计的各种.m文件
💻 M
字号:
 % A New Class of Two-Channel Biorthogonal Filter Banks and Wavelet Bases
% H is the magnitude square, integral sum is objective function
% 0.6*pi is stopband edge, 0.4*pi is passband edge.

H = '0.5+0.25*((4*x+2)*cos(w)+2*x*x*cos(3*w))/(1+x*x+2*x*cos(2*w))'
% Stopband attenuation will be minimized
phi1=int(H,'w',0.6*pi,pi);
% Passband ripple will be minimized
H1 = symadd(1,symmul(-1,H))
phi2=int(H1,'w',0,0.4*pi);
phi1 = simplify(phi1);
phi2 = simplify(phi2);
phi = symadd(phi1,phi2);
phi = simplify(phi);
% The initial value of x is 0.5
x=0.5;
% Do optimization
x=fminu(phi1,x)

% This is the result (res) of the filter 
% x is the optimized parameter

%x=0.48525189301219;
B0=[0,0.5*x,0.5,0.5,0.5*x];
A0=[1,0,x];
[h0,w0]=freqz(B0,A0,1000);
semilogy(w0,abs(h0),'g')
hold on
B1=[0,-0.5*x*x,-0.5*x,1-x,-0.5*(1+x*x),2*x-0.5,-0.5*x,x*x];
A1=[1,0,2*x,0,x*x];
[h1,w1]=freqz(B1,A1,1000);
semilogy(w1,abs(h1),'r')
axis([0,3.14,1e-6,1e2])
hold off
title('Frequency Response of H0 and H1')
xlabel('N=1')
ylabel('Magnitude Response db')

⌨️ 快捷键说明

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