⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 iir.asv

📁 butt,cheb1,cheb2,elip四种常见的IIR滤波器使用小例子
💻 ASV
字号:
   Wp=4000/40000;
   Ws=8000/40000;
   Rp=0.5;
   Rs=40;
  [N1,Wn1]=buttord(Wp,Ws,Rp,Rs)    %巴特
  
  [N2,Wn2]=cheb1ord(Wp,Ws,Rp,Rs)   %切比1
  [N3,Wn3]=cheb2ord(Wp,Ws,Rp,Rs)   %切比2
  [N4,Wn4]=ellipord(Wp,Ws,Rp,Rs)   %椭圆
                                 
  [num1,den1]=butter(N1,Wn1);
  [num2,den2]=cheby1(N2,Rp,Wn2);
  [num3,den3]=cheby2(N3,Rs,Wn3);
  [num4,den4]=ellip(N4,Rp,Rs,Wn4);
  
  [h1,w]=freqz(num1,den1);
  subplot(2,1,1);
  plot(w/pi,abs(h1));grid
  xlabel('w/pi');
  ylabel('Butterworth Magnitude');
  subplot(2,1,2);
  plot(w/pi,angle(h1));grid
  xlabel('w/pi');
  ylabel('Phase(rad)');
  pause;
  
  [h2,w]=freqz(num2,den2);
  subplot(2,1,1);
  plot(w/pi,abs(h2));grid
  xlabel('w/pi');
  ylabel('Chebyshev1 Magnitude');
  subplot(2,1,2);
  plot(w/pi,angle(h2));grid
  xlabel('w/pi');
  ylabel('Phase(rad)');
  pause;
  
  [h3,w]=freqz(num3,den3);
  subplot(2,1,1);
  plot(w/pi,abs(h3));grid
  xlabel('w/pi');
  ylabel('Chebyshev2 Magnitude');
  subplot(2,1,2);
  plot(w/pi,angle(h3));grid
  xlabel('w/pi');
  ylabel('Phase(rad)')
  pause;
  
  [h4,w]=freqz(num4,den4);
  subplot(2,1,1);
  plot(w/pi,abs(h4));grid
  xlabel('w/pi');
  ylabel('Elliptic Magnitude');
  subplot(2,1,2);
  plot(w/pi,angle(h4));grid
  xlabel('w/pi');
  ylabel('Phase(rad)');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -