代码:

%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 6.22 \n\n'); banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%format long;
format short; fprintf('\n FIR filter DIRECT-form: \n');
h = [1, -4, 6.4, -5.12, 2.048, -0.32768]; b = h
a = 1.0 fprintf('\nConvert DIRECT-form to PARALLEL-form : \n');
[C, Bp, Ap] = dir2par(b, a) if size(C)==0
C = 0;
end fprintf('\nConvert DIRECT-form to CASCADE-form : \n');
[b0, Bc, Ac] = dir2cas(b, a) fprintf('\nConvert TF-form to SOS-form : \n');
[sos, g] = tf2sos(b, a) fprintf('\nConvert DIRECT-form to FREQUENCY-SAMPLE-form 1 : \n');
[Cfs, Bfs, Afs] = dir2fs(b) fprintf('\nConvert DIRECT-form to FREQUENCY-SAMPLE-form 2 : \n');
r = 0.99;
[Cfs_r, Bfs_r, Afs_r, rM] = dir2fs_r(b, r) % ----------------------------------------------------------
% NOTE: linear-phase can not use LATTICE-form
% ----------------------------------------------------------
fprintf('\nConvert DIRECT-form to All-Zero LATTICE-form : \n');
[Klc] = dir2latc(b) % -----------------------------------------
% START check
% -----------------------------------------
n = [0:7];
delta = impseq(0, 0, 7)
%format long
format short
hcas = casfiltr(b0, Bc, Ac, delta) hltc = latcfilt(Klc, delta) %hladr = ladrfilt(Klr, Clr, delta) hdir = filter(b, a, delta)
% -------------------------------------------
% END check
% ------------------------------------------- % +++++++++++++++++++++++++++++++++++++++++++++++++
% 5 1st-order section CASCADE-form
% +++++++++++++++++++++++++++++++++++++++++++++++++
broots = roots(b)
L = length(broots)
B1 = ones(L, 2); fprintf('\nConvert DIRECT-form to %d 1st-order section : \n', L);
for i = 1:1:L
B1(i,:) = poly( broots(i) );
end
B1 % +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
% CASCADE-form of 1 1st-order section and 2 2nd-order section
% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
fprintf('\nConvert DIRECT-form to One 1st-order and Two 2nd-order section: \n');
B2 = poly( [broots(1), broots(2)] )
B3 = poly( [broots(3), broots(4)] )
B4 = poly( broots(5) ) % +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
% CASCADE-form of 1 2nd-order section and 1 3rd-order section
% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
fprintf('\nConvert DIRECT-form to One 2nd-order and One 3rd-order section: \n');
B5 = poly( [broots(1), broots(2)] )
B6 = poly( [broots(3), broots(4), broots(5)] )

  运行结果:

直接形式的系数

串联形式系数

频率采样形式系数

格型Lattice形式系数

求出5个零点

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

  1. 《DSP using MATLAB》Problem 5.22

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% O ...

  2. 《DSP using MATLAB》 Problem 3.22

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

  3. 《DSP using MATLAB》Problem 8.22

    时光飞逝,亲朋会一个一个离我们远去,孤独漂泊一阵子后,我们自己也要离开, 代码: %% -------------------------------------------------------- ...

  4. 《DSP using MATLAB》Problem 7.25

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

  5. 《DSP using MATLAB》Problem 3.1

    先写DTFT子函数: function [X] = dtft(x, n, w) %% --------------------------------------------------------- ...

  6. 《DSP using MATLAB》Problem 7.29

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

  7. 《DSP using MATLAB》Problem 7.27

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

  8. 《DSP using MATLAB》Problem 7.26

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

  9. 《DSP using MATLAB》Problem 7.24

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

随机推荐

  1. jquery select使用

    <select class="selector"></select> 1) 设置选中值为pxx的选项 $('.selector').val('pxx'); ...

  2. redis系列--主从复制以及redis复制演进

    一.前言 在之前的文章已经详细介绍了redis入门基础已经持久化相关内容包括redis4.0所提供的混合持久化. 通过持久化功能,Redis保证了即使在服务器宕机情况下数据的丢失非常少.但是如果这台服 ...

  3. HTML(二)选择器

    1.id选择器 一对一关系 <div id="only">123</div> #only{ background-color:black; } 2.clas ...

  4. 国内npm镜像使用

    淘宝npm镜像 搜索地址:http://npm.taobao.org/ registry地址:http://registry.npm.taobao.org/ cnpmjs镜像 搜索地址:http:// ...

  5. IE浏览器兼容的处理方式之一,使用特殊的注释 <!--[if IE]> ....<![endif]-->

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. redis 五大数据类型之list篇

    1.lpush/lpop/rpop/rpush/lrange  这里的list就是链表,lpush就是从左往右插入数据,rpush就是从右往左插数据,lrange就是从左往右范围性的取值,pop就是弹 ...

  7. excel的操作

    python可以对excel进行写的操作,读的操作和修改的操作,做不同的功能需要导入不同的模块 1.对 excel进行写的操作 import xlwt book=xlwt.Workbook() #新建 ...

  8. position:sticky粘性布局

    新的布局方式,专门用于 tab栏悬浮效果: 当tab栏在可视区域时,正常滚动, tab栏不再可视区域时,悬浮置顶. position:-webkit-sticky; position:sticky; ...

  9. L299 EST 科技英语翻译-美学取向 (下)

    4. Ordering(有序美) DescriptiveExpositoryArgumentative Chinese: end focus 句尾焦点English: beginning focus ...

  10. alter system archive log current作用及和alter system switch logfile区别

    alter system archive log current 是归档当前的重做日志文件,不管自动归档有没有打都归档. alter system switch logfile 是强制日志切换,不一定 ...