notch 滤波器是一种用于去除特定频率成分的滤波器,通常用于消除信号中的特定频率的干扰或噪声。也可以与一个系统级联,用于抑制系统谐振峰的影响。
假设 notch 滤波器的下陷频率为
ω
c
\omega_c
ωc,下陷程度为
d
B
d
o
w
n
dB_{down}
dBdown,则
ω
c
\omega_c
ωc 处的增益为
1
0
−
d
B
d
o
w
n
20
10^{-\frac{dB_{down}}{20}}
10−20dBdown。
则 notch 滤波器设计为:
H
(
s
)
=
s
2
+
ω
c
⋅
s
+
ω
c
2
s
2
+
1
0
d
B
d
o
w
n
20
⋅
ω
c
⋅
s
+
ω
c
2
H(s) = \frac{s^2 + \omega_c \cdot s + \omega_c^2}{s^2 + 10^{\frac{dB_{down}}{20}} \cdot \omega_c \cdot s + \omega_c^2}
H(s)=s2+1020dBdown⋅ωc⋅s+ωc2s2+ωc⋅s+ωc2
假设要设计一个在 200Hz 处下陷 20dB 的notch滤波器。如下所示:
代码很简单
omega_c = 200*2*pi;
dB_down = 20;
amp_down = 10^(dB_down/20);
notch_filter = tf([1, omega_c, omega_c^2],[1, amp_down*omega_c, omega_c^2]);
figure;bode(notch_filter,".-");grid on
效果如图
如果想再调节下陷的广度,再引入一个参数
a
a
a,形式如下:
H
(
s
)
=
a
⋅
s
2
+
ω
c
⋅
s
+
a
⋅
ω
c
2
a
⋅
s
2
+
1
0
d
B
d
o
w
n
20
⋅
ω
c
⋅
s
+
a
⋅
ω
c
2
H(s) = \frac{a \cdot s^2 + \omega_c \cdot s + a \cdot \omega_c^2}{a \cdot s^2 + 10^{\frac{dB_{down}}{20}} \cdot \omega_c \cdot s + a \cdot \omega_c^2}
H(s)=a⋅s2+1020dBdown⋅ωc⋅s+a⋅ωc2a⋅s2+ωc⋅s+a⋅ωc2
a
a
a 可以控制下陷的宽度,
a
a
a 越大,凹陷越窄,如
a
=
10
a = 10
a=10 时:
代码和结果如下:
omega_c = 200*2*pi;
dB_down = 20;
amp_down = 10^(dB_down/20);
a = 10;
notch_filter = tf([a, omega_c, a*omega_c^2],[a, amp_down*omega_c, a*omega_c^2]);
figure;bode(notch_filter,".-");grid on
有这两个参数就可以设计出任何形状的 notch 滤波器。
手推的公式,用了请点个赞。