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. vs2010中如何编写C语言程序

    File->New->Project 在打开的New Project对话框中最左侧一栏中选择Visual C++下面的CLR,之后在其右侧的区域中选择CLR Empty Applicati ...

  2. hdu5139

    这题需要我们计算 这个 因为n<10000000空间过大 那么我们可以计算出 当n可以被10整除的时候我们就将n/10记录下来当我们要查询的时候去暴力计算他们与整十之间的数去暴力去做就好了 这个 ...

  3. iOS error: -34018

    一般报这个错误是由于操作keychain 报的错. 遇到该情况的情况: 1.是否打开权限 2.苹果自身的bug,传送门:https://stackoverflow.com/questions/2974 ...

  4. HeyWeGo小组《Java程序设计》 2015—2016年学期团队项目总结

    HeyWeGo小组<Java程序设计> 2015—2016年学期团队项目总结 题目简介 一个简单的扫雷小游戏,在12*12的方格盘上,首先可以设定雷的个数,然后点击开始程序就会随机布雷,开 ...

  5. Duilib 创建不规则窗口(转载)

    方法一: 转载:http://blog.csdn.net/chenlycly/article/details/46447297 转载:http://blog.csdn.net/harvic880925 ...

  6. 中通快递单api查询

    request POST https://hdgateway.zto.com/WayBill_GetDetail HTTP/1.1Host: hdgateway.zto.comConnection: ...

  7. codeforces 355 div2 C. Vanya and Label 水题

    C. Vanya and Label time limit per test 1 second memory limit per test 256 megabytes input standard i ...

  8. Qt5编译error01

    1.Qt551x86 vs2013 1.1.“error: C2001: 常量中有换行符” 问题还原:源码:“QString str = tr("已接收 %1MB (%2MB/s) \n共% ...

  9. [osgearth]通过API创建一个earth模型

    通过API的方式大体需要以下几个步骤: 创建map对象—— 创建影像数据层—— 创建高程数据层—— 将影像数据层以及高程数据层加入到map对象—— 根据前面创建的map对象创建mapNode节点—— ...

  10. [javascript]javascript取得html元素,取得html样式,修改html样式

    一.取得html元素 详情见:https://www.jb51.net/article/116460.htm 1.通过ID获取(getElementById) document.getElementB ...