先由脉冲响应序列h(n)得到差分方程系数,过程如下:

代码:

%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 2.16 \n\n'); banner();
%% ------------------------------------------------------------------------ %% ------------------------------------------------------
%% sequence of 51 samples
%% ------------------------------------------------------
nx1 = [-1:49]; x1 = (0.8 .^ nx1) .* stepseq(0, -1, 49);
nh1 = [-1:49]; h1 = ( (-0.9).^nh1 ) .* stepseq(0, -1, 49); [y1, ny1] = conv_m(x1, nx1, h1, nh1); figure('NumberTitle', 'off', 'Name', 'Problem 2.16')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色 subplot(3,1,1); stem(nx1, x1); title('x1 sequence');
xlabel('n'); ylabel('x(n)') ;
grid on
subplot(3,1,2); stem(nh1, h1); title('h1 sequence');
xlabel('n'); ylabel('h1(n)');
grid on;
subplot(3,1,3); stem(ny1, y1); title('y1=x1*h1 sequence');
xlabel('n'); ylabel('y1(n)');
grid on; %% -----------------------------------------------------
%% Trancate to 26 samples
%% -----------------------------------------------------
nx2 = [-1:24]; x2 = (0.8 .^ nx2) .* stepseq(0, -1, 24);
nh2 = [-1:24]; h2 = ( (-0.9).^nh2 ) .* stepseq(0, -1, 24); [y2, ny2] = conv_m(x2, nx2, h2, nh2); figure('NumberTitle', 'off', 'Name', 'Problem 2.16')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色 subplot(3,1,1); stem(nx2, x2); title('x2 sequence');
xlabel('n'); ylabel('x2(n)') ;
grid on
subplot(3,1,2); stem(nh2, h2); title('h2 sequence');
xlabel('n'); ylabel('h2(n)');
grid on;
subplot(3,1,3); stem(ny2, y2); title('y2=x2*h2 sequence');
xlabel('n'); ylabel('y2(n)');
grid on; %% ----------------------------------------------------------
%% filter function
%% ----------------------------------------------------------
b = [1]; a = [1, 0.9]; y3 = filter(b, a, x1); figure('NumberTitle', 'off', 'Name', 'Problem 2.16')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色 %subplot(3,1,3);
stem(nx1, y3); title('y3 sequence');
xlabel('n'); ylabel('y3(n)');
grid on;

  运行结果:

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

  1. 《DSP using MATLAB》Problem 7.16

    使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  2. 《DSP using MATLAB》Problem 4.16

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

  3. 《DSP using MATLAB》Problem 6.16

    从别的地方找来的: 截图有些乱. 结构流程图如下

  4. 《DSP using MATLAB》Problem 7.26

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

  5. 《DSP using MATLAB》Problem 5.10

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

  6. 《DSP using MATLAB》Problem 4.11

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

  7. 《DSP using MATLAB》Problem 9.2

    前几天看了看博客,从16年底到现在,3年了,终于看书到第9章了.都怪自己愚钝不堪,唯有吃苦努力,一点一点一页一页慢慢啃了. 代码: %% ------------------------------- ...

  8. 《DSP using MATLAB》Problem 8.31

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

  9. 《DSP using MATLAB》Problem 8.29

    来汉有一月,往日的高温由于最近几个台风沿海登陆影响,今天终于下雨了,凉爽了几个小时. 接着做题. %% ------------------------------------------------ ...

随机推荐

  1. VS2010/MFC编程入门之二十八(常用控件:列表视图控件List Control 上)

    前面一节中,鸡啄米讲了图片控件Picture Control,本节为大家详解列表视图控件List Control的使用.      列表视图控件简介 列表视图控件List Control同样比较常见, ...

  2. EF Code First 学习笔记:表映射(转)

      多个实体映射到一张表 Code First允许将多个实体映射到同一张表上,实体必须遵循如下规则: 实体必须是一对一关系 实体必须共享一个公共键 观察下面两个实体: public class Per ...

  3. Conductor

    https://netflix.github.io/conductor/ High Level Architecture

  4. nodejs+express工程 在npm install之后或使用npm install bootstrap命令安装bootstrap之后

    nodejs+express工程 在npm install之后或使用npm install bootstrap命令安装bootstrap之后引入bootstrap文件 如果你的静态资源存放在多个目录下 ...

  5. iOS重签名脚本

    unzip xxx.ipa //解压ipa rm -rf Payload/ xxx.app/_CodeSignature //删除旧签名 cp newEmbedded.mobileprovision ...

  6. 《C++ Concurrency in Action》

    http://wiki.jikexueyuan.com/project/cplusplus-concurrency-action/content/resources/resource.html

  7. Python3基础 判断变量大于一个数并且小于另外一个数

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  8. POJ 3613 Cow Relays(floyd+快速幂)

    http://poj.org/problem?id=3613 题意: 求经过k条路径的最短路径. 思路: 如果看过<矩阵乘法在信息学的应用>这篇论文就会知道 现在我们在邻接矩阵中保存距离, ...

  9. TreeMap的应用

    public class SortedMap { //treemap按key排序,默认是升序,可自定义降序 public static void main(String[] args) { Map&l ...

  10. 解决Error: ENOENT: no such file or directory, scandir 安装node-sass报错

    新项目开发需要安装依赖,但是安装完之后通过gulp运行项目,产生了一下的报错: 解决方案是执行一些方法: npm rebuild node-sass 可是有时就是网络问题导致上面命令安装失败,查下失败 ...