"Levelling" out a signal with moving average
이전 댓글 표시
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
Sean de Wolski
2012년 2월 23일
Huh? Could you elaborate a little more, perhaps with an image of a plot to help explain? If you want a more constant average - expand your window length.
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?
Sandy
2012년 2월 23일
채택된 답변
추가 답변 (2개)
Honglei Chen
2012년 2월 23일
Maybe you want to try detrend?
doc detrend
댓글 수: 2
Sandy
2012년 2월 23일
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일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 Digital Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!