# When doing a Hilbert-transformation, why not simply multiplying by an exponential?

When doing the Hilbert-transformation, which is supposed to be a phase-shift by $\\-\frac{\pi}{2}$, why not simply use $\\e^{-j\frac{\pi}{2}}$ instead of $\\H(f) = -j \cdot \textrm{sgn}(f)$?

• BTW, $$e^{-j \frac{\pi}{2}} = -j$$ and multiplying a real-valued signal by $-j$ would make it an imaginary-valued signal. but a Hilbert transformer maps a real signal, $x(t)$, to another real signal denoted $\hat{x}(t)$. – robert bristow-johnson Sep 23 '16 at 20:51

In contrast to Jason R's answer I claim that the Hilbert transform is a phase shift by $-\pi/2$ for real-valued signals. By definition, a phase shifter shifts the phase of a sinusoidal signal by some given phase $\phi$:

$$x(t)=\cos(\omega_0t)\quad\Longrightarrow\quad y(t)=\cos(\omega_0t+\phi)\tag{1}$$

Since

$$\cos(\omega_0t)=\frac{e^{j\omega_0t}+e^{-j\omega_0t}}{2}\tag{2}$$

and

$$\cos(\omega_0t+\phi)=\frac{e^{j\omega_0t+\phi}+e^{-j\omega_0t-\phi}}{2}\tag{3}$$

it is clear that in order for the signal $x(t)$ to experience a phase shift by $\phi$, the positive frequencies need to be shifted by $\phi$ and the negative frequencies by $-\phi$. For $\phi=-\pi/2$ that's exactly what a Hilbert transformer does.

A constant transfer function like $H(f)=e^{-j\pi/2}=-j$ doesn't really do much apart from scaling the input signal, in this case by the imaginary unit. So the signal $x(t)=\cos(\omega_0t)$ is "transformed" into $y(t)=-j\cos(\omega_0t)$. Of course, for the special case of the complex-valued input signal $x(t)=e^{j\omega_0t}$ multiplication by $-j$ achieves a phase shift by $-\pi/2$, but usually we want to shift the phase of real-valued signals, and in that case we need a frequency-dependent transfer function.

• i think i am in agreement with Matt regarding definitions. – robert bristow-johnson Sep 24 '16 at 5:34
• the fact is that, if you can somehow disassemble the real sinusoid into the two exponential components $$\cos(\omega_0t)=\frac{e^{j\omega_0t}+e^{-j\omega_0t}}{2}\tag{2}$$ then scaling the $e^{j\omega_0t}$ component with $-j$ and scaling the $e^{-j\omega_0t}$ with $+j$ would do the trick. but without the use of the Hilbert Xform (which would introduce a circularity in implementation) i don't know how to separate the real sinusoid into the positive and negative frequency components. – robert bristow-johnson Sep 24 '16 at 5:38
• Of course this is correct for a tone. However, it is not correct for general real-valued signals. You can imagine many real-valued signals whose HT is not just a phase shift. As an example, one can look at the impulse response of a HT filter, or see the real-valued waveforms here: mathworld.wolfram.com/HilbertTransform.html – msm Sep 24 '16 at 6:59
• @msm: Obviously. There is no such thing as a phase shift for "general" signals. My point was the definition of a phase shift for real-valued (sinusoidal) signals, instead of complex exponentials, for which a phase shift is just a multiplication by a complex number. – Matt L. Sep 24 '16 at 7:09
• That said, there is no doubt that HT applies "phase shift" of $-\frac{\pi}{2}$ and $\frac{\pi}{2}$ to positive and negative frequencies. – msm Sep 24 '16 at 7:17

A Hilbert transform is not a phase shift of $-\frac{\pi}{2}$. As you noted in the question, its frequency response shifts positive frequencies by $-\frac{\pi}{2}$ and the negative frequencies by $\frac{\pi}{2}$. This is not the same as a constant phase shift across all frequencies, as you would get by multiplying by $e^{-j\frac{\pi}{2}}$.

• I answered the question that was asked; I would also dispute your assertion that multiplying by $j$ doesn't yield a phase shift. For a complex exponential $x(t)$, multiplying by a phasor does in fact shift its phase by the corresponding angle. And if you decompose the signal into an orthogonal set of complex exponential functions, then the phase shift applies to each one via linearity. There are subtleties in interpretation between the two domains, but nothing in my answer is incorrect. Time domain delay corresponds to a linear phase shift in the frequency domain, not a constant one. – Jason R Sep 23 '16 at 23:19
• I was wrong, sorry. The answer is quite correct of course. – Fat32 Sep 24 '16 at 0:18
• It's all about the definition of phase shift. A device called phase shifter is usually designed to shift the phase of real-valued signals. And by this definition, a Hilbert transformer is a phase shifter (by $-\pi/2$), and a simple multiplication by $-j$ is not. – Matt L. Sep 24 '16 at 5:25

The Hilbert operator is a very central operator in harmonic analysis. It is devoted Chapter 2 (The Central Idea: The Hilbert Transform) in Explorations in Harmonic Analysis with Applications to Complex Function Theory and two whole books by King, Hilbert transforms.

Its properties thus reach far beyond a mere phase-shift, and beyond what I can understand. The Hilbert transform yields reciprocal Hilbert pairs. One misleading impression is caused by the fact that sine and cosine are (up to a sign) Hilbert pairs, and together form the most important analytic signal:

$$e^{it} = \cos t+ i \sin t\,.$$

The primal function ($\cos$) is in blue, the dual ($\sin$) in green: The dotted line is the envelope of the analytic signal. Here, the "intuitive idea" behind the phase shift is apparent. But if you observe other Hilbert pairs, you can see a whole different picture. For a Cauchy function: For the cardinal sine: and for a rectangular window: I am still amazed that so different-looking function have the same amplitude spectrum, especially for the last one. It is easy to see that simple operations on phase in the frequency domain lead to not intuitive time behavior. One way to remember that is that if a function is symmetric (even), its Hilbert pair is antisymmetric (odd), and vice-versa.

• Nice plots. I'm just not sure what you mean by "some operations ... are not just simple phase shifts". A Hilbert transformer is a phase shifter in the sense that any sinusoidal signal experiences a phase shift by $-\pi/2$. What such a system does to a non-sinusoidal signal is just what is called "Hilbert transform", because the term "phase shift" is meaningless in that case. So I'd say that a Hilbert transformer is always a phase shifter, but that this doesn't give you much (intuitive) information regarding the response to an arbitrary (non-sinusoidal) input signal. – Matt L. Sep 24 '16 at 19:44
• Btw, if you mean by "primal" the original function, and by "dual" its Hilbert transform, then there's a sign error in your first plot: the Hilbert transform of $\cos(t)$ is $\sin(t)$ (no minus sign), at least according to the definition I know and use (phase shift by $-\pi/2$). Or do you mean something else by "primal" and "dual"? – Matt L. Sep 25 '16 at 8:46
• No, stupid mistake. My code was correct, and I changed the sign for this occasion. Don't understand why – Laurent Duval Sep 25 '16 at 18:23

The question has already an answer. I just think a small clarification would be nice regarding the interpretation of phase shift in the answer provided by @MattL.

Consider a square wave signal over a period equal to $L$. By looking at one of the other answers (From @LaurentDuval, the last plot) one can see how should the actual shape of the Hilbert transform of one rectangular pulse look like. Now the term phase shift does not apply to such signal since it is not sinusoidal (although sometimes is misused for its time-delayed versions). But how can we see that Hilbert transform actually shifts the phase, especially when we deal with a non-sinusoidal signal such as a square wave?

The answer is easy. Since phase shift only applies to sinusoidal signals, then we should express the general signal in terms of sinusoidal signals and shift them one-by-one. This can be done using the Fourier series representation of the signal.

The Fourier series representation of the square wave is $$f(t)=\frac{1}{4\pi}\sum_{n=1,3,...}^\infty \frac{1}{n}\sin(\frac{n\pi t}{L})$$

Now since the Hilbert transform of $\sin(t)$ is $\cos(t)$ (which is a phase shift), The Fourier series of the Hilbert transform of the square wave should be

$$f_{\text{HT}}(t)=\frac{1}{4\pi}\sum_{n=1,3,...}^\infty \frac{1}{n}\cos(\frac{n\pi t}{L})$$

In the figure below, I have plotted the two signals based on the first $50$ terms of their Fourier Series, which shows $f_{\text{HT}}$ is what we were expecting. • That's of course correct. Just a few details: 1. I'm missing the actual Fourier coefficients of the square wave in your formula (right now they're all $1$). 2. There's a sign error in the plot, because the Hilbert transform of $\sin(t)$ is $-\cos(t)$ (note the minus sign). If you compare your plot to the one in the wikipedia article you'll see that the sign is inverted. – Matt L. Sep 25 '16 at 8:42
• Thank you @MattL. I dropped the $\frac{1}{n}$ in the formula, now fixed it. About the sign, I think this is again one of those scaling controversies: mathworld.wolfram.com/HilbertTransform.html says $\mathcal{H}[\sin(t)]=\cos(t)$ – msm Sep 25 '16 at 9:04
• @msm, it's correct that the sign does not matter much as long as you stay consistent. However, in a signal processing context, the sign convention that gives you a positive frequency signal for $x(t)+\mathcal{H}[x](t) i$ is usually implied. – Jazzmaniac Sep 25 '16 at 9:17
• @Jazzmaniac That's a good point. Of course the exponent of the complex signal would be positive. Now that you pointed this out, I am interested in the possible implications if we proceed with the negative exponent... Any remarks? – msm Sep 25 '16 at 12:06
• @msm, note that your transform pair produces a negative frequency. The pair $\mathcal{H}[\cos] = \sin$ would give a positive frequency. There are no dramatic consequences for this choice other than that the sign change would propagate through a few other relations. Most notably, the analytic signal would be $x(t) - \mathcal{H}[x](t) i$ instead, or if you want to keep the same relationship, the signal would be anti-analytic. – Jazzmaniac Sep 25 '16 at 12:57