What is the difference between freqs and freqz

16 次查看(过去 30 天)
clear all;
clc
close all
fp=[300 400];fs=[200 500];
rp=3;rs=18;
Fs=2000;
wp=fp*2*pi/Fs;
ws=fs*2*pi/Fs;
wap=2*Fs*tan(wp./2)
was=2*Fs*tan(ws./2);
[n,wn]=buttord(wap,was,rp,rs,'s');
[z,p,k]=buttap(n);
[bp,ap]=zp2tf(z,p,k)
bw=wap(2)-wap(1)
w0=sqrt(wap(1)*wap(2))
[bs,as]=lp2bp(bp,ap,w0,bw)
[h1,w1]=freqs(bp,ap);
figure(1)
plot(w1,abs(h1));grid;
ylabel(' lowpass G(p)')
w2=[0:Fs/2-1]*2*pi;
h2=freqs(bs,as,w2);
[bz1,az1]=bilinear(bs,as,Fs)
[h3,w3]=freqz(bz1,az1,1000,Fs);
figure(2)
plot(w2/2/pi,20*log10(abs(h2)),w3,20*log10(abs(h3)));grid;
ylabel('Bandpass AF and DF')
xlabel(' Hz')

回答(1 个)

Ravi datta
Ravi datta 2021-2-9
Freqz---) used for returning Frequency response for analog filters
Freqs---) used for returning Frequency response for digital filters

类别

Help CenterFile Exchange 中查找有关 Digital Filter Design 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by