《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
又是一年五一节,朋友圈都是晒名山大川的,晒脑袋的,我这没钱的待在家里上网转转吧 频率采样法设计带通滤波器,过渡带中有一个样点 代码: %% ++++++++++++++++++++++++++++++ ...
随机推荐
- css布局-瀑布流的实现
一.基本思路 1.先看最终的效果图: 2.实现原理:通过position:absolute(绝对定位)来定位每一个元素的位置,并且将当前列的高度记录下来方便下一个dom位置的计算 二.代码实现 1.版 ...
- Ajax.BeginForm 在 Chrome下的问题
项目背景:MVC4 代码: @using (Ajax.BeginForm("Index", "GoingMeter", new AjaxOptions { On ...
- Hive系统架构
- Java中的API方法总结
API方法总结 File file = new File(path); #创建文件对象,指向一个目录 file.exists() #判断目录或者文件是否存在 File[] files = file.l ...
- 推荐一个Java设计模式写的很好的博客
博客地址:https://quanke.gitbooks.io/design-pattern-java/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1%E8%AE%BE%E8 ...
- JavaScript - 判断当前使用的浏览器类型
<script> window.onload = function() { // 判断当前使用的浏览器类型 var browserType = navigator.userAgent.to ...
- LUOGU P2564 [SCOI2009]生日礼物 (队列+模拟)
传送门 解题思路 还是比较好想的,用一个队列,然后把所有点放在一起排个序,依次入队.每次检查队头元素的种类是否为当前入队元素种类,是的话就一直\(pop\),每次更新答案即可. 代码 #include ...
- 修改Chrome的UserAgent
修改Chrome的UserAgent 直接在chrome商店中搜索user-agent switcher 打开chrome 商店,搜索 user-agent switcher 点击免费, 然后执行 ...
- echarts 默认柱状图每根柱子显示不同颜色(随机显示和定制显示)
series: [{ name: '请求数', type: 'bar', //barGap: 60, barWidth: 140,//柱图宽度 //stack: 'sum',//堆叠效果 itemSt ...
- hibernate annotation 之 注解声明
@Entity 将一个 POJO 类注解成一个实体 bean ( 持久化 POJO 类 ) @Table 为实体 bean 映射指定具体的表,如果该注解没有被声明,系统将使用默认值 ( 即实体 bea ...