How to remove offset to the time axis or low frequency trend and asymmetry of a time series data?

9 views (last 30 days)
I have time series data set. I wish to de-trend the data to make the sine waves symmetric with respect to the time axis. I tried using the detrend command offered in matlab and high pass filtering to data. No of them give me acceptable result. How can I write code to realize this?
Thanks in advance.
Sam Zhu

Answers (1)

Image Analyst
Image Analyst on 21 Sep 2014
Do you have the Image Processing Toolbox? If so, use
meanSignal = 0.5 * (imerode(signal, se) + imdilate(signal, se));
newSignal = signal - meanSignal;
Basically it takes the halfway point between the upper envelope and the lower envelope, and subtracts that from the original signal. Pick the se window so that it includes at least one full cycle.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!