代码:

%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 8.44.4 \n\n'); banner();
%% ------------------------------------------------------------------------
%%
%% Chebyshev-1 bandpass and highpass, parallel form,
%% by MATLAB toolbox function
%%
%% ------------------------------------------------------------------------ %--------------------------------------------------------
% PART1 bandpass
% Digital Filter Specifications: Chebyshev-1 bandpass
% -------------------------------------------------------
wsbp = [0.10*pi 0.60*pi]; % digital stopband freq in rad
wpbp = [0.20*pi 0.50*pi]; % digital passband freq in rad delta1 = 0.1;
delta2 = 0.01; Ripple = 1-delta1; % passband ripple in absolute
Attn = delta2; % stopband attenuation in absolute Rp = -20*log10(Ripple); % passband ripple in dB
As = -20*log10(Attn); % stopband attenuation in dB % Calculation of Chebyshev-1 filter parameters:
[N, wn] = cheb1ord(wpbp/pi, wsbp/pi, Rp, As);
fprintf('\n ********* Chebyshev-1 Digital Bandpass Filter Order is = %3.0f \n', 2*N) % Digital Chebyshev-1 Bandpass Filter Design:
fprintf('\n*******Digital bandpass, Coefficients of DIRECT-form***********\n');
[bbp, abp] = cheby1(N, Rp, wn) [C, B, A] = dir2cas(bbp, abp); % Calculation of Frequency Response:
[dbbp, magbp, phabp, grdbp, wwbp] = freqz_m(bbp, abp); % -----------------------------------------------------
% PART2 highpass
% Digital Highpass Filter Specifications:
% -----------------------------------------------------
wphp = 0.8*pi; % digital passband freq in rad
wshp = 0.7*pi; % digital stopband freq in rad delta1 = 0.05;
delta2 = 0.01; Ripple = 0.5-delta1; % passband ripple in absolute
Attn = delta2; % stopband attenuation in absolute Rp = -20*log10(Ripple/0.5); % passband ripple in dB
As = -20*log10(Attn/0.5); % stopband attenuation in dB % Calculation of Chebyshev-1 hp filter parameters:
[N, wn] = cheb1ord(wphp/pi, wshp/pi, Rp, As);
fprintf('\n********** Chebyshev-1 Digital Highpass Filter Order = %3.0f \n', N) % Digital Chebyshev-1 Highpass Filter Design:
fprintf('\n*******Digital Highpass, Coefficients of DIRECT-form***********\n');
[bhp, ahp] = cheby1(N, Rp, wn, 'high')
[C, B, A] = dir2cas(bhp*0.5, ahp); % Calculation of Frequency Response:
[dbhp, maghp, phahp, grdhp, wwhp] = freqz_m(bhp*0.5, ahp); % ---------------------------------------------
% PART3 parallel form of bp and hp
% ---------------------------------------------
abp;
bbp;
ahp;
bhp; a = conv(2*abp, ahp)
b = conv(2*bbp, ahp) + conv(bhp, abp)
[C, B, A] = dir2cas(b, a) % Calculation of Frequency Response:
[db, mag, pha, grd, ww] = freqz_m(b, a); %% -----------------------------------------------------------------
%% Plot
%% ----------------------------------------------------------------- figure('NumberTitle', 'off', 'Name', 'Problem 8.44.4 combination of Chebyshev-1 bp and hp, by MATLAB cheby1 function')
set(gcf,'Color','white');
M = 1; % Omega max subplot(2,2,1); plot(ww/pi, mag); 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, wsbp(1)/pi, wpbp/pi, wsbp(2)/pi, wshp/pi, wphp/pi, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.01, 0.45, 0.5, 0.9, 1]); subplot(2,2,2); plot(ww/pi, db); 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, wsbp(1)/pi, wpbp/pi, wsbp(2)/pi, wshp/pi, wphp/pi, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [-76, -46, -41, -1, 0]);
set(gca,'YTickLabelMode','manual','YTickLabel',['76'; '46'; '41';'1 ';' 0']); subplot(2,2,3); plot(ww/pi, pha/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, wsbp(1)/pi, wpbp/pi, wsbp(2)/pi, wshp/pi, wphp/pi, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [-1:0.5:1]); subplot(2,2,4); plot(ww/pi, grd); axis([0, M, 0, 80]); grid on;
xlabel('Digital frequency in \pi units'); ylabel('Samples'); title('Group Delay');
set(gca, 'XTickMode', 'manual', 'XTick', [0, wsbp(1)/pi, wpbp/pi, wsbp(2)/pi, wshp/pi, wphp/pi, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [0:20:80]); figure('NumberTitle', 'off', 'Name', 'Problem 8.44.4 Pole-Zero Plot')
set(gcf,'Color','white');
zplane(b, a);
title(sprintf('Pole-Zero Plot'));
%pzplotz(b,a); figure('NumberTitle', 'off', 'Name', 'Problem 8.44.4 combination of Chebyshev-1 bp and hp, by MATLAB cheby1 function')
set(gcf,'Color','white');
M = 1; % Omega max %subplot(2,2,1);
plot(ww/pi, mag); 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, wsbp(1)/pi, wpbp/pi, wsbp(2)/pi, wshp/pi, wphp/pi, M]);
set(gca, 'YTickMode', 'manual', 'YTick', [0, 0.01, 0.45, 0.5, 0.9, 1]);

  运行结果:

看设计要求,是Chebyshev-1型数字带通和高通滤波器的组合,首先计算带通。

系统函数直接形式系数如下:

其次计算高通,系统函数直接形式系数如下:

再次,前面计算完高通和带通后,二者进行并联组合。等效滤波器的系统函数,直接形式系数如下:

串联形式的系数如下:

零极点图

等效滤波器的幅度谱,相关幅度值、频带边界频率画出直线,如下图

《DSP using MATLAB》Problem 8.44的更多相关文章

  1. 《DSP using MATLAB》Problem 8.42

    代码: %% ------------------------------------------------------------------------ %% Output Info about ...

  2. 《DSP using MATLAB》Problem 8.40

    代码: function [wpLP, wsLP, alpha] = bs2lpfre(wpbs, wsbs) % Band-edge frequency conversion from bandst ...

  3. 《DSP using MATLAB》Problem 8.30

    10月1日,新中国70周岁生日,上午观看了盛大的庆祝仪式,整齐的方阵,先进的武器,尊敬的先辈英雄,欢乐的人们,愿我们的 国家越来越好,人民生活越来越好. 接着做题. 代码: %% ---------- ...

  4. 《DSP using MATLAB》Problem 7.33

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  5. 《DSP using MATLAB》Problem 7.27

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  6. 《DSP using MATLAB》Problem 7.26

    注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...

  7. 《DSP using MATLAB》Problem 7.25

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  8. 《DSP using MATLAB》Problem 7.24

    又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...

  9. 《DSP using MATLAB》Problem 7.23

    %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...

随机推荐

  1. delphi 文件的操作:重命名、复制、移动、删除

    Delphi 文件的操作:重命名.复制.移动.删除第一种方法: RenameFile('Oldname', 'Newname'); CopyFile(PChar('Oldname'), PChar(' ...

  2. Mac版本navicat premium彻底卸载的终端命令

    Mac版本navicat premium彻底卸载的终端命令: sudo rm -Rf /Applications/Navicat\ Premium.app sudo rm -Rf /private/v ...

  3. 使用PHP curl模拟浏览器抓取网站信息

    curl是一个利用URL语法在命令行方式下工作的文件传输工具.curl是一个利用URL语法在命令行方式下工作的文件传输工具.它支持很多协议:FTP, FTPS, HTTP, HTTPS, GOPHER ...

  4. 项目管理模式:外瀑布内敏捷(有人称为“信封法”)--转自知乎大神:CORNERSTONE

    作者:CORNERSTONE 链接:https://www.zhihu.com/question/265968122/answer/878124580 来源:知乎 著作权归作者所有.商业转载请联系作者 ...

  5. vue中配置可修改的服务器接口api

    https://www.jianshu.com/p/377bfd2d9034?utm_campaign 太坑了,找了全网,几乎都不能用,也不知道哪写错了,这个是可以用的.

  6. Linux上VNC 启动和关闭

    查询vnc的线程: [admin@cn2-uat-esb-01-0001 ~]$ ps -ef|grep vncadmin 19080 21305 0 10:04 pts/2 00:00:00 gre ...

  7. 4.2.1 Vector bit-select and part-select addressing

    Frm:IEEE Std 1364™-2001, IEEE Standard Verilog® Hardware Description Language Bit-selects extract a ...

  8. POJ 2451 Uyuw's Concert (半平面交)

    题目链接:POJ 2451 Problem Description Prince Remmarguts solved the CHESS puzzle successfully. As an awar ...

  9. JasperReports入门,JasperReports是什么?

    Jasper报表 报表开发过程中面临的常见故障归纳在以下几点: 核心变化:为了反映业务发生变化或改进它通常以改变报告的核心逻辑. 结果输出:有各种各样的格式,报表可导出到如:HTML,文本,PDF,M ...

  10. 线程创建后为什么要调用CloseHandle

    很多程序在创建线程都这样写的: ............ ThreadHandle = CreateThread(NULL,0,.....); CloseHandel(ThreadHandle );  ...