且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Matlab中对数组应用低通或高通滤波器?

更新时间:2022-05-25 21:38:26

查看 filter 函数.

如果您只需要一个1极低通滤波器,那就是

If you just need a 1-pole low-pass filter, it's

xfilt = filter(a, [1 a-1], x);

其中a = T/t; T =样本之间的时间,τ (tau)是过滤器时间常数.

where a = T/τ, T = the time between samples, and τ (tau) is the filter time constant.

以下是对应的高通滤波器:

Here's the corresponding high-pass filter:

xfilt = filter([1-a a-1],[1 a-1], x);

如果您需要设计滤波器,并拥有信号处理工具箱的许可证,请访问 fvtool fdatool .

If you need to design a filter, and have a license for the Signal Processing Toolbox, there's a bunch of functions, look at fvtool and fdatool.