《DSP using MATLAB》Problem 8.13

代码:
%% ------------------------------------------------------------------------
%% 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低通,直接形式系数

串联形式系数

幅度谱、相位谱和脉冲响应。

《DSP using MATLAB》Problem 8.13的更多相关文章
- 《DSP using MATLAB》Problem 7.13
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 6.13
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 5.13
1. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output ...
- 《DSP using MATLAB》Problem 4.13
代码: %% ---------------------------------------------------------------------------- %% Output Info a ...
- 《DSP using MATLAB》Problem 6.12
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 6.10
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 4.11
代码: %% ---------------------------------------------------------------------------- %% Output Info a ...
- 《DSP using MATLAB》Problem 3.3
按照题目的意思需要利用DTFT的性质,得到序列的DTFT结果(公式表示),本人数学功底太差,就不写了,直接用 书中的方法计算并画图. 代码: %% -------------------------- ...
- 《DSP using MATLAB》Problem 3.1
先写DTFT子函数: function [X] = dtft(x, n, w) %% --------------------------------------------------------- ...
随机推荐
- java OOP第03章_继承、抽象类和抽象方法
一. 为什么需要继承: 若多个类中都需要一些属性和方法,那么就可以将属性和方法抽取到一个父类中,需要的子类可以通过extends关键字去继承这个父类后拥有相应的属性和方法. 类.数组.方法----引用 ...
- pop&dismiss
//dismiss到根视图 - (void)dismissToRootViewController{ UIViewController *vc = self; while (vc.presenting ...
- linux段位进阶
1.青铜: 1.Linux基础知识.基本命令(起源.组成.常用命令如cp.ls.file.mkdir等常见操作命令) 2.Linux用户及权限基础 3.Linux系统进程管理进阶 4.linux高效文 ...
- vim 底行模式 操作命令
1. 当前设置行号: set nonu 取消行号显示: 2. :set number 显示行号 (下次使用就没有了,要设置脚本 vim ~/ . ...
- AndroidStudio 搜索导入自己需要的库
前言 在Androidx的库应用后,导致有需多系统组件库需要重新 implementation 升级为Androidx, 但是你可能会发现不知道怎么导入他们. 当然除了导入Android的组件库,还 ...
- PKUSC加油加油加油!
一句话,把学过的掌握的甚至还未掌握的,都用上吧! 1.题目不要再再再看错了!在纸上记下关键字. 2.记得有预处理这个东西可以降低复杂度! 3.仔细阅读数据范围,取值范围的0要注意! 4.不要每次像开新 ...
- matplotlib 画图颜色参数值及对应色卡
matplotlib 色卡对应参数值 cnames = { 'aliceblue': '#F0F8FF', 'antiquewhite': '#FAEBD7', 'aqua': '#00FFFF', ...
- day10 nfs服务,nginx负载均衡,定时任务
==================nginx 负载均衡==================== 实现nginx负载均衡的效果,并运用nfs服务共享目录,使所有nginx服务拥有共同的http目录 n ...
- How to Hide Apache Tomcat Version Number from Error Pages
1. 进入tomcat lib目录 cd /usr/local/tomcat7/lib 2. 解压catalina.jar jar xvf catalina.jar 3. 修改ServerInfo.p ...
- 【Vue】组件的基础与组件间通信
转载:https://segmentfault.com/a/1190000016409329 Vue.js 最核心的功能就是组件(Component),从组件的构建.注册到组件间通信,Vue .x 提 ...