《DSP using MATLAB》Problem 8.17
代码:
%% ------------------------------------------------------------------------
%% 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型低通滤波器,串联形式系数
幅度谱、相位谱和脉冲响应
幅度谱进行放大
《DSP using MATLAB》Problem 8.17的更多相关文章
- 《DSP using MATLAB》Problem 6.17
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 5.17
1.代码 %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% ...
- 《DSP using MATLAB》Problem 3.17
用差分方程两边进行z变换,再变量带换得到频率响应函数(或转移函数,即LTI系统脉冲响应的DTFT). 代码: %% ------------------------------------------ ...
- 《DSP using MATLAB》Problem 2.17
1.代码: %% ------------------------------------------------------------------------ %% Output Info abo ...
- 《DSP using MATLAB》Problem 4.17
- 《DSP using MATLAB》Problem 5.22
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% O ...
- 《DSP using MATLAB》Problem 5.15
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 2.18
1.代码: function [y, H] = conv_tp(h, x) % Linear Convolution using Toeplitz Matrix % ----------------- ...
- 《DSP using MATLAB》Problem 7.28
又是一年五一节,朋友圈都是晒名山大川的,晒脑袋的,我这没钱的待在家里上网转转吧 频率采样法设计带通滤波器,过渡带中有一个样点 代码: %% ++++++++++++++++++++++++++++++ ...
随机推荐
- WinDbg神断点
https://blogs.msdn.microsoft.com/alejacma/2007/10/31/cryptoapi-tracer-script/ 我得多少年才能学会这种写法.
- 小白 Linux下安装Elasticsearch5.X
最近做个项目需要使用到 Elasticsearch5 刚接触liunx 遇到了很多问题记录下 以这篇文章为基础 http://www.cnblogs.com/ShawnYuki/p/6818677.h ...
- The linux command之高级键盘技巧
一.光标移动 二.修改文本 三.剪切和粘贴文本 四.使用历史命令
- Caused by: android.view.InflateException: Binary XML file line #18: Binary XML file line #18: Error inflating class android.widget.CheckedTextView
困扰了我一天啊 终于吧 这个大bug 给解决掉了 可能是 当时懵逼了 竟然忘记重新构造了!!尴尬了 直接把项目的 build 文件删除重新构造了一边!!
- layui实现已知被选中的option,怎样渲染
在项目中用到layui实现第几个option 实现,在select中渲染出需要展示的option 代码: $("#period option[value="+res.data.se ...
- 关于FR4板一些重复的数据
介电常数:4.2-4.7 信号传输速度:表层 140~170 ps/inch, 内层 180 ps/inch
- [JZOJ3348] 【NOI2013模拟】秘密任务
题目 题目大意 给你一个无向图,你要割掉一些边使得\(1\)到\(n\)的所有最短路径被阻截. 割掉一个边\((u,v)\)的代价为\(a_u\)或\(a_v\)(记为两种不同的方案). 问最小代价及 ...
- identifier of an instance of xx.entity was altered from xxKey@249e3cb2 to xxKey@74e8f4a3; nested exception is org.hibernate.HibernateException: identifier of an instance of xxentity was altered from错误
用entityManager保存数据时报错如下 identifier of an instance of xx.entity was altered from xxKey@249e3cb2 to xx ...
- 应用程序正常初始化(0xc0150002)失败的终极解决方案
转自VC错误:http://www.vcerror.com/?p=62 最近做一个项目写了一个VC6下的MFC程序,结果传到别人的机子上(WIN7)出现了应用程序正常初始化(0xc0150002)失败 ...
- iOS开发Drag and Drop简介
1.Drag and Drop简介 Drag and Drop是iOS11的新特性,可以将文本.图片进行拖拽到不同app中,实现数据的传递.只不过只能在iPad上使用,iPhone上只能app内部拖拽 ...