先上代码,后出结果图。

a、

n = [-5:5];
x=2*impseq(-2,-5,5) - impseq(4,-5,5); set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
stem(n,x); title('Sequence in Problem 2.1a');
xlabel('n'); ylabel('x(n)'); grid on;

b、

n = [0:20];
x1 = n .* (stepseq(0,0,20) - stepseq(10,0,20));
x2 = 10 * exp(-0.3*(n-10)) .* (stepseq(10,0,20) - stepseq(20,0,20));
x = x1 + x2; set(gcf,'Color',[1,1,1]) % 改变坐标外围背景颜色
stem(n,x); title('Sequence in Problem 2.1b')
xlabel('n'); ylabel('x(n)');grid on;

  

c、

n = [0:50]; x = cos(0.04*pi*n)+0.2*randn(size(n));

set(gcf,'Color',[1,1,1])                  % 改变坐标外围背景颜色
stem(n,x); title('Sequence in Problem 2.1c')
xlabel('n'); ylabel('x(n)'); grid on;

  

d、

%%
%% x(n) = {...,5,4,3,2,1,5,4,3,2,1,5,4,3,2,1,...}; -10<n<9
%% * n = [-10:9]; x = [5,4,3,2,1];
xtilde = x' * ones(1,4); xtilde = (xtilde(:))';
%subplot(2,2,4);
set(gcf,'Color','white');
stem(n,xtilde); title('Sequence in Problem 2.1d')
xlabel('n'); ylabel('xtilde(n)');grid on;

  

DSP using Matlab 书内练习Example 2.1的更多相关文章

  1. DSP using MATLAB 随书示例Example2.8

    x = [3, 11, 7, 0, -1, 4, 2]; nx = [-3:3]; h = [2, 3, 0, -5, 2, 1]; nh = [-1:4]; [y,ny] = conv_m(x,nx ...

  2. 《DSP using MATLAB》Problem 7.16

    使用一种固定窗函数法设计带通滤波器. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  3. 《DSP using MATLAB》Problem 5.35

    余弦序列的谱,原始频率w0会泄露到其它频率处. 从其它书中找到的证明过程: 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  4. 《DSP using MATLAB》Problem 5.6

    频率采样定理是这样的: 由上述定理可知,一个有限长序列(假设为N)的DTFT等间隔采样,采样数至少大于等于N. 代码: %% +++++++++++++++++++++++++++++++++++++ ...

  5. 《DSP using MATLAB》Problem 5.4

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

  6. 《DSP using MATLAB》Problem 4.20

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

  7. 《DSP using MATLAB》Problem 3.3

    按照题目的意思需要利用DTFT的性质,得到序列的DTFT结果(公式表示),本人数学功底太差,就不写了,直接用 书中的方法计算并画图. 代码: %% -------------------------- ...

  8. 《DSP using MATLAB》示例Example 10.4

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

  9. 《DSP using MATLAB》示例 Example 9.6

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

随机推荐

  1. 自定义Button 的图片设置不显示问题。

    如果你是自定义button  那么你设置图片就要用 button.imageView.image = [UIImage imageName:@""]; 如果你是给系统原生的butt ...

  2. 声明式事务-整合Spring、Hibernate

    编程式事务:通过编码的方式,让事务处理的代码侵入到核心的业务代码中. 声明式事务:完成了事务处理的代码和业务核心代码的解耦合.提供事务处理代码的复用性和降低维护成本. 声明式事务:aop最典型的应用. ...

  3. 6. ZigZag Conversion

    题目: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows l ...

  4. AutoLayout 图解各种约束

  5. mongochef如何链接有权限的mongodb3.x数据库

    废话不多说,直接上图: 1.打开mongochef 2.打开的界面是这样的: 3.点击connect,上图红色框中的按钮,不要点下拉三角 4.点击New Connection按钮 5.1:上图标注1, ...

  6. Innodb之拷贝InnoDB表从一服务器到另一台服务器2

    本章节阐述将表移动到不同server上的技术.如可以将整个Mysql 实例转移到更大.更快的Server上:也可以拷贝整个实例到Slave上:也可以拷贝单个表或某些表到其他Server上(数据仓库). ...

  7. hdu 5018 Revenge of Fibonacci

    大水题 #include<time.h> #include <cstdio> #include <iostream> #include<algorithm&g ...

  8. hdu 5108 Alexandra and Prime Numbers

    数论题,本质是求出n的最大质因子 #include<time.h> #include <cstdio> #include <iostream> #include&l ...

  9. PHP面向对象——重写与重载

    重写/覆盖           override 指:子类重写了父类的同名方法 class Human{    public function say($name){           echo $ ...

  10. AJAX XML返回类型

    例题 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.o ...