2、代码:

%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 2.5.2 \n\n'); time_stamp = datestr(now, 31);
[wkd1, wkd2] = weekday(today, 'long');
fprintf(' Now is %20s, and it is %7s \n\n', time_stamp, wkd2);
%% ------------------------------------------------------------------------ n1 = -100; n2 = 100;
n = [n1:n2];
x = exp(0.1* j * pi* n);
%x = cos(0.1 * n); set(gcf,'Color','white');
stem(n,x); title('exp(0.1j\pi n) Sequence');
xlabel('n'); ylabel('x(n)'); grid on; figure
set(gcf,'Color','white');
stem(n,real(x)); title('exp(0.1j\pi n) Real Part Sequence');
xlabel('n'); ylabel('Real[x(n)]'); grid on; figure
set(gcf,'Color','white');
stem(n,imag(x)); title('exp(0.1j\pi n) Imaginary Part Sequence');
xlabel('n'); ylabel('Imag[x(n)]'); grid on; figure
set(gcf,'Color','white');
stem(n,abs(x)); title('exp(0.1j\pi n) Magnitude Sequence');
xlabel('n'); ylabel('|x(n)|'); grid on; figure
set(gcf,'Color','white');
stem(n,(180/pi) * angle(x)); title('exp(0.1j\pi n) Phase Sequence');
xlabel('n'); ylabel('phase[x(n)]'); grid on;

  运行结果:

3、代码:

%% ------------------------------------------------------------------------
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 2.5.3 \n\n'); time_stamp = datestr(now, 31);
[wkd1, wkd2] = weekday(today, 'long');
fprintf(' Now is %20s, and it is %7s \n\n', time_stamp, wkd2);
%% ------------------------------------------------------------------------ n1 = -20; n2 = 20;
n = [n1:n2];
%x = exp(0.1* j * pi* n);
x = cos(0.1 * n); set(gcf,'Color','white');
stem(n,x); title('cos(0.1n) Sequence');
xlabel('n'); ylabel('x(n)'); grid on;

  运行结果:

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

  1. 《DSP using MATLAB》Problem 7.27

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

  2. 《DSP using MATLAB》Problem 7.26

    注意:高通的线性相位FIR滤波器,不能是第2类,所以其长度必须为奇数.这里取M=31,过渡带里采样值抄书上的. 代码: %% +++++++++++++++++++++++++++++++++++++ ...

  3. 《DSP using MATLAB》Problem 7.25

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

  4. 《DSP using MATLAB》Problem 7.24

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

  5. 《DSP using MATLAB》Problem 7.23

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

  6. 《DSP using MATLAB》Problem 7.16

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

  7. 《DSP using MATLAB》Problem 7.15

    用Kaiser窗方法设计一个台阶状滤波器. 代码: %% +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

  8. 《DSP using MATLAB》Problem 7.14

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

  9. 《DSP using MATLAB》Problem 7.13

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

  10. 《DSP using MATLAB》Problem 7.12

    阻带衰减50dB,我们选Hamming窗 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...

随机推荐

  1. Atcoder CADDi 2018 Solution

    C - Product and GCD Solved. 题意: 给出$n个数$的乘积,求$这n个数$的最大的可能是GCD 思路: 分解质因子,那么$每个质因子的贡献就是其质因子个数/ n的乘积$ #i ...

  2. 2018 Multi-University Training Contest 9 Solution

    A - Rikka with Nash Equilibrium 题意:构造一个$n * m$的矩阵,使得$[1, n * m]$ 中每个数只出现一次,并且纳什均衡只出现一次. 思路:从大到小的放置,每 ...

  3. 字王4K云字库入驻github

    字王4K云字库入驻github 网址:https://github.com/ziwang-com/zw4kFont   2015.3.28,字王4K云字库入驻github,原本或早或晚,不过这几天在g ...

  4. CTR预估中的贝叶斯平滑方法(一)原理及实验介绍

    1. 背景介绍 广告形式: 互联网广告可以分为以下三种: 1)展示广告(display ad) 2)搜索广告(sponsored search ad) 3)上下文广告(contextual ad)   ...

  5. 探索C++虚函数在g++中的实现

    本文是我在追查一个诡异core问题的过程中收获的一点心得,把公司项目相关的背景和特定条件去掉后,仅取其中通用的C++虚函数实现部分知识记录于此. 在开始之前,原谅我先借用一张图黑一下C++: “无敌” ...

  6. python使用zipfile解压中文乱码问题

    在zipfile.ZipFile中获得的filename有中日文则很大可能是乱码,这是因为 在zip标准中,对文件名的 encoding 用的不是 unicode,而可能是各种软件根据系统的默认字符集 ...

  7. Labeled Faces in the Wild 人脸识别数据集

    http://blog.csdn.net/garfielder007/article/details/51480525 New (draft) survey paper: Labeled Faces ...

  8. P2831 愤怒的小鸟(状压dp)

    P2831 愤怒的小鸟 我们先预处理出每个猪两两之间(设为$u,v$)和原点三点确定的抛物线(当两只猪横坐标相等时显然无解) 处理出$u,v$确定的抛物线一共可以经过多少点,记为$lines[u][v ...

  9. 实验三 敏捷开发与XP实践20145204和20145236

    实验三 敏捷开发与XP实践20145204和20145236 实验名称 敏捷开发与XP实践 实验内容 XP基础 XP核心实践 学会使用git 学会代码的重构 实现团队合作 团队分工 20145204: ...

  10. openwrt生成的交叉编译器在哪里

    答:在staging_dir目录下,示例如下: 编译一个arm64架构所生成的编译器在staging_dir/toolchain-aarch64_generic_gcc-7.4.0_musl/bin/ ...