DSP using MATLAB》Problem 8.16

代码:
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 8.16 \n\n'); banner();
%% ------------------------------------------------------------------------ Wp = 20*pi; Ws = 30*pi; Rp = 0.25; As = 50;
Fp = Wp/(2*pi);
Fs = Ws/(2*pi); Ripple = 10 ^ (-Rp/20)
Attn = 10 ^ (-As/20) % Analog filter design, DIRECT form:
[b, a] = afd('cheby1', 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, 35*pi); % Calculation of Impulse Response:
[ha, x, t] = impulse(b, a); %% -------------------------------------------------
%% Plot
%% ------------------------------------------------- figure('NumberTitle', 'off', 'Name', 'Problem 8.16 Lowpass Analog Chebyshev-2')
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', [-30, -20, 0, 20, 30]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.003, 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', [-30, -20, 0, 20, 30]);
set(gca, 'YTickMode', 'manual', 'YTick', [-70, -50, -1, 0]);
set(gca,'YTickLabelMode','manual','YTickLabel',['70';'50';' 1';' 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', [-30, -20, 0, 20, 30]);
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型低通滤波器,系统函数直接形式系数

模拟chebyshev-2原型低通滤波器,幅度谱、相位谱和脉冲响应

放大幅度谱

DSP using MATLAB》Problem 8.16的更多相关文章
- 《DSP using MATLAB》Problem 7.16
使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 4.16
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 2.16
先由脉冲响应序列h(n)得到差分方程系数,过程如下: 代码: %% ------------------------------------------------------------------ ...
- 《DSP using MATLAB》Problem 6.16
从别的地方找来的: 截图有些乱. 结构流程图如下
- 《DSP using MATLAB》Problem 7.26
注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 5.10
代码: 第1小题: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Out ...
- 《DSP using MATLAB》Problem 4.11
代码: %% ---------------------------------------------------------------------------- %% Output Info a ...
- 《DSP using MATLAB》Problem 9.2
前几天看了看博客,从16年底到现在,3年了,终于看书到第9章了.都怪自己愚钝不堪,唯有吃苦努力,一点一点一页一页慢慢啃了. 代码: %% ------------------------------- ...
- 《DSP using MATLAB》Problem 8.31
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
随机推荐
- Activiti学习笔记10 — 动态任务分配
动态任务分配使用的两种方式 一.通过特殊表达式,来获取任务信息 ,在流程 UserTask节点上设置 ${流程变量的Key} 1.流程定义 <?xml version="1.0&quo ...
- js实现图片资源、blob、base64的各种场景转换
文件转babase64 function getImgToBase64(url,callback){//将图片转换为Base64 var canvas = document.createElement ...
- iOS开发系列-HTTPS
HTTPS 网景在1994年创建了HTTPS,并应用在网景导航者浏览器中. 最初,HTTPS是与SSL一起使用的:在SSL逐渐演变到TLS. HTTPS协议与HTTP协议的一些不同: http是超文本 ...
- JS函数 函数的作用,可以写一次代码,然后反复地重用这个代码。
什么是函数 函数的作用,可以写一次代码,然后反复地重用这个代码. 如:我们要完成多组数和的功能. var sum; sum = 3+2; alert(sum); sum=7+8 ; alert(sum ...
- 【学术篇】bzoj3262 陌上花开. cdq分治入门
花儿们已经很累了-- 无论是花形.颜色.还是气味, 都不是为了给人们摆出来欣赏的, 更不是为了当做出题的素材的, 她们并不想自己这些属性被没有生命的数字量化, 并不想和其它的花攀比, 并无意分出个三六 ...
- Altera设置Virtual Pin
1,GUI方式 大家都知道的,assignment editor –> category –> logic options –> to –> virtual pin –> ...
- 廖雪峰Java16函数式编程-1Lambda表达式-1Lambda基础
1. 函数式编程 Java有2类方法: 实例方法:通过实例调用 静态方法:通过类名调用 Java的方法相当于过程式语言的函数 函数式编程(Functional Programing): 把函数作为基本 ...
- 异或前缀和——cf1186C
很思维的题,b的1个数和c的1个数相差为偶数时,必定有偶数个不同 反之必定有奇数个不同 #include <iostream> #include <cstdlib> #incl ...
- POJ 3134 - Power Calculus
迭代加深 //Twenty #include<cstdio> #include<cstdlib> #include<iostream> #include<al ...
- 委托_deleget
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...