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

📄 filter1a.m

📁 the programs are an introduction to DSP ,the programs illustrate the frequency response ,impulse res
💻 M
字号:
function filter_demo1a

n=0:100;
imp=zeros(101,1);
imp(1)=1; x=imp;

k = input ('filter gain =');


for m=[0.7:-0.2:0.3];
   z = [0 0]; % z: Zeros in the z-plane
   p = [m+j*m m-j*m];  % p: poles in the z-plane
   z=z.'; p=p.';
   zplane (z,p)
   
   pause
   
   [num,den]=zp2tf(z,p,k);
   
   h=filter(num,den,x);
   subplot, plot(n,h)
   title('Impulse Response')
   xlabel('index (n)'),ylabel('h(n)')
   
   hold off
   pause
   figure
   
   [H,W]=freqz(num,den,512);
   subplot(211), plot(W/2/pi,abs(H))
   xlabel('f (normalized Hz)'),ylabel('Magnitude Response')
   subplot(212), plot(W,angle(H))
   xlabel('w (rad)'),ylabel('Phase Response')
   
   pause
   clf
   
end


⌨️ 快捷键说明

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