代码:

%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 2.20 \n\n'); banner();
%% ------------------------------------------------------------------------ b = [1, -1]; a = [1]; %% -------------------------------------------------
%% 3 input sequence
%% -------------------------------------------------
n1 = [0:30];
x1 = 5 * (stepseq(0, 0, 30) - stepseq(20, 0, 30)); n2 = [-1:30];
x2 = n2 .* (stepseq(0, -1, 30)-stepseq(10, -1, 30)) + (20-n2) .* (stepseq(10, -1, 30)-stepseq(20, -1, 30)); n3= [-1:110];
x3 = sin(pi*n3/25) .* (stepseq(0, -1, 110)-stepseq(100, -1, 110)); %% ------------------------------------------------
%% 3 output sequence
%% ------------------------------------------------
y1 = filter(b, a, x1);
y2 = filter(b, a, x2);
y3 = filter(b, a, x3); figure('NumberTitle', 'off', 'Name', 'Problem 2.20')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色 subplot(2,1,1); stem(n1, x1); title('x1');
xlabel('n'); ylabel('x1(n)') ;
grid on
subplot(2,1,2); stem(n1, y1); title('y1');
xlabel('n'); ylabel('y1(n)');
grid on; figure('NumberTitle', 'off', 'Name', 'Problem 2.20')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色 subplot(2,1,1); stem(n2, x2); title('x2');
xlabel('n'); ylabel('x2(n)') ;
grid on
subplot(2,1,2); stem(n2, y2); title('y2');
xlabel('n'); ylabel('y2(n)');
grid on; figure('NumberTitle', 'off', 'Name', 'Problem 2.20')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色 subplot(2,1,1); stem(n3, x3); title('x3');
xlabel('n'); ylabel('x3(n)') ;
grid on
subplot(2,1,2); stem(n3, y3); title('y3');
xlabel('n'); ylabel('y3(n)');
grid on; %% ---------------------------------------------
%% stability
%% ---------------------------------------------
x4 = impseq(0, 0, 10);
y4 = filter(b, a, x4); fprintf('\nsum(abs(h)) = %f \n', sum(abs(y4))); figure('NumberTitle', 'off', 'Name', 'Problem 2.20 Zero-Pole')
set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
pzmap(b, a); z = roots(a); magz = abs(z)

  运行结果:

上图看出,三角波信号的微分结果是方波。正弦信号的微分当然就是余弦信号了,见下图:

微分器的脉冲响应序列是绝对可和的,所以系统是稳定的。

《DSP using MATLAB》Problem 2.20的更多相关文章

  1. 《DSP using MATLAB》Problem 6.20

    先放子函数: function [C, B, A, rM] = dir2fs_r(h, r); % DIRECT-form to Frequency Sampling form conversion ...

  2. 《DSP using MATLAB》Problem 5.20

    窗外的知了叽叽喳喳叫个不停,屋里温度应该有30°,伏天的日子难过啊! 频率域的方法来计算圆周移位 代码: 子函数的 function y = cirshftf(x, m, N) %% -------- ...

  3. 《DSP using MATLAB》Problem 4.20

    代码: %% ------------------------------------------------------------------------ %% Output Info about ...

  4. 《DSP using MATLAB》Problem 3.20

    代码: %% ------------------------------------------------------------------------ %% Output Info about ...

  5. 《DSP using MATLAB》Problem 7.24

    又到清明时节,…… 注意:带阻滤波器不能用第2类线性相位滤波器实现,我们采用第1类,长度为基数,选M=61 代码: %% +++++++++++++++++++++++++++++++++++++++ ...

  6. 《DSP using MATLAB》Problem 7.23

    %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output Info a ...

  7. 《DSP using MATLAB》Problem 6.15

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  8. 《DSP using MATLAB》Problem 6.12

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

  9. 《DSP using MATLAB》Problem 6.10

    代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output In ...

随机推荐

  1. nmon监控Linux服务器系统资源

    本文转自:http://www.cnblogs.com/hyzhou/archive/2011/12/29/2305860.html 在实际的测试过程中,Loadrunner监控Linux系统资源不太 ...

  2. 常用php操作redis命令整理(三)LIST类型

    LIST 头元素和尾元素:头元素指的是列表左端/前端第一个元素,尾元素指的是列表右端/后端第一个元素.举个例子,列表list包含三个元素:x, y, z,其中x是头元素,而z则是尾元素.空列表:指不包 ...

  3. Python3.6(windows系统)通过pip安装bs4

    Python3.6(windows系统)通过pip安装bs4 cmd安装命令: pip install beautifulsoup4 执行结果:

  4. 20145303 刘俊谦《网络对抗》逆向及BOF基础实践

    20145303 刘俊谦<网络对抗>逆向及BOF基础实践 1 逆向及Bof基础实践说明 实践目标 本次实践的对象是一个名为pwn1的linux可执行文件. 该程序正常执行流程是:main调 ...

  5. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none 解决方法

    参考:CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none 环境 主系统 OS X,虚拟机,Ubuntu 14.04 64bit. 问题描述 ...

  6. ZOJ 1276 Optimal Array Multiplication Sequence(矩阵连乘)

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1276 裸的矩阵连乘问题. #include<iostream> ...

  7. tfn2k工具使用介绍

    主要介绍tfn2k(Linux),因为它最著名嘛!主要分为使用说明 然后在说安装所以有点长 (注意:有的人拿VPS来做DDOS·问题是有的人发现了会关闭你VPS的·除非你认识他或者你自己有服务器而不是 ...

  8. js 获取地址栏域名以及URL

    console.log(window.location.host) console.log(document.domain) console.log(window.location.href) con ...

  9. JVM虚拟机调优指南

    本章通过阅读JVM垃圾搜集指南文档,整理虚拟机主要配置以及,理解不同的垃圾搜集器. 垃圾搜集算法 引用计数算法 根搜索算法 标记-清除算法 复制算法 标记-整理算法 分代收集算法 搜集算法网上有很多介 ...

  10. [linux]文件系统损坏,linux启动时 checking filesystems fail

    先敲root password进入maintenance状态,然后fsck -y /dev/mapper/vg_wwwdata-lv_root等干净了以后,再exit就行了. ------------ ...