1

I am computing the Fourier series (F.S.) expansion of the following signal

Graph

If I choose the Period as from $-2$ to $2$, the non-zero F.S. coefficients $c_k$ for $k \neq 0$ using the complex form of F.S. expansion is

$$ c_k =\frac{1}{4} \left [ \int_{-2}^{0} \frac{-1}{2} \, \text{e}^{-j\, k\, \omega_0 \, t} \text{d}t + \int_{0}^{2} \frac{1}{2} \, \text{e}^{-j\, k\, \omega_0 \, t} \text{d}t\right ]$$

I get separately the terms $\frac{1}{j\, 8\, k\, \omega_0} \left [ 1- \text{e}^{j\, 2 \, k\, \omega_0}\right ] + \frac{1}{j\, 8\, k\, \omega_0} \left [ 1- \text{e}^{-j\, 2 \, k\, \omega_0}\right ]$

which can be finally combined to give as the final answer when using $\omega_0=\frac{2\, \pi}{4}=\frac{\pi}{2}$:

$$ c_k = \frac{1}{j\, 2\, \pi\, k }\, \left [ 1-\cos k\pi\right ] \quad k \neq 0$$ and $c_k=0$ for $k=0$ as expected for the signal.

Next I choose the Period as from $0$ to $4$. The F.S. expansion for $k \neq 0$ gives $c_k$ as

$$ c_k = \frac{1}{4} \left [ \int_{0}^{2} \frac{1}{2} \, \text{e}^{-j\, k\, \omega_0 \, t} \text{d}t + \int_{2}^{4} \frac{-1}{2} \, \text{e}^{-j\, k\, \omega_0 \, t} \text{d}t\right ]$$

I get separately the terms $\frac{1}{j\, 8\, k\, \omega_0} \left [1-\text{e}^{-j\, 2 \, k\, \omega_0}\right ] + \frac{1}{j\, 8\, k\, \omega_0} \left [ \text{e}^{-j\, 4 \, k\, \omega_0} - \text{e}^{-j\, 2 \, k\, \omega_0}\right ]$

which can be finally combined to give as the final answer when using $\omega_0=\frac{2\, \pi}{4}=\frac{\pi}{2}$:

$$ c_k = \frac{1}{j\, 2\, \pi\, k }\, \left [ 1-\text{e}^{-j\, k\, \pi} \right ] \quad k \neq 0$$ and $c_k=0$ for $k=0$ as expected for the signal.

Now whether for $k$ is even or odd, $\cos k\pi=\text{e}^{-j\, k\, \pi}$ which equals to $1$ when $k$ is even and $-1$ when $k$ is odd.

It then should also not matter if I change $\text{e}^{-j\, k\, \pi}$ to $\text{e}^{+j\, k\, \pi}$ as they both give $1$ or $-1$ when even and when odd respectively. My question would be: Are the all these forms for $c_k$ for $k \neq 0$ equivalent:

$$ c_k = \frac{1}{j\, 2\, \pi\, k }\, \left [ 1-\cos k\pi\right ] = \frac{1}{j\, 2\, \pi\, k }\, \left [ 1-\text{e}^{-j\, k\, \pi} \right ] = \frac{1}{j\, 2\, \pi\, k }\, \left [ 1-\text{e}^{+j\, k\, \pi} \right ]$$ ???

Only the answer with the cosine term will handle well the behaviour as $k$ goes to $\pm \infty$.

Also if we try to arrive at the answer by another method by taking a train of box cars with height $1$ and width $2$ and as an even signal then

$$c_k=\frac{\sin \frac{k\pi}{2}}{k\pi} \quad k\neq 0$$

and apply the time shift theorem to get

$$c_k=\frac{\sin \frac{k\pi}{2}}{k\pi} \text{e}^{-j\, k \, \frac{\pi}{2}} \quad k\neq 0$$

for the signal which we are trying to determine its Fourier series, then simplifying the above expression does give

$$ c_k = \frac{1}{j\, 2\, \pi\, k }\, \left [ 1-\text{e}^{-j\, k\, \pi} \right ] \quad k \neq 0$$

which is the answer we got with Period as from $0$ to $4$.

Thank you.

Wolgwang
  • 1,563
macy
  • 51

1 Answers1

0

Since $k$ is an integer - yes, all of those forms are equivalent. I'd prefer writing it in yet another form, $$c_k=\begin{cases}0&k\text{ is even}\\ \frac1{k\pi i}&k\text{ is odd}\end{cases}$$ (Note on conventions: among mathematicians, $i$ is standard for the imaginary unit)
This pattern of the coefficients being pure imaginary and odd (replace $k$ by $-k$, and they flip) is standard for the Fourier series of a real odd function. The even coefficients being zero is more special to this function; that comes from symmetry around $\pm 1$.

jmerry
  • 19,403
  • I'm not a mathematician, hence the $j$ :). Otherwise, thank you for suggesting this form of separating $k$ even and $k$ odd, and for why we end up with purely imaginary coefficients for my odd signal. – macy Jan 17 '19 at 09:35
  • The $\cos$ here can be substituted for only one exponential term because of its argument $k\pi$. Hence my confusion. – macy Jan 17 '19 at 09:47
  • On second thought - what I said at the end there needed some correction. Edited. And yes, I'm aware that you're not a mathematician. – jmerry Jan 17 '19 at 10:13
  • Can you please elaborate on the last line you added? Does this apply for any value other than $\pm 1$ except $0$ say for a different function? – macy Jan 17 '19 at 10:32
  • It's easiest to see with the real form, sines and cosines. An odd term, $\sin \frac{2\pi}{L}n x$ for odd $n$, has odd symmetry around $0$ and $\frac{L}{2}$ where the sine is zero, and even symmetry around $\pm\frac{L}{4}$ where the sine is $\pm 1$. An even term $\sin\frac{2\pi}{L}n x$ for even $n$ has odd symmetry around all four points. So this case of a function that splits into quarters with odd symmetry at zero and even symmetry at the quarter points gives us a sine series with only the odd terms nonzero. – jmerry Jan 17 '19 at 12:04
  • Thank you for the explanation. If we consider the sinusoidal signal $\sin \frac{2\pi}{L}, nx$, can you please give an example that will have even symmetry at all quarter points $L/4$ (and with odd symmetry at zero)? – macy Jan 18 '19 at 04:57