# Is Hilbert transform not defined for complex signals?

Is Hilbert transform not defined for complex signals? In MATLAB, the function hilbert ignores if you give a complex sequence as input. Why?

• A related question, if the input signal is complex, then how to determine the analytic signal in MATLAB? just performing Hilbert operation on real and imag part and then adding the each complex output? – user47274 Jan 21 '20 at 19:42

The Hilbert transform can be applied to complex functions of a real variable. E.g., the Hilbert transform of the complex exponential $e^{j\omega_0t}$, $\omega_0>0$, is given by

$$\mathcal{H}\{e^{j\omega_0t}\}=-je^{j\omega_0t},\qquad\omega_0>0$$

The problem you encounter has to do with Matlab's implementation of the function hilbert.m. It is designed for real-valued input sequences and it will ignore any imaginary part. Note that despite its name this function does not simply return the Hilbert transform of the input vector, but it computes the corresponding analytic signal, i.e. it returns a complex vector, the real part of which is equal to the input vector, and the imaginary part of which is the Hilbert transform of the input vector.

So if for whatever reason you want to compute the Hilbert transform of a complex vector, you need to do the following:

x = ...    % some complex vector
xr = real(x);
xi = imag(x);
xr_ = imag(hilbert(xr));    % Hilbert transform of real part
xi_ = imag(hilbert(xi));    % Hilbert transform of imaginary part
x_ = xr_ + 1i * xi_;        % Hilbert transform of complex vector x

• That is a complete and superb answer. Thanks. @Matt L – Seetha Rama Raju Sanapala Mar 6 '16 at 18:23
• @SeethaRamaRaju: You're welcome! Good to know that it was helpful. – Matt L. Mar 6 '16 at 18:45