找回密码
 注册
Simdroid-非首页
查看: 162|回复: 2

求达人帮我分析下FIR滤波器的设计

[复制链接]
发表于 2011-8-6 10:35:30 | 显示全部楼层 |阅读模式 来自 陕西西安
题目是这个样子的:
设计FIR滤波器(低通,四种窗函数, fs=1200Hz, 截止频率300Hz,
阶数自选, 画频率特性并分析比较)。

最好的话,能够帮我解决一下,实在是隔行如隔山~一点不通啊。。。
多谢~~
 楼主| 发表于 2011-8-6 21:12:58 | 显示全部楼层 来自 陕西西安
Simdroid开发平台
谁知道阻带频率和题目中的关系?
回复 不支持

使用道具 举报

 楼主| 发表于 2011-8-14 10:09:50 | 显示全部楼层 来自 陕西西安
这个是我用工具箱做的。希望对后来人有帮助。
  1. clear;
  2. Fs = 1200;  % Sampling Frequency

  3. N    = 19;       % Order
  4. Fc   = 300;      % Cutoff Frequency
  5. flag = 'scale';  % Sampling Flag
  6. Beta = 0.5;      % Window Parameter
  7. %% 凯撒窗  %%
  8. % Create the window vector for the design algorithm.
  9. win = kaiser(N+1, Beta);

  10. % Calculate the coefficients using the FIR1 function.
  11. b  = fir1(N, Fc/(Fs/2), 'low', win, flag)
  12. [h,f] = freqz(b,1,2048,1200);
  13. figure;
  14. plot(f,20*log10((abs(h))))
  15. title('凯撒窗')

  16. %% 矩形窗  %%
  17. % Create the window vector for the design algorithm.
  18. win = rectwin(N+1);

  19. % Calculate the coefficients using the FIR1 function.
  20. b  = fir1(N, Fc/(Fs/2), 'low', win, flag)
  21. [h,f] = freqz(b,1,2048,1200);
  22. figure;
  23. plot(f,20*log10((abs(h))))
  24. title('矩形窗')

  25. %% 海明窗  %%
  26. % Create the window vector for the design algorithm.
  27. win = hamming(N+1);

  28. % Calculate the coefficients using the FIR1 function.
  29. b  = fir1(N, Fc/(Fs/2), 'low', win, flag)
  30. [h,f] = freqz(b,1,2048,1200);
  31. figure;
  32. plot(f,20*log10((abs(h))))
  33. title('海明窗')

  34. %% 汉宁窗  %%
  35. % Create the window vector for the design algorithm.
  36. win = hann(N+1);

  37. % Calculate the coefficients using the FIR1 function.
  38. b  = fir1(N, Fc/(Fs/2), 'low', win, flag)
  39. [h,f] = freqz(b,1,2048,1200);
  40. figure;
  41. plot(f,20*log10((abs(h))))
  42. title('汉宁窗')

  43. %% 布莱克曼窗  %%
  44. % Create the window vector for the design algorithm.
  45. win = blackman(N+1);

  46. % Calculate the coefficients using the FIR1 function.
  47. b  = fir1(N, Fc/(Fs/2), 'low', win, flag)
  48. [h,f] = freqz(b,1,2048,1200);
  49. figure;
  50. plot(f,20*log10((abs(h))))
  51. title('布莱克曼窗')
复制代码
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Simapps系列直播

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-10-6 10:34 , Processed in 0.034289 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表