This function computes the Hilbert transform of data after it has been padded to ameliorate end effects. The method computes the Hilbert Transform according to its definition and is not optimized in terms of speed. It should also be noted that this function calculates the Hilbert Transform of the signal itself rather than the analytic signal as does the function hilbert in Matlab's Signal Processing toolbox. The analytic function can simply be calculated using the equation analyticFunction = 1i*paddedHilbert(y)+y.
Please don't hesitate to comment or contact me if you have suggestions about improvements that could be made to this function.