代码:

M = 25; alpha = (M-1)/2; n = [0:1:M-1]; 

hd = (2/pi) * ( (sin( (pi/2)*(n-alpha) ).^2)./(n-alpha) ); hd(alpha+1) = 0;

w_han = (hann(M))'; 

h = hd .* w_han;
[Hr, w, P, L] = Hr_Type3(h);
P
L %Plot figure('NumberTitle', 'off', 'Name', 'Exameple 7.13')
set(gcf,'Color','white'); subplot(2,2,1); stem(n, hd); axis([-1 M -1.2 1.2]); grid on;
xlabel('n'); ylabel('hd(n)'); title('Ideal Impulse Response'); subplot(2,2,2); stem(n, w_han); axis([-1 M 0 1.2]); grid on;
xlabel('n'); ylabel('w(n)'); title('Hann Window'); subplot(2,2,3); stem(n, h); axis([-1 M -1.2 1.2]); grid on;
xlabel('n'); ylabel('h(n)'); title('Actual Impulse Response'); w = w'; Hr = Hr';
w = [-fliplr(w), w(2:501)]; Hr = [-fliplr(Hr), Hr(2:501)];
subplot(2,2,4); plot(w/pi, Hr); axis([-1 1 -1.1 1.1]); grid on;
xlabel('frequency in \pi units'); ylabel('Hr'); title('Amplitude Response');

  运行结果:

注意:振幅谱的频率范围是从-π到π。

《DSP using MATLAB》示例Example 7.13的更多相关文章

  1. 《DSP using MATLAB》Problem 7.13

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

  2. 《DSP using MATLAB》Problem 6.13

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

  3. 《DSP using MATLAB》Problem 5.13

    1. 代码: %% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ %% Output ...

  4. 《DSP using MATLAB》Problem 4.13

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

  5. 《DSP using MATLAB》Problem 8.13

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

  6. DSP using MATLAB 示例 Example3.13

    上代码: w = [0:1:500]*pi/500; % freqency between 0 and +pi, [0,pi] axis divided into 501 points. H = ex ...

  7. DSP using MATLAB 示例Example3.21

    代码: % Discrete-time Signal x1(n) % Ts = 0.0002; n = -25:1:25; nTs = n*Ts; Fs = 1/Ts; x = exp(-1000*a ...

  8. DSP using MATLAB 示例 Example3.19

    代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Discrete-time Signa ...

  9. DSP using MATLAB示例Example3.18

    代码: % Analog Signal Dt = 0.00005; t = -0.005:Dt:0.005; xa = exp(-1000*abs(t)); % Continuous-time Fou ...

  10. DSP using MATLAB 示例Example3.23

    代码: % Discrete-time Signal x1(n) : Ts = 0.0002 Ts = 0.0002; n = -25:1:25; nTs = n*Ts; x1 = exp(-1000 ...

随机推荐

  1. Normalize.css与CSS reset区别

    Normalize.css 只是一个很小的CSS文件,但它在默认的HTML元素样式上提供了跨浏览器的高度一致性.相比于传统的CSS reset,Normalize.css是一种现代的.为HTML5准备 ...

  2. 在activity之间传递数据

    在activity之间传递数据 一.简介 二.通过intent传递数据 1.在需要传数据的界面调用 intent.putExtra("data1", "我是fry&quo ...

  3. Hive 元数据库表信息

    Hive 的元数据信息通常存储在关系型数据库中,常用MySQL数据库作为元数据库管理. 1. 版本表 i) VERSION   -- 查询版本信息 2. 数据库.文件存储相关 i) DBS -- 存储 ...

  4. write 系统调用耗时长的原因

    前一阵子公司一部门有人叫帮忙调查,说他们write系统调用基本上是个位数微秒就返回,或者说几十us,但偶尔出现几次write系统调用达到几百毫秒和情况.大家都知道,通过vfs进行write,都是写写到 ...

  5. tail命令 | head命令

    tail -f -n 50 log.txt 循环读取文件log.txt的后50行 head -n 50 log.txt 显示文件的前n行

  6. RedHat/CentOS 7通过nmcli命令管理网络教程

    Red Hat Enterprise Linux 7 和CentOS 7 的网络管理实际上是对NetworkManager的管理,可通过nmcli命令进行控制,下面小编就给大家介绍下RedHat/Ce ...

  7. guava学习--cache

    转载:http://outofmemory.cn/java/guava/cache/how-to-use-guava-cache   http://www.cnblogs.com/parryyang/ ...

  8. 登录后保存token值到cookie中

    1.引入相应JS <script src="web/js/jquery-1.9.1.min.js"></script> <script src=&qu ...

  9. CF911B

    题解: 枚举一下x x<=min(a,b) 然后判断a/x+b/x是否>=x 代码: #include<bits/stdc++.h> using namespace std; ...

  10. js 计算时间

    var date1=new Date();  //开始时间   var date2=new Date();    //结束时间 var date3=date2.getTime()-date1.getT ...