《DSP using MATLAB》Problem 2.16

先由脉冲响应序列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的更多相关文章
- 《DSP using MATLAB》Problem 7.16
使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 4.16
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 6.16
从别的地方找来的: 截图有些乱. 结构流程图如下
- 《DSP using MATLAB》Problem 7.26
注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 5.10
代码: 第1小题: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Out ...
- 《DSP using MATLAB》Problem 4.11
代码: %% ---------------------------------------------------------------------------- %% Output Info a ...
- 《DSP using MATLAB》Problem 9.2
前几天看了看博客,从16年底到现在,3年了,终于看书到第9章了.都怪自己愚钝不堪,唯有吃苦努力,一点一点一页一页慢慢啃了. 代码: %% ------------------------------- ...
- 《DSP using MATLAB》Problem 8.31
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 8.29
来汉有一月,往日的高温由于最近几个台风沿海登陆影响,今天终于下雨了,凉爽了几个小时. 接着做题. %% ------------------------------------------------ ...
随机推荐
- cocos进阶教程(5)各种动画使用心得
Node类 不解释 ActionTimeline类是一个3.0时代的动画类, 案例一 //建立node方案一Data data = FileUtils::getInstance()->getDa ...
- 001-springmvc之原理图
1.流程. 2.时序图. 3.方法调用. (0)DispatcherServlet类.提供了HandlerMapping成员关联关系. /** MultipartResolver used by th ...
- jquery 添加列
{field:'action',title:'操作',width:70,align:'center', formatter:function(value,row,index){ if (row.e ...
- 最佳虚拟容器LXC
最佳虚拟容器LXC 和"真正的虚拟机环境"不同, "容器"(container)只能在Linux上虚拟Linux, 不能虚拟WIndows, 因为它不能虚拟硬件 ...
- 五,动态库(dll)的封装与使用
在项目开发中,我们经常会使用到动态库(dll),要么是使用别人的动态库,要么是将功能函数封装为动态库给别人用.那么如何封装和使用动态库呢?以下内容为你讲解. 1.动态库的封装 以vs2010为例,我们 ...
- zabbix-2.4.7环境部署与初始化安装
一.zabbix简介: zabbix的特点: - 安装与配置简单,学习成本低 - 支持多语言(包括中文) - 免费开源 - 自动发现服务器与网络设备 - 分布式监视以及WEB集中管理功能 - 可以无a ...
- ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory 【学习笔记】【原创】
作者:庄泽彬(欢迎转载,请注明作者) 说明:千辛万苦终于在ubuntu18.04上安装好cuda9.1与cudnn7.0.5,但是导入import tensorflow as tf却报了这个错误. 上 ...
- shell脚本中多个条件判断的语法
if [ "$content" = "hello" ]\ || [ "$content" = "kitty" ] the ...
- scrapy中的canonicalize_url【转】
转自:http://www.leyle.com/archives/canonicalize_url.html 思考一下:对url进行规范化处理是否是必须的?因为这一步处理涉及到编码转换,对于一个网页的 ...
- Qt5_TCP_Client01
ZC: 代码来自<<Qt及Qt Quick开发实战精解>>“代码\src\5\5-3”(“代码\src\5\5-4”里面的代码差不多,不知有何差别...貌似应该是更为完善) Z ...