This function searches the interior of a signal in an attempt to find a segment that may be used in order to make the signal quasi-periodic. This can be used to reduce the influence of end effects on analyses such as the Hilbert Transform, the Wavelet Transform, the Hilbert-Huang Transform and EMD, or Hilbert Vibration Decomposition. It is not perfect but has helped me in my analyses and hopefully it can help you too.
Please post a comment or send me an email if there are any changes you would like to see in the code.
MATLAB 7.8 (R2009a)
None but demo does require Signal Processing Toolbox in order to perform the Hilbert Transform