代码:

%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 6.14 \n\n'); banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
H1_C = 2;
H1_a1 = [1 0.9 0.9]; H1_b1 = [0.2 -0.3];
H1_a2 = [1 -0.8 0.8]; H1_b2 = [0.4 0.5]; H2_a1 = [1 1.7 0.72]; H2_b1 = [2 1 -1];
H2_a2 = [1 -1.5 0.56]; H2_b2 = [3 4 5]; % ------------------------------------------------------
% 1st way to get a and b
% ------------------------------------------------------
H1_a = conv(H1_a1, H1_a2) H1_b11 = conv(H1_b1, H1_a2) + conv(H1_b2, H1_a1);
H1_b11 = [H1_b11 zeros(length(H1_a)-length(H1_b11))] H1_b = 2*H1_a + H1_b11 H2_b = conv(H2_b1, H2_b2)
H2_a = conv(H2_a1, H2_a2) format short;
fprintf('\n1st way to get DIRECT-form: \n');
a = conv(H1_a, H2_a)
b = conv(H1_b, H2_a) + conv(H2_b, H1_a) 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 LATTICE-LADDER-form : \n');
[Klr, Clr] = dir2ladr(b, a) fprintf('\nConvert DIRECT-form to MATLAB LATTICE-LADDER-form : \n');
[K, V] = tf2latc(b, a) % -----------------------------------------
% START check
% -----------------------------------------
n = [0:7];
delta = impseq(0, 0, 7)
%format long
format short
hcas = casfiltr(b0, Bc, Ac, delta) hpar = parfiltr(C, Bp, Ap, delta) hladr = ladrfilt(Klr, Clr, delta) hdir = filter(b, a, delta)
% -------------------------------------------
% END check
% ------------------------------------------- fprintf('\nConvert CASCADE-form to DIRECT-form: \n');
[b_c2d, a_c2d] = cas2dir(b0, Bc, Ac) fprintf('\nConvert SOS-form to TF-form : \n');
[b_s2t, a_s2t] = sos2tf(sos, g)

  运行结果:

直接形式系数

并联形式系数

串联形式系数

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

  1. 《DSP using MATLAB》Problem 7.14

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

  2. 《DSP using MATLAB》Problem 5.14

    说明:这两个小题的数学证明过程都不会,欢迎博友赐教. 直接上代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  3. 《DSP using MATLAB》Problem 4.14

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

  4. 《DSP using MATLAB》Problem 2.14

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

  5. 《DSP using MATLAB》Problem 8.14

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

  6. 《DSP using MATLAB》Problem 7.26

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

  7. 《DSP using MATLAB》Problem 6.8

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

  8. 《DSP using MATLAB》Problem 5.7

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

  9. 《DSP using MATLAB》Problem 7.27

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

随机推荐

  1. html <iframe>介绍

    iframe 元素会创建包含另外一个文档的内联框架 属性 值 描述 align left.right.top.middle.bottom 不赞成使用.请使用样式代替.规定如何根据周围的元素来对齐此框架 ...

  2. Win10系列:C#应用控件基础2

    HyperlinkButton控件 HyperlinkButton控件是以超链接文本形式显示的按钮,可以为其NavigateUri属性设置一个URI地址,当单击超链接文本按钮时,将会使用浏览器打开在H ...

  3. Java使用wait() notify()方法操作共享资源

    Java多个线程共享资源: 1)wait().notify()和notifyAll()方法是本地方法,并且为final方法,无法被重写. 2)调用某个对象的wait()方法能让当前线程阻塞,并且当前线 ...

  4. HTML编辑笔记3

    表单 1.语法 <form method="get|post" action="数据向哪提交的地址"> //表单内容 </form> 2 ...

  5. Mybatis的二级缓存注意点

    --声明:一下内容都不一定是正确的,只是自己测试的结果,请自己的动手操作得出自己的结论 1.开启Mybatis的二级缓存,不仅要在SqlMapConfig.xml中进行开启总开关,还要在对应的XXXM ...

  6. 外部点击链接,登陆后,直接跳转到该链接(过滤器 + Cookie实现)

    一.web.xml (1)指定过滤的Servlet类 (2)配置过滤规则,过滤以.mail结尾的链接 <?xml version="1.0" encoding="U ...

  7. 进程中的Manager(),实现多进程的数据共享与传递

    __author__ = "Alex Li" from multiprocessing import Process, Managerimport osdef f(d, l): d ...

  8. 7.7 C++基本关联式容器

    参考:http://www.weixueyuan.net/view/6404.html 总结: 基本的关联式容器主要有:set.multiset.map和multimap,这四种容器可以分为两组:ma ...

  9. <Java><Multi-thread><Lock interface>

    Overview 介绍java的lock interface. Motivation java拥有像synchronized这样的内置锁,那为什么还需要lock这样的外置锁呢? 首先,性能不是选择sy ...

  10. 关于 global nonlocal 用法

    # 1 关于 globals() locals() nolocl 还有内置函数的引用## 概念的解释# 命名空间# 1 局部命名空间:每一个函数都有自己的命名空间# 2 全局命名空间:写在函数外的变量 ...