Help to improve filtering please
2 views (last 30 days)
Show older comments
Hi,
I've been recommended to improve the filtering of my load-displacement data, collected at approx 800 Hz. I find peaks and valleys and then measure areas under the curves.
I'm a MATLAB and filtering novice.
Until now I used a 5 element moving average filter followed by another a filtering step. A colleague advised using the second filter - unaware that the data had been filtered in an earlier step.
%%First filter
theDisp= filter(ones(1,5),5,data(:,4).');
theLoad= filter(ones(1,5),5,data(:,5).');
% the data is then shortened and 'theLoad' becomes 'theLoad2'.
%%second filter
% this is as advised by colleague
Coeffs=[2 2 3 2 2];
Coeffs=Coeffs/sum(Coeffs);
figure, hold on, plot(theLoad2,'b')
theLoad2=filter(Coeffs,1,theLoad2);
theLoad2=flipud(filter(Coeffs,1,flipud(theLoad2)));
My question is, please, can you advise on how to better filter this data. I'm told that I shouldn't have filtered twice.
This link (https://www.dropbox.com/sh/1w93rsat6swvodj/4Xh67xCirI/MATLAB%20central%20query)
contains:
- Raw data
- Twice filtered data
- The code I use on the data to find the areas under the curves.
I've put the prefix 'f-' in front of the twice filtered data files.
Thank you.
2 Comments
Ryan
on 3 Aug 2012
Edited: Ryan
on 3 Aug 2012
I am not a filtering expert, but the second filter looks like a weighted moving average filter where the term in the series of numbers that is being "averaged" by the filter at a given moment has its value weighted slightly more than the 2 terms preceding/following it.
Where is your data coming from (what is the source of noise)?
The issue with filtering twice is that you are altering the data (think of an averaging filter like blurring an image, it removes noise, but it also "blurs" that data and when you do it twice, you may no longer be removing any noise and just further blurring the data).
Unfortunately at this time I do not have a better suggestion for your data, but was just trying to explain some of the things in your post.
Answers (0)
See Also
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!