# Why does Hilbert filter distorts the shape of the signal?

If all the harmonics composing a the signal are shifted by the same amount, this would be the same as sampling later or earlier in time. I think.

Take a simple pulse train as an example.
If Fourier is performed when the pulse is high for time t after 0, and flat for time t before the 0 it will have odd symmetry and only sin harmonics. If the same signal was sampled differently with half of the pulse left of y-axis and other half right of it, it would have even symmetry and contain only cos terms.

Each time actual signal is the same, just its Fourier representation is different. Difference between these is only shifting all harmonics by 90 degrees. Why is Hilbert filter different in those regards?

I know square wave passed through Hilbert filter produces sideways curly braces like shape, so my fundamental understanding of something is wrong. Thanks for help.

A Hilbert transform is dispersive, as in any constant phase shift over frequency, which will distort a signal that has bandwidth. This is because a fixed DELAY, which would have no distortion, has linear phase versus frequency. If you fix the phase versus frequency to be constant (as we do in a Hilbert transform), the delay at each frequency will be different and thus will cause significant distortion to the signal.

This is demonstrated with my slide below that is used for explaining why linear phase filters are important specifically, but also helps demonstrate what a constant phase shift versus frequency would do. Note that delay specifically is the derivative of phase versus frequency:

$$delay = \frac{d\phi}{d\omega}$$

In the slide below, the first three Fourier components of a square wave signal are shown, along with their addition when they all add up in time (which would happen with a linear phase filter as the delay in time given the formula above would be the same for each frequency). The "Non-linear Phase" case shows what happens if the Fourier components are summed after going through different time delays, which occurs in non-linear phase filters, AND occurs if the composite signal goes through a system where the phase is constant for all frequencies (as the time delay for each frequency must be different in order for the phase to be the same). Assuming that the width of the rectangular signal in your figure equals half the period, then the corresponding Fourier series can indeed be written as a weighted sum of sines (left-hand side signal) and a weighted sum of cosines (right-hand signal). Taking the signal on the right-hand side in your figure as an example, its Fourier series can be written in the form

$$x_1(t)=a_0+\sum_{n=1}^{\infty}a_n\cos\left(\frac{2\pi n}{T}t\right)\tag{1}$$

And since the even Fourier coefficients are zero (apart from $a_0$), the series in $(1)$ can be rewritten as

$$x_1(t)=a_0+\sum_{n=1}^{\infty}a_{2n+1}\cos\left(\frac{2\pi (2n+1)}{T}t\right)\tag{2}$$

The Hilbert transform of $(2)$ is simply obtained by replacing the cosines with sines:

$$\mathcal{H}\{x_1(t)\}=a_0+\sum_{n=1}^{\infty}a_{2n+1}\sin\left(\frac{2\pi (2n+1)}{T}t\right)\tag{3}$$

However, this expression is different from the Fourier series of the signal on the left-hand side in your figure, which can be obtained by shifting $x_1(t)$ by $T/4$:

\begin{align}x_2(t)=x_1(t-T/4)&=a_0+\sum_{n=1}^{\infty}a_{2n+1}\cos\left(\frac{2\pi (2n+1)}{T}(t-T/4)\right)\\&=a_0+\sum_{n=1}^{\infty}a_{2n+1}\cos\left(\frac{2\pi (2n+1)}{T}t-n\pi-\frac{\pi}{2}\right)\\&=a_0+\sum_{n=1}^{\infty}a_{2n+1}\sin\left(\frac{2\pi (2n+1)}{T}t-n\pi\right)\\&=a_0+\sum_{n=1}^{\infty}a_{2n+1}(-1)^n\sin\left(\frac{2\pi (2n+1)}{T}t\right)\tag{4}\end{align}

This expression has only sine terms, as expected, but it is clearly different from the Hilbert transform $(3)$, because shifting also changes the series coefficients.