代码:

wp = 0.2*pi; ws = 0.3*pi; As = 50; tr_width = ws - wp;
M = ceil((As-7.95)/(2.285*tr_width) + 1 ) + 1 n = [0:1:M-1]; beta = 0.1102*(As-8.7)
wc = (ws + wp)/2; % ideal LPF cutoff frequency
hd = ideal_lp(wc, M);
w_kai = (kaiser(M, beta))'; h = hd .* w_kai;
[db, mag, pha, grd, w] = freqz_m(h, [1]); delta_w = 2*pi/1000; % Rp = -(min(db(1:1:wp/delta_w+1))); % Actual Passband Ripple As = -round(max(db(ws/delta_w+1:1:501))) % Min Stopband attenuation %Plot figure('NumberTitle', 'off', 'Name', 'Exameple 7.9')
set(gcf,'Color','white'); subplot(2,2,1); stem(n, hd); axis([0 M-1 -0.1 0.3]); grid on;
xlabel('n'); ylabel('hd(n)'); title('Ideal Impulse Response'); subplot(2,2,2); stem(n, w_kai); axis([0 M-1 0 1.1]); grid on;
xlabel('n'); ylabel('w(n)'); title('Kaiser Window'); subplot(2,2,3); stem(n, h); axis([0 M-1 -0.1 0.3]); grid on;
xlabel('n'); ylabel('h(n)'); title('Actual Impulse Response'); subplot(2,2,4); plot(w/pi, db); axis([0 1 -100 10]); grid on;
xlabel('frequency in \pi units'); ylabel('Decibels'); title('Magnitude Response in dB');

  运行结果:

我们注意到,Kaiser窗函数的特征,长度M=61,β =4.5513,滤波器Rp=0.0442dB,阻带衰减As=52dB,满足设计要求。

最新文章

  1. Objective C中数组排序几种情况的总结
  2. NAT技术
  3. while的使用
  4. PHP日期格式转时间戳
  5. SWIFT Button的基本用法
  6. Laravel 5 基础(三)- 向视图传送数据
  7. 九度OJ1172--哈夫曼树
  8. jQuery1.9(辅助函数)学习之——.serialize();
  9. const 还是 static readonly
  10. 常用类型转换 一.常用int和string类型转换
  11. 0_Simple__simpleAtomicIntrinsics + 0_Simple__simpleAtomicIntrinsics_nvrtc
  12. DrawerLayout实现网易新闻抽屉效果
  13. HDU5950 Recursive sequence (矩阵快速幂)
  14. 批量屏蔽符合条件的IP地址《目前仅测Centos 6 版本》
  15. SQL语句简单笔记
  16. FPGA中关于SPI的使用
  17. 怎么在XY图表中添加注解(LightningChart控件为例)?
  18. maven 下载不到jar包时候,更改阿里源
  19. Java 集合-Collections工具类
  20. Java编程规范[转]

热门文章

  1. 正确的使用pod install 和 pod update
  2. React 16.3.0 发布,构建用户界面的 JavaScript 库
  3. PWA web应用模型
  4. HDU-4679-树的直径(树形dp)
  5. SPOJ KPSUM ★(数位DP)
  6. Day10 - Python异步IO、Pymysql、paramiko、
  7. Python flask网站部署总结
  8. pycharm git 提交使用情况
  9. 转载:left join和left semi join的联系和区别
  10. h1标签