[Math] Finding Fourier series with function not centered at the origin

fourier seriessignal processingtransformation

I am trying to find both Fourier cosine and sine series which represent the function F(t) in the interval $(0, \pi)$

where $F(t)=\begin{cases}
\frac{\pi}{2} & \ \ 0<t< \frac{\pi}{2}\\
0 & \ \frac{\pi}{2}<t< \pi\end{cases}$

I suspect I am suppose to use the following equation to work out the Fourier Series:

Full Range Fourier Series Equation
$\\$

However, to work out $a_0$, $A_N$ and $B_N$, I need to know if this is an even or odd function first. But there are no information regarding what the function is like when $t<0$. So I don't know what to do.

(maybe I should put this as a separate question?)
Also, what is the difference between and Fourier cosine series and a Fourier sine series?

EDIT: I have worked out half of this question, for assuming that the equation is EVEN. But what should I do with assuming the function to be Odd?

Anyway, here's what I did for when it's EVEN, please have a look and let me know if I'm doing it right.

I think I got the answer now. Do correct me if I have a mistake anywhere though.

So as suggested by Raymond Manzoni, we can suppose the function is even to produce a Fourier Cosine Series and suppose the function is odd to produce a Fourier Sine Series.

Case 1: EVEN

$F(t)=\begin{cases}
0 & \ -\pi<t< \frac{-\pi}{2} \\
\frac{\pi}{2} & \ \frac{-\pi}{2}<t< \frac{\pi}{2}\\
0 & \ \frac{\pi}{2}<t< \pi\end{cases}$

$A_N \ = \frac{2}{T}\int_\frac{-T}{2}^\frac{T}{2} \ f(t)cos(\frac{2 \pi nt}{T})dt \\ \ \ \ \ \ \ = \frac{2}{2\pi}\int_{-\pi}^\pi \ f(t)cos(\frac{2 \pi nt}{2\pi})dt
\\ \ \ \ \ \ \ = \frac{1}{\pi}(\int_{-\pi}^\frac{-\pi}{2} \ 0.cos(nt)dt + \int_\frac{-\pi}{2}^\frac{\pi}{2} \ \pi.cos(nt)dt + \int_\frac{\pi}{2}^{\pi}\ \ 0.cos(nt)dt)
\\ \ \ \ \ \ \ = \frac{2}{\pi}(\int_0^\frac{\pi}{2} \ \pi.\cos(nt)dt)
\\ \ \ \ \ \ \ = 2\int_0^\frac{\pi}{2} \cos(nt)dt
\\ \ \ \ \ \ \ = 2[\frac{sin(nt)}{n}]_0^\frac{\pi}{2}
\\ \ \ \ \ \ \ = 2\frac{sin(n\frac{\pi}{2})}{n}$

$B_N = 0$ Since EVEN

$a_o$ does not = 0 since there is DC shift of $\pi$/4.

$a_0 = \frac{2}{T}\int_\frac{-T}{2}^\frac{T}{2} \ f(t)dt\
\\ \ \ \ \ = \pi$

substitute answer into:

Full Range Fourier Series Equation

Best Answer

As discussed in comments: there are two natural extensions of a function on $(0,\pi)$ to the larger interval $(-\pi,\pi)$.

In both cases the coefficients can be computed by integration over $(0,\pi)$, as stated on the pages linked above.

Related Question