Hilbert transform with sine and cosine
34 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
Daniel M
2019-10-22
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).
2 个评论
Daniel M
2019-10-22
In your example, you have 4.75 cycles of the wave. Internally hilbert takes an fft of the signal. Fourier transforms behave circularly, that is, it assumes that the end of the signal wraps back around to the beginning of the signal.
Now because your signal ends at 3pi/2 phase, and begins at 0 phase, it is a large discontinuous jump. That is the source of the distortion of the imag(y1) part.
With real-world signals, typically you can't do much about this, and if your signal is long enough, you can truncate the beginning and ends (if that is applicable to your situation).
Otherwise, I have had some success in the past using paddedhilbert on the file exchange:
"Finally, if I have a random signal, named u, its Hilbert transform is always -imag(hilbert(u))? Thank you again for your time and attention."
No, the hilbert transform is the imaginary part (without the negative).
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Transforms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!