2

I am a complete beginner at MATLAB and signal analysis so I don't really understand the fourier mathematics behind signal filtering. I took my Ipod Touch and used an app that records the accelerometer data (at 50Hz sampling rate) to a CSV and I loaded that CSV data into matlab. I am now trying to apply a low pass filter to the signal to get rid of the noise that occurs when from small changes in acceleration (so I am left with just the large signals of acceleration).

I read a bunch about signal filtering in matlab today and I own the signal processing toolbox, but I am still very confused on what certain variables mean. For instance the function filter(b,a,data) keeps coming up and I know that a and b are vectors of coefficients but I have no idea how these effect the filter or how to create these values based on what i know about my signal/what I want done with it.

Where should I go to learn the basics of signal processing if I don't have a strong background with Fourier analysis? And how should I go about creating my low pass filter in matlab? Thanks!

Here is the sample data I am working with.

I tried just winging it and making a=[1 -0.9] b=1 based on some other stackexchange posts bout low pass filters in matlab and it seems to have done something but it also seems to have magnified my signal 3-fold. What exactly did I do by applying a filter with those values?

4

1 回答 1

5

如果你想用 matlab 设计过滤器,你可以先在文档中阅读它们,例如这里。如果您只想使用它,则可以使用该fvtool实用程序研究不同参数的效果。然而,像大多数工具一样,如果您花几分钟阅读用户手册,您更有可能从中获得一些东西。对于初学者,您需要了解在哪里设置频率截止。

下图显示了 3 种不同滤波器的频率响应。左侧面板是您的滤波器的响应,并突出显示了您观察到放大的原因:低频信号按约 10 倍缩放。您使用的滤波器是带反馈的 IIR 型。中间面板显示了一个类似的过滤器,它的选择更合理b。一个更简单的 FIR 滤波器可能适合您的需求,如右图所示,使用fir1. IIR 滤波器的缺点是它不会对所有频率都表现出统一的群延迟响应,这对于您的特定应用可能是不可取的。

在此处输入图像描述

下图显示了使用 IIR 和 FIR 滤波器获得的原始数据和滤波数据:

在此处输入图像描述

最后,下图展示了您在过滤前后的频域数据。由于滤波器,信号在 2.5 Hz 以上的下降是显而易见的。对所选 FIR 滤波器的响应不如 IIR 滤波器那么平滑,并且会产生纹波,但衰减更突然,高频信号比低频信号衰减得更多。

在此处输入图像描述

于 2013-08-15T13:19:42.387 回答