ip_06_03.m
上传用户:loeagle
上传日期:2013-03-02
资源大小:1236k
文件大小:1k
源码类别:

通讯编程文档

开发平台:

Matlab

  1. % MATLAB script for Illustrative Problem 6.3.
  2. echo on
  3. f_cutoff=2000; % the desired cutoff frequency
  4. f_stopband=2500; % the actual stopband frequency
  5. fs=10000; % the sampling frequency
  6. f1=2*f_cutoff/fs; % the normalized passband frequency
  7. f2=2*f_stopband/fs; % the normalized stopband frequency
  8. N=41; % This number is found by experiment.
  9. F=[0 f1 f2 1];
  10. M=[1 1 0 0]; % describes the lowpass filter
  11. B=remez(N-1,F,M); % returns the FIR tap coefficients
  12. % Plotting command follows.
  13. figure(1);
  14. [H,W]=freqz(B);
  15. H_in_dB=20*log10(abs(H));
  16. plot(W/(2*pi),H_in_dB);
  17. figure(2);
  18. plot(W/(2*pi),(180/pi)*unwrap(angle(H)));
  19. % Plot of the impulse response follows.
  20. figure(3);
  21. plot(zeros(size([0:N-1])));
  22. hold;
  23. stem([0:N-1],B);