《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
证明: 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- telnet 命令使用方法详解,telnet命令怎么用?
什么是Telnet? 对于Telnet的认识,不同的人持有不同的观点,可以把Telnet当成一种通信协议,但是对于入侵者而言,Telnet只是一种远程登录的工具.一旦入侵者与远程主机建立了Telnet ...
- 3.6 MIPS指令简介
计算机组成 3 指令系统体系结构 3.6 MIPS指令简介 MIPS秉承着指令数量少,指令功能简单的设计理念.那这样的设计理念是如何实现的呢?在这一节,我们就将来分析MIPS指令的特点. 相比于X86 ...
- codeforces 993c//Careful Maneuvering// Codeforces Round #488 by NEAR (Div. 1)
题意:x轴-100和+100的有敌人飞船,纵坐标由输入数据给出,我方有2飞船在x轴0,y坐标待定.0时刻时敌人同时向我方2飞船发出光线,光线会穿透飞船打到敌人自己,问2飞船放在哪敌人损失最大? 假如- ...
- robot framework学习笔记1之_环境安装(win7)
一.简介 Robotframework是基于Python的自动化测试框架.使用关键字驱动的测试方法,自带丰富的库函数可直接引用,可使用Java/Python进行功能库扩展,测试用例使用TSV/HTML ...
- 『PyTorch』第十二弹_nn.Module和nn.functional
大部分nn中的层class都有nn.function对应,其区别是: nn.Module实现的layer是由class Layer(nn.Module)定义的特殊类,会自动提取可学习参数nn.Para ...
- bzoj2154: Crash的数字表格 莫比乌斯反演
题意:求\(\sum_{i=1}^n \sum_{j=1}^m\frac{i*j}{gcd(i,j)}\) 题解:\(ans=\sum_{i=1}^n\sum_{j=1}^m \frac{i*j}{g ...
- linux安装配置postgres及使用dblink
好久不写东西,一直在看些开源的东西,下面贴下linux上安装配置postgres及使用dblink的操作参考,以供读者和自己今后参考: 1.下载源码:postgresql-9.3.2.tar.gz 2 ...
- Win10 dell驱动触摸板安装
Win10 dell驱动触摸板安装 在此之前安装驱动后要重启
- Linux WiFi Deauthenticated Reason Codes
Code Reason Explanation 0 Reserved Normal working operation 1 Unspecific Reason We don’t know what’s ...
- CentOS6编译安装Python3
CentOS6默认Python版本是2, 但我使用的是Python3,因此需要自己安装 但记住,不要删除自带的Python2,否则很多东西会报错,比如yum之类的.(别问我为什么知道...) 话不多说 ...