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

📄 fig9_39.m

📁 基于WEB与MATLAB编写的信号处理的源码,书名为"应用WEB和MATLAB的信号与系统基础.
💻 M
字号:
% Figure 9.39
%
%  Analog Chebyshev filter design
%
%  design an n-pole filter with a bandwidth of 1 rad/sec
%
[z,p,k] = cheb1ap(2,3);        % 2 pole filter
[b,a] = zp2tf(z,p,k);        % convert to polynomials
w = 0:0.01:4;
[mag2,phase2] = bode(b,a,w);
fprintf('2 pole filter \n')
disp('b = '); disp(b')
disp('a = '); disp(a')
fprintf('Hit any key to continue  \n')
fprintf('  \n')
pause
%
% repeat for 3-pole filter
%
[z,p,k] = cheb1ap(3,3);        % 2 pole filter
[b,a] = zp2tf(z,p,k);        % convert to polynomials
w = 0:0.01:4;
[mag3,phase3] = bode(b,a,w);
fprintf('3 pole filter \n')
disp('b = '); disp(b')
disp('a = '); disp(a')
fprintf('Hit any key to continue  \n')
fprintf('  \n')
pause
% repeat for 5-pole filter
[z,p,k] = cheb1ap(5,3);        % 2 pole filter
[b,a] = zp2tf(z,p,k);        % convert to polynomials
w = 0:0.01:4;
[mag5,phase5] = bode(b,a,w);
fprintf('5 pole filter \n')
disp('b = '); disp(b')
disp('a = '); disp(a')
fprintf('Hit any key to continue  \n')
fprintf('  \n')
pause
%
%
clf
subplot(211)
plot(w,mag2,'-',w,mag3,'-.',w,mag5,'--');
ylabel('|H|')
axis([0 4 0 1.5]);
% the following creates the legend
hold on
plot([2 2.3],[1.25 1.25],[2 2.3],[1 1],'-.',[2 2.3],[.75 .75],'--');
text(2.4,1.25,'2 pole');
text(2.4,1,'3 pole');
text(2.4,.75,'5 pole');
hold off
subplot(212)
plot(w,phase2,'-',w,phase3,'-.',w,phase5,'--');
ylabel('Angle(H), degrees')
xlabel('Frequency (rad/sec)')
subplot(111)

⌨️ 快捷键说明

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