代码:

ws1 = 0.2*pi; wp1 = 0.35*pi; wp2 = 0.65*pi; ws2 = 0.8*pi;
Rp = 1.0; As = 60;
[delta1, delta2] = db2delta(Rp, As); f = [ws1, wp1, wp2, ws2]/pi; m = [0, 1, 0]; delta = [delta2, delta1, delta2]; [N, f, m, weights] = firpmord(f, m, delta);
N h = firpm(N, f, m, weights);
[db, mag, pha, grd, w] = freqz_m(h, [1]);
delta_w = 2*pi/1000;
ws1i = floor(ws1/delta_w)+1; wp1i = floor(wp1/delta_w)+1;
ws2i = floor(ws2/delta_w)+1; wp2i = floor(wp2/delta_w)+1; Asd = -max(db(1:1:ws1i)) N = N + 1
h = firpm(N, f, m, weights); [db, mag, pha, grd, w] = freqz_m(h, [1]);
Asd = -max(db(1:1:ws1i)) N = N + 1
h = firpm(N, f, m, weights); [db, mag, pha, grd, w] = freqz_m(h, [1]);
[Hr, ww, a, L] = Hr_Type1(h);
Asd = -max(db(1:1:ws1i)) M = N + 1

  运行结果:

当Asd超过给定的60dB就停止。

《DSP using MATLAB》示例Example7.24的更多相关文章

  1. 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 ...

  2. DSP using MATLAB 示例 Example3.19

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

  3. DSP using MATLAB示例Example3.18

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

  4. 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 ...

  5. DSP using MATLAB 示例Example3.22

    代码: % Discrete-time Signal x2(n) Ts = 0.001; n = -5:1:5; nTs = n*Ts; Fs = 1/Ts; x = exp(-1000*abs(nT ...

  6. DSP using MATLAB 示例Example3.17

  7. DSP using MATLAB示例Example3.16

    代码: b = [0.0181, 0.0543, 0.0543, 0.0181]; % filter coefficient array b a = [1.0000, -1.7600, 1.1829, ...

  8. DSP using MATLAB 示例 Example3.15

    上代码: subplot(1,1,1); b = 1; a = [1, -0.8]; n = [0:100]; x = cos(0.05*pi*n); y = filter(b,a,x); figur ...

  9. 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 ...

随机推荐

  1. IdentityServer4在Asp.Net Core中的应用(三)

    今天的内容是授权模式中的简化模式,还是先看以下授权流程图: 在这种模式中我们将与OpenID结合使用,所以首先我们要了解OpenID和OAuth的区别,关于他们的区别,在我上一篇博客<理解Ope ...

  2. 你真的掌握 LVS、Nginx 及 HAProxy 的工作原理吗

    你真的掌握 LVS.Nginx 及 HAProxy 的工作原理吗 当前大多数的互联网系统都使用了服务器集群技术,集群是将相同服务部署在多台服务器上构成一个集群整体对外提供服务,这些集群可以是 Web ...

  3. python报错:TypeError: 'int' object is not subscriptable

    检查一遍报错的所在行,此报错一般是在整数上加了下标: 比如:   a = 4   c=a[2] 报错:line 2, in <module>    c=a[2] TypeError: 'i ...

  4. poj3308 Paratroopers 最大流 最小点权覆盖

    题意:有一个n*m的矩阵,告诉了在每一行或者每一列安装大炮的代价,每一个大炮可以瞬间消灭这一行或者这一列的所有敌人,然后告诉了敌人可能出现的L个坐标位置,问如何安置大炮,使花费最小.如果一个敌人位于第 ...

  5. Ansible 小手册系列 十六(Playbook Debug)

    debug模块在执行期间打印语句,并且可用于调试变量或表达式,而不必停止playbook. 打印自定义的信息 - debug: msg="System {{ inventory_hostna ...

  6. Find the odd int

    Given an array, find the int that appears an odd number of times. There will always be only one inte ...

  7. 上下行分流下行负载方式和能ping通但不能打开

    1 下行线路负载方式选择  目的端口+协议  否则有可能出现微信443端口图片打不开的情况. 2.彭ping通但是打不开的情况下将上行线路mtu值改小 由1500改为1450

  8. HDU 3923 Invoker(polya定理+乘法逆元(扩展欧几里德+费马小定理))

    Invoker Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 122768/62768K (Java/Other) Total Subm ...

  9. I/O流+统计文件词频

    body, table{font-family: 微软雅黑; font-size: 10pt} table{border-collapse: collapse; border: solid gray; ...

  10. python虚拟环境的搭建命令mkvirtualenv

    windows环境如果同时安装了python3和python2,那么无论在哪个版本安装了virtualenv和virtualenvwrapper-win 通过以下命令设置ptyhon版本路径,即可建立 ...