只会做前两个,

代码:

  1. %% ----------------------------------------------------------------------------
  2. %% Output Info about this m-file
  3. fprintf('\n***********************************************************\n');
  4. fprintf(' <DSP using MATLAB> Problem 4.15 \n\n');
  5.  
  6. banner();
  7. %% ----------------------------------------------------------------------------
  8.  
  9. %% ----------------------------------------------------
  10. %% 1 h(n)=[5(0.25)^n]u(n)
  11. %% x(n)=(0.25^n)u(n)
  12. %% ----------------------------------------------------
  13. n = [0:9];
  14.  
  15. h1 = 5 * (1/4) .^ n .* stepseq(0, 0, 9);
  16. x = (1/4) .^ n;
  17.  
  18. figure('NumberTitle', 'off', 'Name', 'Problem 4.15 h1(n) x(n)')
  19. set(gcf,'Color','white');
  20. subplot(2,1,1); stem(n, h1);
  21. xlabel('n'); ylabel('h(n)'); grid on;
  22. title('h(n)=[5(1/4)^n]u(n)');
  23. subplot(2,1,2); stem(n, x);
  24. xlabel('n'); ylabel('x'); grid on;
  25. title('x(n)=(1/4)^nu(n)');
  26.  
  27. b1 = [5]; a1 = [1, -1/4];
  28.  
  29. figure('NumberTitle', 'off', 'Name', 'Problem 4.15 H1(z) pole-zero')
  30. set(gcf,'Color','white');
  31. zplane(b1, a1);
  32. title('pole-zero plot'); grid on;
  33.  
  34. y1 = filter(b1, a1, x);
  35.  
  36. [y1_chk, ny1_chk] = conv_m(h1, n, x, n);
  37.  
  38. figure('NumberTitle', 'off', 'Name', 'Problem 4.15 y1(n)')
  39. set(gcf,'Color','white');
  40. subplot(2,1,1); stem([0:length(y1)-1], y1);
  41. xlabel('n'); ylabel('h(n)'); grid on;
  42. title('y(n)=filter(b, a, x)');
  43. subplot(2,1,2); stem(ny1_chk, y1_chk);
  44. xlabel('n'); ylabel('y'); grid on;
  45. title('y(n)=h(n)*x(n)');
  46.  
  47. %% ----------------------------------------------------
  48. %% 2 h(n)=[n(1/3)^n+(-1/4)^n]u(n)
  49. %% x(n)=(0.25^n)u(n)
  50. %% ----------------------------------------------------
  51. n = [0:9];
  52.  
  53. h2 = (n .* (1/3) .^ n + (-1/4) .^ n ) .* stepseq(0, 0, 9);
  54. x = (1/4) .^ n;
  55.  
  56. figure('NumberTitle', 'off', 'Name', 'Problem 4.15 h2(n) x(n)')
  57. set(gcf,'Color','white');
  58. subplot(2,1,1); stem(n, h2);
  59. xlabel('n'); ylabel('h(n)'); grid on;
  60. title('h(n)=[n(1/3)^n]u(n) + (-1/4)^nu(n)');
  61. subplot(2,1,2); stem(n, x);
  62. xlabel('n'); ylabel('x'); grid on;
  63. title('x(n)=(1/4)^nu(n)');
  64.  
  65. %b2 = [0, 12, 48, -1]; a2 = [144, -24, -23, 2, 1];
  66. b2 = [1, -1/3, 7/36]; a2 = [1, -5/12, -1/18, 1/36];
  67.  
  68. figure('NumberTitle', 'off', 'Name', 'Problem 4.15 H2(z) pole-zero')
  69. set(gcf,'Color','white');
  70. zplane(b2, a2);
  71. title('pole-zero plot'); grid on;
  72.  
  73. y2 = filter(b2, a2, x);
  74.  
  75. [y2_chk, ny2_chk] = conv_m(h2, n, x, n);
  76.  
  77. figure('NumberTitle', 'off', 'Name', 'Problem 4.15 y2(n)')
  78. set(gcf,'Color','white');
  79. subplot(2,1,1); stem([0:length(y2)-1], y2); axis([0, 9, 0, 1]);
  80. xlabel('n'); ylabel('h(n)'); grid on;
  81. title('y(n)=filter(b, a, x)');
  82. subplot(2,1,2); stem(ny2_chk, y2_chk); axis([0, 9, 0, 1]);
  83. xlabel('n'); ylabel('y'); grid on;
  84. title('y(n)=h(n)*x(n)');

  运行结果:

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

  1. 《DSP using MATLAB》Problem 7.15

    用Kaiser窗方法设计一个台阶状滤波器. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  2. 《DSP using MATLAB》Problem 6.15

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

  3. 《DSP using MATLAB》Problem 5.15

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

  4. 《DSP using MATLAB》Problem 2.15

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

  5. 《DSP using MATLAB》Problem 8.15

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

  6. 《DSP using MATLAB》Problem 5.38

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

  7. 《DSP using MATLAB》Problem 5.31

    第3小题: 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Out ...

  8. 《DSP using MATLAB》Problem 5.22

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

  9. 《DSP using MATLAB》Problem 5.21

    证明: 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

随机推荐

  1. .NET中使用Rabbit MQ

    1.通过Nuget 获取Rabbit MQ NET client bindings from NuGet: PM> Install-Package RabbitMQ.Client 2.发送者(生 ...

  2. Confluence 6 选项 2 – 转移 Crowd/Jira 应用程序中的用户和用户组到 Confluence 数据库

    当你打算合并的外部目录服务器(Crowd 或 Jira 应用)有大量的用户到 Confluence 数据库中的时候,请使用这个选项.你需要有基本的 SQL 知识才能完成这个任务. 下面的 SQL 命令 ...

  3. laravel实现定时器功能

    前记 laravel实现定时器功能有两种方法: 1. 使用 command . 2.   在闭包函数内写实现的方法. 在这里我比较推荐第一种方法,因为第一种方法把具体的实现抽离出来了,看起来简单且富有 ...

  4. UVA-1629 Cake slicing (DP、记忆化搜索)

    题目大意:一块n*m的矩形蛋糕,有k个草莓,现在要将蛋糕切开使每块蛋糕上都恰有一个(这意味着不能切出不含草莓的蛋糕块)草莓,要求只能水平切或竖直切,求最短的刀切长度. 题目分析:定义状态dp(xa,y ...

  5. django url 使用总结

    1 无参数情况 配置URL及其视图如下: (r'^hello/$', hello) def hello(request): return HttpResponse("Hello World& ...

  6. 数据仓库建模与ETL的实践

    一.Data仓库的架构 Data仓库(Data Warehouse DW)是为了便于多维分析和多角度展现而将Data按特定的模式进行存储所建立起来的关系型Datcbase,它的Data基于OLTP源S ...

  7. pip install flask 安装失败

    地址:http://www.zhihu.com/question/21492455

  8. scrapy-redis介绍(一)

    scrapy是python里面一个非常完善的爬虫框架,实现了非常多的功能,比如内存检测,对象引用查看,命令行,shell终端,还有各种中间件和扩展等,相信开发过scrapy的朋友都会觉得这个框架非常的 ...

  9. Thinkphp5 微信公众号token验证不成功的原因

    最近要启动微信项目,上个月就开始了解微信的开发,这个月要启动项目,配置微信公众号信息一直失败.为此,我甚至手工写了微信提交过来的记录,如: &timestamp=1510210523& ...

  10. Python mode_r

    f = open("例子.txt",mode="r",encoding="utf-8") print(f.read(5)) # 读取5个字符 ...