《DSP using MATLAB》Problem 4.3
代码:
%% -------------------------------------------------
%% 1 x(n)=2δ(n-2)+3u(n-3)
%% -------------------------------------------------
b = [0, 0, 2, 1]; a = [1, -1]; % [R, p, C] = residuez(b, a)
Mp = (abs(p))' % pole magnitudes
Ap = (angle(p))'/pi % pole angle in pi units [delta, n] = impseq(0, 0, 7); x1_chk = filter(b, a, delta) x1_ori = 2 * impseq(2, 0, 7) + 3 .* stepseq(3, 0, 7) figure('NumberTitle', 'off', 'Name', 'Problem 4.3 X1(z) pole-zero')
set(gcf,'Color','white');
zplane(b, a);
title('pole-zero plot'); grid on; %% ----------------------------------------------------------------------------
%% 2 x(n)=[3*0.75^n*cos(0.3πn)]u(n) + [4*0.75^n*sin(0.3πn)]u(n)
%% ----------------------------------------------------------------------------
b = [3, -3*0.75*cos(0.3*pi) + 4*0.75*sin(0.3*pi) ];
a = [1, -2*0.75*cos(0.3*pi), 0.75*0.75]; [R, p, C] = residuez(b, a)
Mp = (abs(p))' % pole magnitudes
Ap = (angle(p))'/pi % pole angle in pi units [delta, n] = impseq(0, 0, 7); x2_chk = filter(b, a, delta) x2_ori = ( 3*(0.75 .^ n) .* cos(0.3*pi*n) + 4*(0.75 .^ n) .* sin(0.3*pi*n) ) .* stepseq(0, 0, 7) figure('NumberTitle', 'off', 'Name', 'Problem 4.3 X2(z) pole-zero')
set(gcf,'Color','white');
zplane(b, a);
title('pole-zero plot'); grid on;
运行结果:
2、第2小题的z变换,有一对共轭极点;
3、求z变换
代码:
%% ------------------------------------------------------------------------
%% 3 x(n)=n*sin(πn/3)u(n) + (0.9)^n*u(n-2)
%% ------------------------------------------------------------------------
b1 = [0, sqrt(3)/2, 0, -sqrt(3)/2]; nb1 = [0:3];
a1 = [1, -2, 3, -2, 1]; na1 = [0:4];
b2 = [0, 0, 0.81]; nb2 = [0:2];
a2 = [1, -0.9]; na2 = [0:1]; [a, na] = conv_m(a1, na1, a2, na2); [b11, nb11] = conv_m(b1, nb1, a2, na2);
[b12, nb12] = conv_m(a1, na1, b2, nb2); [b, nb] = sigadd(b11, nb11, b12, nb12); [R, p, C] = residuez(b, a)
Mp = (abs(p))' % pole magnitudes
Ap = (angle(p))'/pi % pole angle in pi units [delta, n] = impseq(0, 0, 7); x3_chk = filter(b, a, delta) x3_ori = ( n .* sin(pi*n/3) ) .* stepseq(0, 0, 7) + (0.9 .^ n) .* stepseq(2, 0, 7) figure('NumberTitle', 'off', 'Name', 'Problem 4.3 X3(z) pole-zero')
set(gcf,'Color','white');
zplane(b, a);
title('pole-zero plot'); grid on;
运行结果:
4、求z变换
代码:
%% ------------------------------------------------------------------------
%% 4 x(n)=[n^2*(2/3)^(n-2)]u(n-1)
%% ------------------------------------------------------------------------
b1 = [0, 0, 1, 0, -4/9]; nb1 = [0:4];
a1 = [1, -8/3, 24/9, -32/27, 16/81]; na1 = [0:4];
b2 = [0, 3]; nb2 = [0:1];
a2 = [1, -4/3, 4/9]; na2 = [0:2];
b3 = [0, -3/2]; nb3 = [0:1];
a3 = [1, -2/3]; na3 = [0:1]; [a22, na22] = conv_m(a2, na2, a3, na3); [b11, nb11] = conv_m(b2, nb2, a3, na3);
[b12, nb12] = conv_m(b3, nb3, a2, na2); [b22, nb22] = sigadd(b11, nb11, b12, nb12); [a, na] = conv_m(a1, na1, a22, na22); [b13, nb13] = conv_m(b1, nb1, a22, na22);
[b14, nb14] = conv_m(a1, na1, b22, nb22); [b, nb] = sigadd(b13, nb13, b14, nb14); [R, p, C] = residuez(b, a)
Mp = (abs(p))' % pole magnitudes
Ap = (angle(p))'/pi % pole angle in pi units [delta, n] = impseq(0, 0, 7); x4_chk = filter(b, a, delta) x4_ori = (n.*n) .* (2/3).^(n-2) .* stepseq(1, 0, 7) figure('NumberTitle', 'off', 'Name', 'Problem 4.3 X4(z) pole-zero')
set(gcf,'Color','white');
zplane(b, a);
title('pole-zero plot'); grid on;
运行结果:
5、求z变换
代码:
《DSP using MATLAB》Problem 4.3的更多相关文章
- 《DSP using MATLAB》Problem 7.27
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.26
注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.25
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.24
又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.23
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...
- 《DSP using MATLAB》Problem 7.16
使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.15
用Kaiser窗方法设计一个台阶状滤波器. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
- 《DSP using MATLAB》Problem 7.14
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.13
代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...
- 《DSP using MATLAB》Problem 7.12
阻带衰减50dB,我们选Hamming窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...
随机推荐
- Redis之字符串类型命令
String(字符串) string 是 redis 最基本的类型,你可以理解成与 Memcached 一模一样的类型,一个 key 对应一个 value. string 类型是二进制安全的.意思是 ...
- java concurrent包的实现原理
由于java的CAS同时具有 volatile 读和volatile写的内存语义,因此Java线程之间的通信现在有了下面四种方式: A线程写volatile变量,随后B线程读这个volatil ...
- JS-Object(2) 原型对象 ,prototype属性。
基础✅ prototype(✅) JS中的继承 使用JSON数据 构建对象实战 基础 关键字"this"指向了当前代码运行时的对象( 原文:the current object t ...
- ccf数字排序
问题描述 给定n个整数,请统计出每个整数出现的次数,按出现次数从多到少的顺序输出. 输入格式 输入的第一行包含一个整数n,表示给定数字的个数. 第二行包含n个整数,相邻的整数之间用一个空格分隔,表示所 ...
- hdu多校(二) 1004 1007 1010
Game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- hdu-6301-贪心
Distinct Values Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)T ...
- UA 列表
设备 系统 浏览器 User-Agent iPhone IOS QQ浏览器 Mozilla/5.0 (iPhone 84; CPU iPhone OS 10_3_3 like Mac OS X) Ap ...
- 如何用SPY++工具查看窗体的句柄
我安装的是vs2012,先找到SPY++工具打开 打开方式: 方式1:通过路径(C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microso ...
- Sql Server约束的学习一(主键约束、外键约束、唯一约束)
一.约束的分类 1.实体约束 实体约束是关于行的,比如某一行出现的值不允许出现在其他行,例如主键约束. 2.域约束 域约束是关于列的,对于所有行,某一列有那些约束,例如检查约束. 3.参照完整性约束 ...
- js上传图片前预览方法(支持预览多个图片)
运用js实现上传图片前的预览(支持多张图片),实现的例子如下: 1.源码例子: 1)Js脚本页面 <!doctype html> <html> <head> < ...