MATLAB: Hilbert transform with sine and cosine

cosinehilbert-transformsine

Hello there,
I have a question: from theory I know that the Hilbert transform of a simple sine is a cosine and viceversa. Now, the question is: why if I compute the Hilbert transform (with the function hilbert.m) of a sine, and I take the imaginary part of that transform, that imaginary part, once plotted, is not a cosine?
I think I miss what the matlab function really does. Someone can help me?
Thanks in advance.

Best Answer

The hilbert transform, as per the documentation, indicates that the imaginary part of the transform is the original (real) sequence with a 90 degree phase shift. Therefore, a cosine becomes a sine (because that is what happens when you shift a cosine wave by pi/2 to the right). A sine wave becomes a negative cosine, because that is what happens when you shift a sine wave by pi/2 to the right.
When it says "Sines are therefore transformed to cosines, and conversely, cosines are transformed to sines." it means that in the sense of odd and even functions (where sines are asymmetric about zero, and cosines are symmetric about zero).