How to filter a low frequency movement from my data
Afficher commentaires plus anciens
Goodmorning,
For my thesis i'm analyzing wave data of flume tests. But it seems that there is some sort of 'long wave' present in the flume. Now i am trying to filter this long wave out of my data but i can't find a decent way to to this.
I already tried to filter my data using the Polyfit and polyval functions, this did filter the long wave out of the signal. But in my opinion this was more or less tweaking the function to get a good result. Secondly i do not want to use a moving avarage because this eliminates data. My supervisor told me to try the Filtfilt option. But now i am stuck wondering how to filter my signal with use of this FiltFilt.
See the figure below, there seems to be some longer wave present which i want to filter out for both the water level elevation and velocity. I was wondering if this is even possible or that my 'timeframe' is to short.

Réponse acceptée
Plus de réponses (1)
Domanic
le 6 Fév 2018
Applying a filter with filtfilt removes the filter offset, so you'll probably find that combining filtfilt with a moving average (high pass) filter gives you the results that you're looking for.
Let's say that you want to filter out a sine wave oscillating at 1/10th the frequency of another sine wave. Then you could use:
X=0:0.01:10*pi;
sumsin = sin(X)+sin(10*X);
N=129; % The cut-off frequency -> 0 as N->inf
plot(X,sumsin)
ff = -ones(1,N)/N; % the
ff(65)=1-ff(floor(N/2));
hold all;
plot(X,filtfilt(ff,1,sumsin))
Of course, better quality low pass filters exist, for example Butterworth ('butter' in Matlab), but moving average is a really easy place to start. If you want to visualise your filter, use
fvtool(ff,1)
Catégories
En savoir plus sur Analog Filters dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!