《DSP using MATLAB》Problem 2.19

代码:
%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 2.19 \n\n'); banner();
%% ------------------------------------------------------------------------ b = [1, 2, 0, 1]; a = [1, -0.5, 0.25];
n = [0:100]; h1 = impz(b, a, n); x = impseq(0, 0, 100); h2 = filter(b, a, x); figure('NumberTitle', 'off', 'Name', 'Problem 2.19 Impulse response')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色 subplot(2,1,1); stem(n, h1); title('impz function');
xlabel('n'); ylabel('h1(n)') ;
grid on
subplot(2,1,2); stem(n, h2); title('filter function');
xlabel('n'); ylabel('h2(n)');
grid on; %% ---------------------------------------------
%% stability
%% --------------------------------------------- fprintf('\n1st impz : sum(abs(h)) = %f \n', sum(abs(h1)));
fprintf('\n2nd filter: sum(abs(h)) = %f \n', sum(abs(h2))); figure('NumberTitle', 'off', 'Name', 'Problem 2.19 Zero-Pole')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
pzmap(b, a); z = roots(a); magz = abs(z) %% --------------------------------------
%% another input
%% --------------------------------------
n2 = [0:200];
x2 = (5 + 3*cos(0.2*pi*n2) + 4*sin(0.6*pi*n2)) .* stepseq(0, 0, 200); y2 = filter(b, a, x2); figure('NumberTitle', 'off', 'Name', 'Problem 2.19 Another input')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色 subplot(2,1,1); stem(n2, x2); title('input');
xlabel('n2'); ylabel('x2(n)') ;
grid on
subplot(2,1,2); stem(n2, y2); title('Output');
xlabel('n2'); ylabel('y2(n)');
grid on;
运行结果:

上图是分别用impz和filter函数得到的脉冲响应序列。

系统的脉冲响应序列是绝对可和的,另外系统的极点都位于单位圆内部(见下图),所以系统是稳定的。

给系统一个新的输入,计算新的输出,如下图:

《DSP using MATLAB》Problem 2.19的更多相关文章
- 《DSP using MATLAB》Problem 5.19
代码: function [X1k, X2k] = real2dft(x1, x2, N) %% --------------------------------------------------- ...
- 《DSP using MATLAB》 Problem 3.19
先求模拟信号经过采样后,对应的数字角频率: 明显看出,第3种采样出现假频了.DTFT是以2π为周期的,所以假频出现在10π-2kπ=0处. 代码: %% ----------------------- ...
- 《DSP using MATLAB》Problem 8.19
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 7.16
使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 5.18
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% O ...
- 《DSP using MATLAB》Problem 5.5
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 5.4
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 5.3
这段时间爬山去了,山中林密荆棘多,沟谷纵横,体力增强不少. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 4.23
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
随机推荐
- (2)Mac环境搭建
创建HelloWorld项目 将刚才下载的压缩包解压到你指定的文件夹里. 进入到目录cocos2d-x-3.2alpha0/tools/cocos2d-console/bin/cocos.py 打开终 ...
- CNN学习笔记:批标准化
CNN学习笔记:批标准化 Batch Normalization Batch Normalization, 批标准化, 是将分散的数据统一的一种做法, 也是优化神经网络的一种方法. 在神经网络的训练过 ...
- Redis 监控方案
一.概述 近些天,遇到Redis监控的应用场景,从网上搜罗了一些文章,做了整理. 二.工具列表 2.1 redis-faina 见参考文章1 2.2 redis-live 见参考文章1 2.3 red ...
- Conductor
https://netflix.github.io/conductor/ High Level Architecture
- window.location.href = basePath + "paper/deleteExpertComment.action?expertId="+$(this).prev().val();
window.location.href = basePath + "paper/deleteExpertComment.action?expertId="+$(this).pre ...
- C++ 把文件路径中的单斜杠“\”换成双斜杠“\\”
<pre name="code" class="cpp"> #include <iostream> #include <strin ...
- Refactoring #001 Extract Method
Example public void startup() { ServerSocket serverSocket = null; try { serverSocket = new ServerSoc ...
- 20145219《网络对抗》Web安全基础实践
20145219<网络对抗>Web安全基础实践 基础问题回答 SQL注入攻击原理,如何防御? 原理:SQL注入攻击指的是通过构建特殊的输入作为参数传入Web应用程序,而这些输入大都是SQL ...
- Cooperation.GTST团队第四周项目总结
项目进展 这周我们的主要学习内容是: 1.研究学习如何导入博客详情页. 2.继续研究如何使用博客园的相关接口,导入相关jar包实现页面整体效果: 在我们使用其它APP或者上网浏览论坛.网页等时,通常都 ...
- mygene 3.0.0
MyGene.Info provides simple-to-use REST web services to query/retrieve gene annotation data. It’s de ...