《DSP using MATLAB》Problem 8.17
2024-09-03 20:04:19
代码:
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 8.17 \n\n'); banner();
%% ------------------------------------------------------------------------ Wp = 0.5*pi; Ws = 0.8*pi; Rp = 0.25; As = 40;
Fp = Wp/(2*pi);
Fs = Ws/(2*pi); Ripple = 10 ^ (-Rp/20)
Attn = 10 ^ (-As/20) % Analog filter design, DIRECT form:
[b, a] = afd('cheby2', Fp, Fs, Rp, As);
%[b, a] = afd_chb2(Wp, Ws, Rp, As); % Calculation of second-order sections:
[C, B, A] = sdir2cas(b, a); % Calculation of Frequency Response:
[db, mag, pha, ww] = freqs_m(b, a, 1*pi); % Calculation of Impulse Response:
[ha, x, t] = impulse(b, a); %% -------------------------------------------------
%% Plot
%% ------------------------------------------------- figure('NumberTitle', 'off', 'Name', 'Problem 8.17 Lowpass Analog Chebyshev-2')
set(gcf,'Color','white');
M = 1.0; % Omega max subplot(2,2,1); plot(ww/pi, mag); grid on; axis([-1, 1, 0, 1.2]);
xlabel(' Analog frequency in \pi*1k units'); ylabel('|H|'); title('Magnitude in Absolute');
set(gca, 'XTickMode', 'manual', 'XTick', [-0.8, -0.5, 0, 0.5, 0.8]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.01, 0.97, 1]); subplot(2,2,2); plot(ww/pi, db); grid on; %axis([0, M, -50, 10]);
xlabel('Analog frequency in \pi*1k units'); ylabel('Decibels'); title('Magnitude in dB ');
set(gca, 'XTickMode', 'manual', 'XTick', [-0.8, -0.5, 0, 0.5, 0.8]);
set(gca, 'YTickMode', 'manual', 'YTick', [-70, -40, -1, 0]);
set(gca,'YTickLabelMode','manual','YTickLabel',['70';'40';' 1';' 0']); subplot(2,2,3); plot(ww/pi, pha/pi); grid on; axis([-1, 1, -1.2, 1.2]);
xlabel('Analog frequency in \pi*1k nuits'); ylabel('radians'); title('Phase Response');
set(gca, 'XTickMode', 'manual', 'XTick', [-0.8, -0.5, 0, 0.5, 0.8]);
set(gca, 'YTickMode', 'manual', 'YTick', [-1:0.5:1]); subplot(2,2,4); plot(t, ha); grid on; %axis([0, 30, -0.05, 0.25]);
xlabel('time in seconds'); ylabel('ha(t)'); title('Impulse Response');
运行结果:
滤波器绝对指标
模拟chebyshev-2型低通滤波器,串联形式系数
幅度谱、相位谱和脉冲响应
幅度谱进行放大
最新文章
- IT菜鸟的生存指南(三)流行还是经典
- SQL Server封闭掉 触发器递归
- delphi URL 编码的转换
- 黑马程序员_Java基础:JDK1.5后的新特性:自动拆装箱,以及注意事项
- sql自带函数语句
- Step
- Discuz X3.2 SEO设置 title 不支持空格的解决方法
- 2014 ACM/ICPC 鞍山赛区现场赛 D&;amp;I 解题报告
- java swing窗口放置屏幕中央问题思考
- win32 api Windows窗口的创建
- LWIP_STM32_ENC28J60_NETCONN_TCP_SERVICER(5)
- vue中的checkbox全选和反选
- Java线程池中submit() 和 execute()方法的区别
- 微信小程序之弹出操作菜单
- Golang 包管理简介
- Centos7 网络报错Job for iptables.service failed because the control process exited with error code.
- Java并发编程笔记之ConcurrentLinkedQueue源码探究
- Freemarker 简介
- HP电脑的增霸卡功能操作详解
- 学习Zookeeper之第1章Zookeeper入门
热门文章
- .NET Core 3.0之深入源码理解Startup的注册及运行
- Ubuntu下怎么退出vim编辑器
- soj115 御坂网络
- duilib库分析2.第一篇UIManager
- duilib库分析1.消息流程分析
- (转) Mac下面的SecureCRT(附破解方案) 更新到最新的7.3.7
- 在Laravel5.4中自动加载自定义文件
- 20.multi_case04
- Django的日常-AJAX
- python字符串的索引切片和常用操作方法,for循环