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

📄 lvboqi.m

📁 数字信号处理_matlab实现程序,上面有全套的实验代码
💻 M
字号:
% 《数字信号处理教程——MATLAB释义与实现》第八章模拟滤波器频带变换演示程序
% 电子工业出版社出版  陈怀琛编著 2004年9月
% lvboqi.m    从模拟低通滤波器到模拟高通,带通,带阻滤波器的演示! 

% 在本演示程序中,用的为巴特沃斯滤波器,阶数为 N=5(应该根据实际数计算出来,具体的计算公式和方法见上面的参考书)
% 如果需要根据实际的要求来设计相应的滤波器的话,所设计的低通滤波器的参数在每一个子函数中进行修改
% 因为对于不同的条件,所要显示的时间长度--T,  时间间隔---dt;  通带截止频率--fc;  阻带截止频率fs 
% 及在设计带通,带阻滤波器时中心频率--f0    归一化后都是不一样的

handles=figure('name','模拟滤波器设计演示');
set(handles,'unit','normalized','position',[0.1,0.2,0.5,0.5]);
set(handles,'defaultuicontrolunits','normalized');

%坐标轴y一用来绘制低通滤波器
haxes1=axes('position',[0.05,0.55,0.7,0.4],...
             'ylim',[0,2]);               
                  
%在这里绘制出一般的模拟低通滤波器的图形,及其一些设计参数
p1=[0:0.1:3]*j; fp=1;  fs=2;
for i=1:length(p1)
    hl1(i)=1/abs((p1(i)^2 + 0.6180*p1(i) + 1)*(p1(i)^2 + 1.6180*p1(i) + 1)*(p1(i)+1));
end
h=[fliplr(hl1),hl1];
p=[-fliplr(p1),p1];
plot(p/j,h);axis([-3,3,0,1.2]);hold on
plot([0,0],[0,1.2],'linestyle','-','color','r');
plot([fp,fp],[0,hl1(fp/0.1+1)],'linestyle','-.','color','g');
plot([-fp,-fp],[0,hl1(fp/0.1+1)],'linestyle','-.','color','g');
plot([fs,fs],[0,hl1(fs/0.1+1)],'color','r');
plot([-fs,-fs],[0,hl1(fs/0.1+1)],'color','r');
plot([-3,fp],[0.707,0.707],'linestyle','-.','color','g');


haxes2=axes('position',[0.05,0.1,0.7,0.4]);

hpushbutton1=uicontrol(handles,'style','pushbutton',...
                       'position',[0.78,0.6,0.2,0.1],...
                       'string','模拟低通到高通',...
                      'callback',['call_l2hp4(haxes1,haxes2);']);
hpushbutton2=uicontrol(handles,'style','pushbutton',...
                       'position',[0.78,0.4,0.2,0.1],...
                       'string','模拟低通到带通',...
                      'callback',['call_l2bp5(haxes1,haxes2);']);
hpushbutton3=uicontrol(handles,'style','pushbutton',...
                       'position',[0.78,0.2,0.2,0.1],...
                       'string','模拟低通到带阻',...
                      'callback',['call_l2bs6(haxes1,haxes2);']);
hpushbutton4=uicontrol(handles,'style','pushbutton',...
                       'position',[0.78,0.8,0.2,0.1],...
                       'string','模拟低通到低通',...
                      'callback',['call_l2lp(haxes1,haxes2);']);

⌨️ 快捷键说明

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