这些是我的低通巴特沃斯滤波器的必需规格。
delta_l = 0.2929;
delta_h = sqrt(0.1);
passband_min = 1-delta_l;
stopband_max = delta_h;
% the passband and stopband edge frequencies, normalized from 0 to 1 where
% 1 corresponds to pi rad/sample
Wp = 0.25; %*pi
Ws = 0.4; %*pi
%in the input to buttord(), Rp is the passband ripple
%"no more than Rp dB of passband ripple"
Rp = mag2db(delta_l)
%in the input to buttord(), Rs is the stopband attenuation
Rs = mag2db(1-delta_h)
[n, Wn] = buttord(Wp, Ws, Rp, Rs)
输出为
Rp =
-10.6656
Rs =
-3.3018
n =
-1
Wn =
0.3805
显然是错误的。
使用数学方法,我得到的截止频率为0.7854,n = 3。 一旦获得这些值,我计划将它们放入butter()函数中。
谢谢您的帮助。
答案 0 :(得分:0)
我使用了错误的衰减公式:
衰减级别(dB)= 20 * log10(vout / vin)