代码:

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. [sping]xml配置文件中factory-bean与factory-method(spring使用工厂方法注入bean)

    public class CarFactory { //非静态方法 public Car createCar(){ Car car = new Car(); car.setBrand("BM ...

  2. 第七天 Linux用户管理、RHEL6.5及RHEL7.2 root密码破解、RHEL6.5安装vmware tools

    1.Linux用户管理 Linux系统中,存在三种用户 A.超级用户:root 最高权限,至高无上 在windows中 administrator是可以登录的最高权限,但是,system权限最高,不能 ...

  3. anaconda的一些命令

    先安装好TensorFlow. 1.安装sklearn 本安装方式是在anaconda prompt上用命令来更新 (1)激活TensorFlow:activate tensorflow (2)查看是 ...

  4. yii2高级模板安装

    通过 Composer 安装 如果还没有安装 Composer,在 Linux 和 Mac OS X 中可以运行如下命令: curl -sS https://getcomposer.org/insta ...

  5. Ubuntu 下Python 环境问题

    问题描述: 原先使用Anaconda环境,若卸载后仍不能恢复到系统默认的Python环境. 解决方案: shell 寻找缓存路径,python的扩展/home/tom/anaconda/bin/pyt ...

  6. .Net使用Redis详解之ServiceStack.Redis(7)

    Net使用Redis详解之ServiceStack.Redis(七) 序言 本篇从.Net如何接入Reis开始,直至.Net对Redis的各种操作,为了方便学习与做为文档的查看,我做一遍注释展现,其中 ...

  7. 职责链模式(Chain of Responsibility)

    一.责任链模式介绍 责任链模式:将能够处理同一类请求的对象连成一条链,使这些对象都有机会处理请求,所提交的请求沿着链传递.从而避免请求的 发送者和接受者之间的耦合关系.链上的对象逐个判断是否有能力处理 ...

  8. OC-NSString

    ========================== 面向对象编程进阶和字符串 ========================== Δ一.类的设计模式—单例 [单例]程序允许过程中,有且仅有一块内存 ...

  9. leetCode之Median of Two Sorted Arrays

    [题目描述] There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of ...

  10. New Concept English three(13)

    1原文打字 32w/m 错词27个 After her husband had gone to work, Mrs Richards sent her children to school and w ...