-2

我正在寻找一个截止频率为 12Hz 的 3dB 低通滤波器。我知道Matlab有这个功能fdesign.lowpass,它应该可以是3dB F3db/附加),但我还不确定如何实现它们,即:我应该包含哪些功能,哪些功能不应该。我对我认为不需要的所有其他变量感到困惑——我只需要 Fc 和 3dB。我还发现fdatool但也不知道如何设置这样的过滤器。

数据包含常规的 x 和 y 值,同时它将是记录运动的速度与时间图。

4

1 回答 1

1

对于您的应用程序,我强烈建议您尝试使用普通的巴特沃斯过滤器,Matlab 语法是:

[b,a]=butter(n,Wn)

数字频率在哪里Wn,所以这是我的姿势:

% assume x is time and y is speed
Ts = mean(diff(x));
Fs = 1/Ts;
% for butter, we need Wn, which is the cutoff frequency
% where 0.0 < Wn < 1.0, where 1.0 is half the sample rate
% The cutoff is the -3 dB point of the filter
% Wn = fCutOff/(Fs/2)
% for a cutoff of 12 Hz
fCutOff = 12/(Fs/2);
% we'll start with an order of 1 which should give us about 20 db/decade attenuation
[b,a] = butter(1,fCutoff);
% plot the filter frequency response to see what it looks like
% use 512 points to plot it
freqz(b,a,512,Fs)

但是,如果我理解正确,您以大约 66 Hz 的频率对数据进行采样,这比您想要的截止频率快大约 5 倍。经验法则通常是 10 次,因此您可能对得到的输出并不真正满意。这是我的输出:结果

于 2013-06-24T14:52:17.590 回答