首页 > 解决方案 > 使用 buttord() 设计巴特沃斯滤波器时,我得到 N 的零值或负值

问题描述

这些是我的低通巴特沃斯滤波器所需的规格。

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() 函数。

谢谢您的帮助。

标签: matlablowpass-filter

解决方案


我使用了错误的衰减公式:

以 dB 为单位的衰减电平 = 20 * log10(vout/vin)


推荐阅读