Suppose we have a real signal $x(t)$. Now, we know that $x(t)$ can be represented as a sum of sines and cosines. w be the angular frequency.

  • If $a(\omega)$ be the coefficients of the cosine terms, and $b(\omega)$ be the coefficients of the sine terms, then if we perform a transformation on this signal such that now $b(\omega)$ are the coefficients of not sines but cosines and similarly, $a(\omega)$ the coefficients of the sines, then how will the waveform transform$[x(t)]$ look like?

    • What will be the similarity between this transformed waveform and the original waveform?

    • What is the name for this transformation (is it Hilbert transformation? )

Please attach graphs for an example $x(t)$ to clarify.

  • 1
    $\begingroup$ Is this a homework problem? If yes, can you post what progress you have made and where you are stuck? $\endgroup$
    – MBaz
    Commented Mar 19, 2017 at 16:03
  • $\begingroup$ No. It is not a homework problem but a thought that sprung into my mind while reading single sideband modulation. The signal to be transmitted is passed through two branches: in one, it is frequency shifted upwards by a cosine wave and in the other, it is multiplied by a negative sine pulse (of same frequency as cosine) and later is Hilbert transformed. Signals from these two branches are added up at last. $\endgroup$ Commented Mar 19, 2017 at 16:30
  • $\begingroup$ This response may help give you insight: dsp.stackexchange.com/questions/31355/… $\endgroup$ Commented Mar 19, 2017 at 19:53
  • 1
    $\begingroup$ Are talking about a periodic signal $x(t)$? You refer to coefficients $a$ and $b$, but you write them as functions of $\omega$. $\endgroup$
    – Matt L.
    Commented Mar 20, 2017 at 8:22
  • $\begingroup$ yes, books present the components as a integer variable k. I am choosing variable w = (k).(fundamental frequency), and so doesn't bring about any difference. You have still got the stuff what is being asked. $\endgroup$ Commented Mar 20, 2017 at 11:38

3 Answers 3


If you have a $T$-periodic signal $x(t)$ with a Fourier series expansion

$$x(t)=a_0+\sum_{n=1}^{\infty}\left[a_n\cos(n\omega_0t)+b_n\sin(n\omega_0t)\right],\quad \omega_0=\frac{2\pi}{T}\tag{1}$$

then its Hilbert transform is given by


because $\mathcal{H}\{\cos(t)\}=\sin(t)$, $\mathcal{H}\{\sin(t)\}=-\cos(t)$, and $\mathcal{H}\{c\}=0$ for constant $c$.

This is not exactly the same as just swapping the coefficients $a_n$ and $b_n$. The signal with swapped coefficients (assuming $a_0=0$) is


which is related to $\hat{x}(t)$ by


It is also equal to the Hilbert transform of $x(-t)$:


So swapping the coefficients is equivalent to applying a linear time-varying system to the signal. It cannot be achieved by a Hilbert transform alone (which is a time-invariant operation).

Note that for even signals ($b_n=0$) and for odd signals ($a_n=0$) one does indeed obtain the Hilbert transform (for odd signals with a negative sign) by swapping coefficients. This is shown in the example in hops's answer.


I will base my answer on the following definitions until I hear otherwise from you. I will use $T$ as the fundamental period of the periodic signal $x(t)$. So, $\omega$ takes on discrete values at $\omega = \frac{2 \pi}{T} k$ where $k$ varies over all non-negative integers ($0, 1, 2, \cdots, \infty$). The underlying signal may then be decomposed into $$ x(t) = a_0 + \sum_{k=1}^{\infty} a_k \cos\left(\frac{2\pi}{T} k t\right) + b_k \sin\left(\frac{2\pi}{T} k t\right).$$ I'm changing notations to something more natural for me, $a_k = a\left(\frac{2\pi}{T}k\right)$ and similarly $b_k = b\left(\frac{2\pi}{T}k\right)$.

Example 1: Let's consider a simple example. Perhaps the simplest non-trivial example (definitions of trivial may vary). Take $$x(t) = \left\{\begin{array}{cc}A&x \geq 0\\ -A & x < 0\end{array}\right.$$ The Fourier Series coefficients for this function (given as a sum of sines and cosines) with a fundamental period $T$ is given as $$a_k = \frac{1}{T} \int_{-T/2}^{T/2} x(t) \cos \left( \frac{2\pi}{T} k t\right)dt$$ and $$b_k = \frac{1}{T} \int_{-T/2}^{T/2} x(t) \sin \left( \frac{2\pi}{T} k t\right)dt.$$ All of the $a_k = 0$ since the integrand is odd (an even function times an odd function is odd). So, we only need to consider the $b_k$. Cranking through the calculus, we find that $$ b_k = \left\{\begin{array}{cc}0 & \mbox{$k$ is even}\\ \frac{4 A}{\pi k} & \mbox{$k$ is odd}\end{array}\right.$$

The MATLAB code below can be used to construct an approximation of both signals (using $a_k$ and $b_k$ conventionally and using them swapped).

A = 1;
T = 1;
N = 1000;

t = (-0.5*T:0.0001*T:0.5*T).';
x = zeros(size(t));
y = zeros(size(t));

for k = 1:2:N
    x = x + 4 * A / (pi*k) * cos(2*pi*k/T*t);
    y = y + 4 * A / (pi*k) * sin(2*pi*k/T*t);

plot(t, x)
title('Using a_k and b_k')

plot(t, y)
title('Swapping a_k and b_k')

The images below show that indeed, for this particular example, swapping the $a_k$ and $b_k$ yields (if not exactly then a scalar multiple of) the Hilbert Transform. It doesn't seem like a very practical way to obtain it though, and I haven't proven that it works in general for all periodic signals.

Approximation without swapped coefficients. Approximation of swapped coefficients.

  • $\begingroup$ The result in your figure equals $-\hat{x}(-t)$, where $\hat{x}(t)$ is the Hilbert transform of $x(t)$. Since $x(t)$ is odd, its Hilbert transform is even, so you get $-\hat{x}(t)$, which is just the Hilbert transform with a negative sign. Note that this is just the case because you have an odd signal. For an even signal you would indeed simply get the Hilbert transform by swapping the coefficients. For general signals, you can't obtain the Hilbert transform by just swapping the coefficients. $\endgroup$
    – Matt L.
    Commented Mar 23, 2017 at 12:49
  • $\begingroup$ Thanks for the clarification @MattL. I suspected something like that was happening, but I didn't have much time to investigate. $\endgroup$
    – hops
    Commented Mar 23, 2017 at 14:44

Let us just run a quick simulation and try ourselves. Assume we have a signal $s[n] = A \cos{(2 \pi \frac{f}{Fs} n )} $

A = 1000;
x = 0:1000;
f = 2;
Fs = 50;
s = A*cos(2*pi*f/Fs.*x);
F = fit(x(:),s(:),'fourier2');

I am using fourier series fitting upto 2 coefficients i.e., $(a_0, a_1, a_2)$ for the cosine term and $(b_1, b_2)$ for the sine term. $F$ will have a general model:

$$F(x) = a_0 + a_1 \cos{(\omega x)} + b_1 \sin{(\omega x)} + a_2 \cos{(2\omega x)} + b_2 \sin{(2 \omega x)}$$

Let us now flip the coefficients and see what happens to the phase of the new signal.

G = @(x) F.b1*cos(x.*F.w) + F.a1*sin(x.*F.w) + F.b2*cos(2.*x.*F.w) + F.a2*sin(2.*x.*F.w)
plot(x,s,x,G(x)); % To see the difference visually

h1 = hilbert(s);
h2 = hilbert(G(x));

phase_offset = mean(angle(h1./h2));

You will see the phase offset is about $1.57$ i.e. $\pi/2$. Basically switching the coefficients changes the phase of the signal.

You can also see this mathematically:

$$ s(t) = a_0 + \sum\limits_{n=1}^{\infty} a_n \cos{(n\omega_0 t)} + b_n \sin{(n\omega_0 t)} $$

Now if you were to reverse the signal in time and change the phase of these sine and cosine terms by $\pi/2$, i.e.,

$$ s^{'}(t) = a_0 + \sum\limits_{n=1}^{\infty} a_n \cos{(\pi/2 - n\omega_0 t)} + b_n \sin{(\pi/2 - n\omega_0 t)} $$

which is nothing but

$$ s^{'}(t) = a_0 + \sum\limits_{n=1}^{\infty} b_n \cos{(n\omega_0 t)} + a_n \sin{(n\omega_0 t)}$$

  • $\begingroup$ uhm $$\sin(n \omega_0 t - \pi/2)$$ is not $$+\cos(n \omega_0 t)$$. $\endgroup$ Commented Mar 24, 2017 at 4:33
  • $\begingroup$ Yes! you are right. I'll edit my answer. Thanks for pointing it out. $\endgroup$
    – Amal
    Commented Mar 24, 2017 at 14:24
  • $\begingroup$ Your signal is a single sinusoid, so it can be represented by a single Fourier series coefficient. $\endgroup$
    – Matt L.
    Commented Mar 24, 2017 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.