"Levelling" out a signal with moving average
4 ビュー (過去 30 日間)
古いコメントを表示
I'm doing studies on stress-relaxation with a dynamic displacement. The result I have is a almost sinusoidal signal with a moving average (decreasing due to stress-relaxation).
I'm wondering what is the best way to shift all the waves so that instead of having a moving average, I can have a constant average?
Thanks!
3 件のコメント
Tom
2012 年 2 月 23 日
If it is fairly sinusoidal, you could do an FFT (or several over different 'windows' of data) to determine the time period of one oscillation, and work out an average over this period?
採用された回答
Sean de Wolski
2012 年 2 月 23 日
What about using medfilt1 in the signal processing toolbox?
doc medfilt1
Edit: more
pictures really are worth thousands of words
Use the median filter, medfilt1 to create a new vector and then subtract this from your original.
6 件のコメント
Honglei Chen
2012 年 2 月 23 日
You will have to drop the edge if you use medfilt1 because that is your transient response.
その他の回答 (2 件)
Honglei Chen
2012 年 2 月 23 日
Maybe you want to try detrend?
doc detrend
2 件のコメント
Honglei Chen
2012 年 2 月 23 日
Then what I can think of is to do a polyfit on your data and then subtract the resulting fit from your data. But I don't know how good it can work out.
Gurudatha Pai
2012 年 2 月 23 日
I would recommend fitting an exponential curve rather than a poly fit. e.g see example 8.10 in Steven M. Kay, "Fundamentals of Statistical Signal Processing: Estimation Theory." pp 257.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!