IIR 椭圆型模拟低通滤波器设计原理

2020-07-21  本文已影响0人  JeffreyLau

椭圆型模拟低通滤波器的模方函数
|H(j\omega)|^2 = \frac{1}{1+\varepsilon^2R_N^2(w/w_c)}

椭圆型模拟低通滤波器频域特性

filter_design_ellipord_001.png

椭圆型滤波器设计步骤

步骤一:由通带截频\omega_p确定\omega_c

\omega_p=\omega_c

步骤二:由阻带衰减As确定\varepsilon :

        $\varepsilon = \sqrt{10^{0.1Ap - 1}}$

步骤三:由通带和阻带指标确定k :

k = w_p/w_s

步骤四:由阻带衰减确定k1:

k1 = \varepsilon / \sqrt{10^{0.1Ap - 1}}

步骤五:确定阶段N:

filter_design_ellipord_002.png

步骤五:最后确定系统函数

使用matlab求椭圆型滤波器的系统函数以及频率响应

Wp=2*pi*1000;%将数字频率转换成模拟频率
Ws=2*pi*2000;%将数字频率转换成模拟频率
Ap=1;%最大通带衰耗
As=40; % %最小阻带衰耗
%求阶数和Wc
[N,Wc]=ellipord(Wp,Ws,Ap,As,'s'); %Computer analog filter order
fprintf('Order of the filter=%.0f\n',N)
%求分之和分母系数
[num,den] = ellip(N,Ap,As,Wc,'s'); %Compute AF coefficients
disp('Numerator polynomial'); 
fprintf('%.4e\n',num);
disp('Denominator polynomial'); 
fprintf('%.4e\n',den);
% 求Wp和Ws两点对应的频率响应
omega=[Wp Ws]; 
h = freqs(num,den,omega); %Compute Ap and As of the AF
ap = -20*log10(abs(h(1)));% 将通带频率响应转换成衰耗值,
as = -20*log10(abs(h(2)));% 将阻带频率响应转换成衰耗值,

hp = abs(h(1));
hs = abs(h(2));

gain_p = 20*log10(abs(h(1))); 
gain_s = 20*log10(abs(h(2))); 

fprintf('Ap= %.4f\n',-20*log10(abs(h(1))));
fprintf('As= %.4f\n',-20*log10(abs(h(2))));

%求0~6000pi之间的频率响应
omega = [0: 200: 3000*2*pi];
h = freqs(num,den,omega); %Compute the frequency response of the AF
subplot(211);

plot(omega/(2*pi),abs(h),'LineWidth',3);%画出频率响应曲线
hold on;%在画完函数虚线之后保持曲线图
plot([0 Wp/(2*pi)],[hp hp],'r--'); %画两个虚线
plot([Wp/(2*pi) Wp/(2*pi)],[0 hp],'r--');

plot([0 Ws/(2*pi)],[hs hs],'r--'); %画两个虚线
plot([Ws/(2*pi) Ws/(2*pi)],[0 hs],'r--');

hold off;
xlabel('Frequency in Hz'); 
ylabel('H(jw)');

gain=20*log10(abs(h)); 
subplot(212);
plot(omega/(2*pi),gain,'LineWidth',3);
hold on;%在画完函数虚线之后保持曲线图
plot([0 Wp/(2*pi)],[gain_p gain_p],'r--'); %画两个虚线
plot([Wp/(2*pi) Wp/(2*pi)],[0 gain_p],'r--');

plot([0 Ws/(2*pi)],[gain_s gain_s],'r--'); %画两个虚线
plot([Ws/(2*pi) Ws/(2*pi)],[0 gain_s],'r--');

hold off;

xlabel('Frequency in Hz'); 
ylabel('Gain in dB');
Order of the filter=4
Numerator polynomial
1.0000e-02
0.0000e+00
5.9290e+06
0.0000e+00
5.0179e+14
Denominator polynomial
1.0000e+00
5.9008e+03
5.9759e+07
1.9936e+11
5.6301e+14
Ap= 1.0000
As= 40.0007
num=[1.0000e-02 0.0000e+00 5.9290e+06 0.0000e+00 5.0179e+14];
den=[1.0000e+00 5.9008e+03 5.9759e+07 1.9936e+11 5.6301e+14];
subplot(211);
sys=tf(num,den);%求出系统的零极点
pzmap(sys,'r');%画出系统零极点
grid on
subplot(212);
omega = [0: 200: 3000*2*pi];
H=freqs(num,den,omega);%得到频率响应
plot(omega/(2*pi),abs(H),'LineWidth',3);%画出频率响应
xlabel('Frequency Hz');
title('Magnitude Respone');
filter_design_ellipord_004.png
上一篇下一篇

猜你喜欢

热点阅读