《DSP using MATLAB》Problem 4.15
只会做前两个,
代码:
- %% ----------------------------------------------------------------------------
- %% Output Info about this m-file
- fprintf('\n***********************************************************\n');
- fprintf(' <DSP using MATLAB> Problem 4.15 \n\n');
- banner();
- %% ----------------------------------------------------------------------------
- %% ----------------------------------------------------
- %% 1 h(n)=[5(0.25)^n]u(n)
- %% x(n)=(0.25^n)u(n)
- %% ----------------------------------------------------
- n = [0:9];
- h1 = 5 * (1/4) .^ n .* stepseq(0, 0, 9);
- x = (1/4) .^ n;
- figure('NumberTitle', 'off', 'Name', 'Problem 4.15 h1(n) x(n)')
- set(gcf,'Color','white');
- subplot(2,1,1); stem(n, h1);
- xlabel('n'); ylabel('h(n)'); grid on;
- title('h(n)=[5(1/4)^n]u(n)');
- subplot(2,1,2); stem(n, x);
- xlabel('n'); ylabel('x'); grid on;
- title('x(n)=(1/4)^nu(n)');
- b1 = [5]; a1 = [1, -1/4];
- figure('NumberTitle', 'off', 'Name', 'Problem 4.15 H1(z) pole-zero')
- set(gcf,'Color','white');
- zplane(b1, a1);
- title('pole-zero plot'); grid on;
- y1 = filter(b1, a1, x);
- [y1_chk, ny1_chk] = conv_m(h1, n, x, n);
- figure('NumberTitle', 'off', 'Name', 'Problem 4.15 y1(n)')
- set(gcf,'Color','white');
- subplot(2,1,1); stem([0:length(y1)-1], y1);
- xlabel('n'); ylabel('h(n)'); grid on;
- title('y(n)=filter(b, a, x)');
- subplot(2,1,2); stem(ny1_chk, y1_chk);
- xlabel('n'); ylabel('y'); grid on;
- title('y(n)=h(n)*x(n)');
- %% ----------------------------------------------------
- %% 2 h(n)=[n(1/3)^n+(-1/4)^n]u(n)
- %% x(n)=(0.25^n)u(n)
- %% ----------------------------------------------------
- n = [0:9];
- h2 = (n .* (1/3) .^ n + (-1/4) .^ n ) .* stepseq(0, 0, 9);
- x = (1/4) .^ n;
- figure('NumberTitle', 'off', 'Name', 'Problem 4.15 h2(n) x(n)')
- set(gcf,'Color','white');
- subplot(2,1,1); stem(n, h2);
- xlabel('n'); ylabel('h(n)'); grid on;
- title('h(n)=[n(1/3)^n]u(n) + (-1/4)^nu(n)');
- subplot(2,1,2); stem(n, x);
- xlabel('n'); ylabel('x'); grid on;
- title('x(n)=(1/4)^nu(n)');
- %b2 = [0, 12, 48, -1]; a2 = [144, -24, -23, 2, 1];
- b2 = [1, -1/3, 7/36]; a2 = [1, -5/12, -1/18, 1/36];
- figure('NumberTitle', 'off', 'Name', 'Problem 4.15 H2(z) pole-zero')
- set(gcf,'Color','white');
- zplane(b2, a2);
- title('pole-zero plot'); grid on;
- y2 = filter(b2, a2, x);
- [y2_chk, ny2_chk] = conv_m(h2, n, x, n);
- figure('NumberTitle', 'off', 'Name', 'Problem 4.15 y2(n)')
- set(gcf,'Color','white');
- subplot(2,1,1); stem([0:length(y2)-1], y2); axis([0, 9, 0, 1]);
- xlabel('n'); ylabel('h(n)'); grid on;
- title('y(n)=filter(b, a, x)');
- subplot(2,1,2); stem(ny2_chk, y2_chk); axis([0, 9, 0, 1]);
- xlabel('n'); ylabel('y'); grid on;
- title('y(n)=h(n)*x(n)');
运行结果:
《DSP using MATLAB》Problem 4.15的更多相关文章
- 《DSP using MATLAB》Problem 7.15
用Kaiser窗方法设计一个台阶状滤波器. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 6.15
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 5.15
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 2.15
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 8.15
代码: %% ------------------------------------------------------------------------ %% Output Info about ...
- 《DSP using MATLAB》Problem 5.38
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 5.31
第3小题: 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Out ...
- 《DSP using MATLAB》Problem 5.22
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% O ...
- 《DSP using MATLAB》Problem 5.21
证明: 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- .NET中使用Rabbit MQ
1.通过Nuget 获取Rabbit MQ NET client bindings from NuGet: PM> Install-Package RabbitMQ.Client 2.发送者(生 ...
- Confluence 6 选项 2 – 转移 Crowd/Jira 应用程序中的用户和用户组到 Confluence 数据库
当你打算合并的外部目录服务器(Crowd 或 Jira 应用)有大量的用户到 Confluence 数据库中的时候,请使用这个选项.你需要有基本的 SQL 知识才能完成这个任务. 下面的 SQL 命令 ...
- laravel实现定时器功能
前记 laravel实现定时器功能有两种方法: 1. 使用 command . 2. 在闭包函数内写实现的方法. 在这里我比较推荐第一种方法,因为第一种方法把具体的实现抽离出来了,看起来简单且富有 ...
- UVA-1629 Cake slicing (DP、记忆化搜索)
题目大意:一块n*m的矩形蛋糕,有k个草莓,现在要将蛋糕切开使每块蛋糕上都恰有一个(这意味着不能切出不含草莓的蛋糕块)草莓,要求只能水平切或竖直切,求最短的刀切长度. 题目分析:定义状态dp(xa,y ...
- django url 使用总结
1 无参数情况 配置URL及其视图如下: (r'^hello/$', hello) def hello(request): return HttpResponse("Hello World& ...
- 数据仓库建模与ETL的实践
一.Data仓库的架构 Data仓库(Data Warehouse DW)是为了便于多维分析和多角度展现而将Data按特定的模式进行存储所建立起来的关系型Datcbase,它的Data基于OLTP源S ...
- pip install flask 安装失败
地址:http://www.zhihu.com/question/21492455
- scrapy-redis介绍(一)
scrapy是python里面一个非常完善的爬虫框架,实现了非常多的功能,比如内存检测,对象引用查看,命令行,shell终端,还有各种中间件和扩展等,相信开发过scrapy的朋友都会觉得这个框架非常的 ...
- Thinkphp5 微信公众号token验证不成功的原因
最近要启动微信项目,上个月就开始了解微信的开发,这个月要启动项目,配置微信公众号信息一直失败.为此,我甚至手工写了微信提交过来的记录,如: ×tamp=1510210523& ...
- Python mode_r
f = open("例子.txt",mode="r",encoding="utf-8") print(f.read(5)) # 读取5个字符 ...