代码:

  1. %% ------------------------------------------------------------------------
  2. %% Output Info about this m-file
  3. fprintf('\n***********************************************************\n');
  4. fprintf(' <DSP using MATLAB> Problem 4.18 \n\n');
  5.  
  6. banner();
  7. %% ------------------------------------------------------------------------
  8.  
  9. % ---------------------------------------
  10. % 1 H1(z)
  11. % ---------------------------------------
  12.  
  13. b = 1/4*[1, 2, 0, 1]; a = [1]; %
  14.  
  15. [R, p, C] = residuez(b,a)
  16.  
  17. Mp = (abs(p))'
  18. Ap = (angle(p))'/pi
  19.  
  20. %% ----------------------------------------------
  21. %% START a determine H(z) and sketch
  22. %% ----------------------------------------------
  23. figure('NumberTitle', 'off', 'Name', 'P4.18.1 H(z) its pole-zero plot')
  24. set(gcf,'Color','white');
  25. zplane(b,a);
  26. title('pole-zero plot'); grid on;
  27.  
  28. %% ----------------------------------------------
  29. %% END
  30. %% ----------------------------------------------
  31.  
  32. % ------------------------------------
  33. % y1(n) Output
  34. % ------------------------------------
  35. yb1 = conv(b, [2]);
  36. ya1 = conv(a, [1,-0.9]);
  37.  
  38. [R1, p1, C1] = residuez(yb1, ya1)
  39.  
  40. Mp = (abs(p1))'
  41. Ap = (angle(p1))'/pi
  42.  
  43. [delta, n] = impseq(0, 0, 7);
  44. y1_check = filter(yb1, ya1, delta) % check sequence
  45.  
  46. y1_answer = -1.7970*impseq(0,0,7) - 0.6173*impseq(1,0,7) - 0.5556*impseq(2,0,7) + 2.2970*(0.9).^n .* stepseq(0,0,7) % answer sequence

  运行结果:

只做第1小题了,后面的多少有些出入之处,以后有机会补上。

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

  1. 《DSP using MATLAB》Problem 6.18

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

  2. 《DSP using MATLAB》Problem 5.18

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

  3. 《DSP using MATLAB》Problem 3.18

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

  4. 《DSP using MATLAB》Problem 2.18

    1.代码: function [y, H] = conv_tp(h, x) % Linear Convolution using Toeplitz Matrix % ----------------- ...

  5. 《DSP using MATLAB》Problem 8.18

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

  6. 《DSP using MATLAB》Problem 5.15

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

  7. 《DSP using MATLAB》Problem 4.15

    只会做前两个, 代码: %% ---------------------------------------------------------------------------- %% Outpu ...

  8. 《DSP using MATLAB》Problem 7.27

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

  9. 《DSP using MATLAB》Problem 7.26

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

随机推荐

  1. [Java代码] Java是自学好还是参加培训班好?

    ava 是由Sun Microsystems公司于1995年5月推出的高级程序设计语言. Java可运行于多个平台,如Windows, Mac OS,及其他多种UNIX版本的系统. 本教程给大家简单介 ...

  2. WebView 实现JS效果和a标签的点击事件

    目前很多android app都可以显示web页面的界面,嵌入式开发,这个界面一般都是WebView这个控件加载出来的,学习该控件可以为你的app开发提升扩展性. 先说下WebView的一些优点: 可 ...

  3. GitHub出现Permissiondenied (publickey).

    cd ~/.ssh ssh -T git@github.com 出现Permission denied(publickey).意思表示缺少公钥. ssh-keygen -t rsa -C " ...

  4. Python装饰器、生成器、内置函数、json

    这周学习了装饰器和生成器,写下博客,记录一下装饰器和生成器相关的内容. 一.装饰器 装饰器,这个器就是函数的意思,连起来,就是装饰函数,装饰器本身也是一个函数,它的作用是用来给其他函数添加新功能,比如 ...

  5. Leetcode 89

    回溯写到自闭:不想就删了: class Solution { public: vector<int> grayCode(int n) { vector<vector<int&g ...

  6. POJ 3481 SBT做法

    第三次做此题.. 不解释啦. 不过变成用SBT来做啦! SBT好处在于能够保证树的高度为lgn,真真正正的平衡二叉树. 因此删除,插入操作与普通二叉树几乎相同. #include <cstdio ...

  7. Intel DAAL AI加速 ——传统决策树和随机森林

    # file: dt_cls_dense_batch.py #===================================================================== ...

  8. Openwrt TF Card Auto Mount&Check (4)

    1      Scope of Document This document describes tf card bootup auto do file system check when mount ...

  9. File storage location distribution in firmware using binwalk

    tool function: Binwalk is a fast, easy to use tool for analyzing, reverse engineering, and extractin ...

  10. LTrim、RTrim 和 Trim 函数

    返回不带前导空格 (LTrim).后续空格 (RTrim) 或前导与后续空格 (Trim) 的字符串副本. LTrim(string) RTrim(string) Trim(string) strin ...