《DSP using MATLAB》Problem 8.37

代码:
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 8.37 \n\n'); banner();
%% ------------------------------------------------------------------------ % Digital Filter Specifications: Chebyshev-2 bandpass
ws = [0.30*pi 0.60*pi]; % digital stopband freq in rad
wp = [0.40*pi 0.50*pi]; % digital passband freq in rad
Rp = 0.50; % passband ripple in dB
As = 50; % stopband attenuation in dB Ripple = 10 ^ (-Rp/20) % passband ripple in absolute
Attn = 10 ^ (-As/20) % stopband attenuation in absolute % Calculation of Chebyshev-2 filter parameters:
[N, wn] = cheb2ord(wp/pi, ws/pi, Rp, As); fprintf('\n ********* Chebyshev-2 Digital Bandpass Filter Order is = %3.0f \n', 2*N) % Digital Chebyshev-2 Bandpass Filter Design:
[bbp, abp] = cheby2(N, As, wn); [C, B, A] = dir2cas(bbp, abp) % Calculation of Frequency Response:
%[dblp, maglp, phalp, grdlp, wwlp] = freqz_m(blp, alp);
[dbbp, magbp, phabp, grdbp, wwbp] = freqz_m(bbp, abp); % ---------------------------------------------------------------
% find Actual Passband Ripple and Min Stopband attenuation
% ---------------------------------------------------------------
delta_w = 2*pi/1000;
Rp_bp = -(min(dbbp(ceil(wp(1)/delta_w+1):1:ceil(wp(2)/delta_w+1)))); % Actual Passband Ripple fprintf('\nActual Passband Ripple is %.4f dB.\n', Rp_bp); As_bp = -round(max(dbbp(1:1:ceil(ws(1)/delta_w)+1))); % Min Stopband attenuation
fprintf('\nMin Stopband attenuation is %.4f dB.\n\n', As_bp); %% -----------------------------------------------------------------
%% Plot
%% ----------------------------------------------------------------- figure('NumberTitle', 'off', 'Name', 'Problem 8.37 Chebyshev-2 bp by cheby2 function')
set(gcf,'Color','white');
M = 1; % Omega max subplot(2,2,1); plot(wwbp/pi, magbp); axis([0, M, 0, 1.2]); grid on;
xlabel('Digital frequency in \pi units'); ylabel('|H|'); title('Magnitude Response');
set(gca, 'XTickMode', 'manual', 'XTick', [0, 0.3, 0.4, 0.5, 0.6, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.9441, 1]); subplot(2,2,2); plot(wwbp/pi, dbbp); axis([0, M, -100, 2]); grid on;
xlabel('Digital frequency in \pi units'); ylabel('Decibels'); title('Magnitude in dB');
set(gca, 'XTickMode', 'manual', 'XTick', [0, 0.3, 0.4, 0.5, 0.6, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [-80, -50, -1, 0]);
set(gca,'YTickLabelMode','manual','YTickLabel',['80'; '50';'1 ';' 0']); subplot(2,2,3); plot(wwbp/pi, phabp/pi); axis([0, M, -1.1, 1.1]); grid on;
xlabel('Digital frequency in \pi nuits'); ylabel('radians in \pi units'); title('Phase Response');
set(gca, 'XTickMode', 'manual', 'XTick', [0, 0.3, 0.4, 0.5, 0.6, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [-1:0.5:1]); subplot(2,2,4); plot(wwbp/pi, grdbp); axis([0, M, 0, 40]); grid on;
xlabel('Digital frequency in \pi units'); ylabel('Samples'); title('Group Delay');
set(gca, 'XTickMode', 'manual', 'XTick', [0, 0.3, 0.4, 0.5, 0.6, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [0:10:40]);
运行结果:
通带、阻带绝对指标

用cheby2函数(MATLAB自带),设计数字低通原型滤波器,阶数为5,系统函数串联形式的系数为

Chebyshev-2型数字低通,幅度谱、相位谱和群延迟响应

《DSP using MATLAB》Problem 8.37的更多相关文章
- 《DSP using MATLAB》Problem 5.37
证明过程: 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.37
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 8.32
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 7.36
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.27
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.26
注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.25
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.24
又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.23
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...
随机推荐
- js实现正则判断手机号
//判断是否为手机号的正则表达式 function phoneFun(phones){ var myreg = /^[1][3,4,5,7,8,9][0-9]{9}$/; if (!myreg.tes ...
- prufer序列的性质及相关结论
- leetcode-158周赛-5222-分割字符串
题目描述: 自己的提交: class Solution: def balancedStringSplit(self, s: str) -> int: if not s:return 0 res ...
- delphi xe10 网络文件传送
//网络传送文件(类似Server/Client) TTetheringManager|设备管理.TTetheringAppProfile|文件发送 待补充
- JavaWeb学习篇之----Session&&Cookie
今天继续来看看JavaWeb的相关知识,这篇文章主要来讲一下Session和Cookie的相关知识,首先我们来看一下Cookie的相关知识: 一.Cookie 简介: Cookie是客户端技术,服务器 ...
- Windows路径操作API函数学习【转载】
文章出自https://www.cnblogs.com/MakeView660/p/6644838.html 前言 在VC++开发过程中,经常需要用到一些路径操作,比如拼需要的文件路径,搜索路径中的内 ...
- oracle一体机(exdata)创建ACFS文件系统
ACFS是一个支持多个平台,可扩展的,基于ORACLE ASM的集群文件系统,可以用来存储数据库和各种应用的文件,包括数据库的trace文件,alert日志文件和配置文件等等,也可以用来存储视频,音频 ...
- TCP之1460MSS和1448负载
TCP和1448 1448字节是实际场景下,单个TCP包的实际运载能力.也就是说,实际场景下,上层调用send(1000KB),下层会把这1000KB封装成多个TCP包进行发送.单个TCP包每次打包1 ...
- scala中闭包的使用
闭包的实质就是代码与用到的非局部变量的混合,即: 闭包 = 代码 + 用到的非局部变量 实例1: 匿名函数中引入闭包 val multiplier = (i:Int) => i * factor ...
- java程序——CPU过高100%及内存泄露排查
CPU过高 这类问题可以使用 top 命令观察一些,CPU 是不是都被 Java 程序占用了.比如下面这个截图: 服务器的 CPU 大多都被 Java 占用了.这正是我们之前生产上 CPU 过高的一个 ...