《DSP using MATLAB》Problem 8.13
2024-09-06 05:54:21
代码:
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 8.13 \n\n'); banner();
%% ------------------------------------------------------------------------ Wp = 20*pi; Ws = 40*pi; Rp = 0.5; As = 45;
Fp = Wp/(2*pi);
Fs = Ws/(2*pi); Ripple = 10 ^ (-Rp/20)
Attn = 10 ^ (-As/20) % Analog filter design:
[b, a] = afd('butter', Fp, Fs, Rp, As);
%[b, a] = afd_butt(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, 45*pi); % Calculation of Impulse Response:
[ha, x, t] = impulse(b, a); %% -------------------------------------------------
%% Plot
%% ------------------------------------------------- figure('NumberTitle', 'off', 'Name', 'Problem 8.13 Analog Butterworth lowpass')
set(gcf,'Color','white');
M = 1.0; % Omega max subplot(2,2,1); plot(ww/pi, mag); grid on; axis([-45, 45, 0, 1.2]);
xlabel(' Analog frequency in \pi*1k units'); ylabel('|H|'); title('Magnitude in Absolute');
set(gca, 'XTickMode', 'manual', 'XTick', [-45, -40, -20, 0, 20, 40, 45]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.005, 0.94, 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', [-45, -40, -20, 0, 20, 40, 45]);
set(gca, 'YTickMode', 'manual', 'YTick', [-50, -45, -10, 0]);
set(gca,'YTickLabelMode','manual','YTickLabel',['50';'45';'10';' 0']); subplot(2,2,3); plot(ww/pi, pha/pi); grid on; axis([-45, 45, -1.2, 1.2]);
xlabel('Analog frequency in \pi*1k nuits'); ylabel('radians'); title('Phase Response');
set(gca, 'XTickMode', 'manual', 'XTick', [-45, -40, -20, 0, 20, 40, 45]);
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');
运行结果:
通带、阻带绝对指标
模拟butterworth低通,直接形式系数
串联形式系数
幅度谱、相位谱和脉冲响应。
最新文章
- java的poi技术读取和导入Excel
- SharePoint 2013功能(SPFeature)与GUID对照表
- spring事务手动回滚
- web开发字符乱码问题
- SQL链表查询 数据库为空
- sql深入理解
- Hadoop概念学习系列之Hadoop HA进一步深入(二十八)
- window.location.hash属性介绍
- 多边形背景生成工具推荐-Trianglify
- 什么是NSTimer
- Android Camera开发:使用GLSurfaceView预览Camera 基础拍照
- Oracle字符串分割函数
- cocos2dx新建工程分析
- PHP - 目录、文件操作
- python读取外部文件
- php微信扫码支付
- python 正则指北之我的总结
- iOS 开发中keyChain的使用
- input(Text)控件作为填空输入,但运行后,有曾经输入的记录显示,用autocomplete=";off";解决
- 机器学习之MCMC算法
热门文章
- 21-4indexOf
- VBA字典做数据有效性
- 8.spark Core 进阶1
- 深入解读阿里云数据库POLARDB核心功能会话读一致性
- 0924CSP-S模拟测试赛后总结
- hdu多校第二场1011 (hdu6601) Keen On Everything But Triangle 主席树
- C#,判断数字集合是否是连续的
- .net core 3.0 发布 500.0 - ANCM In-Process Handler Load Failure 错误
- iOS开发之SceneKit框架--SCNGeometry.h
- 20.multi_case02