代码:

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. 从git获取项目代码

    1.先复制项目的SSH链接备用 2.在你要放置项目的地方git bash here 3.按照以下步骤走: $ git clone YourSSHAddress // clone项目 $ ls // 查 ...

  2. 由angular命令行工具(angular-cli)生成的目录和文件

    e2e目录:是端到端的测试目录,包含基本的测试桩.是用来做自动测试的. src:应用源代码目录.我们写的所有代码都应该在这里面. app:包括应用的组件和模块.我们自己写的绝大部分代码都是写在这个目录 ...

  3. [PostgreSql]PostgreSql创建函数及函数的执行

    1.准备好创建函数的脚本 -- FUNCTION: public.dynamic_placelist_select(integer, timestamp without time zone) -- D ...

  4. chengdongyue的笔记

    ---------------------------------------- Linux 基础 --------------------------------1.Linux的诞生 1.unix两 ...

  5. PHP返回32位与16位的md5加密值

    字符串“123456”,经过md5算法加密之后是 32位: e10adc3949ba59abbe56e057f20f883e16位: 49ba59abbe56e057 PHP自带的 md5() 函数, ...

  6. pahlcon:循环调度(Dispatch Loop)或跳转

    循环调度将会在分发器执行,直到没有action需要执行为止.在上面的例子中,只有一个action 被执行到.现在让我们来看下“forward”(转发)怎样才能在循环调度里提供一个更加复杂的操作流,从而 ...

  7. hdu 6097 Mindis(数学几何,圆心的反演点)

    Mindis Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Subm ...

  8. scala学习之实现RPC通信

    最近学习scala,个人感觉非常灵活,实现rpc通信非常简单,函数式编程比较烧脑 1.搭建工程 创建scala maven 工程 项目pom文件 <project xmlns="htt ...

  9. 【移动互联网开发】Zepto 使用中的一些注意点 【转】

    前段时间完成了公司一个产品的 HTML5 触屏版,开发中使用了 Zepto 这个著名的 DOM 操作库. 为什么不是 jQuery 呢?因为 jQuery 的目标是兼容所有主流浏览器,这就意味着它的大 ...

  10. 关于python中urllib.urlencode的时候出错:UnicodeEncodeError: ‘ascii’的记录

    原文我参见了:http://hi.baidu.com/setcookie/item/ddc6b694b1f13435336eeb3c 为毛我要费事的写下了,就是为了让自己记录一下,下面的也是直接摘录过 ...