1. ## Fourier Series help

Hi,

Need help with the following question:

f(t) = t - 1, 1<t<2
with an even half range expansion, and f(t)=f(t+4)

Now, I have to sketch this between -6 and 6. Is an "even extension" the same as "even half range expansion"?
If I am to sketch this would it be
a t-1 line from 1<t<2 and 4<t<5
a -t-1 line from -1<t<-2 and -4<t<-5
and 0 elsewhere in -6<t<6
???

2. Originally Posted by hashi
Hi,

Need help with the following question:

f(t) = t - 1, 1<t<2
with an even half range expansion, and f(t)=f(t+4)

Now, I have to sketch this between -6 and 6. Is an "even extension" the same as "even half range expansion"?
If I am to sketch this would it be
a t-1 line from 1<t<2 and 4<t<5
a -t-1 line from -1<t<-2 and -4<t<-5
and 0 elsewhere in -6<t<6
???
As the function has period 4, it needs to be defined on a larger interval than (1,2), is it supposed to be zero on (0,1)??

CB

3. nope.. it's supposed to be 1 to 2

4. Originally Posted by hashi
nope.. it's supposed to be 1 to 2
Then there is not enough information to do anything with a periodic function of period 4, the function needs to be defined over a whole period, which allowing for even symmetry still requires it be defined on an interval of length 2.

CB

5. actually, yes i am pretty sure it's supposed to be zero elsewhere..
now what/

6. Originally Posted by hashi
actually, yes i am pretty sure it's supposed to be zero elsewhere..
now what/
OK so now we have the function:

$f(x)= \begin{cases} 0,\ \ \ \ \ \ \ 0\le x <1 \\ t-1,\ \ 1 \le x \le 2 \end{cases}$

Which we extend symmetricaly to the range $-2 \le x \le 2$, to get:

$f(x)= \begin{cases} -t-1, \ \ -2 \le x \le -1 \\
0, \ \ \ \ \ \ \ \ \ -1 < x < 1 \\
t-1,\ \ \ \ \ \ \ 1 \le x \le 2
\end{cases}
$

CB

7. Sorry, how did you get f(x) = 1 between 1 and 2 when the function is
f(t)=t-1?

Also, since we are sketching over a domain -6<t<6 would it be...
Now, I have to sketch this between -6 and 6. Is an "even extension" the same as "even half range expansion"?
If I am to sketch this would it be
a t-1 line from 1<t<2 and 4<t<5
a -t-1 line from -1<t<-2 and -4<t<-5
and 0 elsewhere in -6<t<6
???
(what i said before?)

thanks

8. Hey guys. This is what I think it is. Hope I don't cause confusion:

$f(x)=\left\{\begin{array}{cc}
-t-5 & -6\leq t \leq -5 \\
-t-1 & -2\leq t\leq -1 \\
t-1 & 1\leq t\leq 2 \\
t-5 & 5\leq t \leq 6 \\
0 & \text{otherwise}
\end{array}\right.
$

I've plotted $f(x)$ and the first 50 terms of it's Fourier series superimposed over it in the plot below. If that's the function you're working with and need help figuring it's Fourier series, I can post my calculations.

9. Originally Posted by hashi
Sorry, how did you get f(x) = 1 between 1 and 2 when the function is
f(t)=t-1?

Also, since we are sketching over a domain -6<t<6 would it be...
Now, I have to sketch this between -6 and 6. Is an "even extension" the same as "even half range expansion"?
If I am to sketch this would it be
a t-1 line from 1<t<2 and 4<t<5
a -t-1 line from -1<t<-2 and -4<t<-5
and 0 elsewhere in -6<t<6
???
(what i said before?)

thanks
by misremembering what the function was (since I was not looking at it at the time) fixed now.

CB

10. Originally Posted by shawsend
Hey guys. This is what I think it is. Hope I don't cause confusion:

$f(x)=\left\{\begin{array}{cc}
-t-5 & -6\leq t \leq -5 \\
-t-1 & -2\leq t\leq -1 \\
t-1 & 1\leq t\leq 2 \\
t-5 & 5\leq t \leq 6 \\
0 & \text{otherwise}
\end{array}\right.
$

I've plotted $f(x)$ and the first 50 terms of it's Fourier series superimposed over it in the plot below. If that's the function you're working with and need help figuring it's Fourier series, I can post my calculations.
Your diagram does not show a function with period 4.

CB

11. Originally Posted by hashi
Sorry, how did you get f(x) = 1 between 1 and 2 when the function is
f(t)=t-1?

Also, since we are sketching over a domain -6<t<6 would it be...
Now, I have to sketch this between -6 and 6. Is an "even extension" the same as "even half range expansion"?
If I am to sketch this would it be
a t-1 line from 1<t<2 and 4<t<5
a -t-1 line from -1<t<-2 and -4<t<-5
and 0 elsewhere in -6<t<6
???
(what i said before?)

thanks
Remember we have an even period 4 function so the plot outside the fundmental period is obtained by a periodic extension.

CB

12. hey shawsend.. how do you just plot f(x) and it's even half range expansion?

Thanks

13. Well, I wasn't planning on saying anything further since I got it wrong above and I'm not familiar with the phrase "even half extension", but since you asked, I think it's the function:

$f(x)=\left\{\begin{array}{cc}
-t-5 & -6\leq t \leq -5 \\
t+3 & -3\leq t\leq -2 \\
-t-1 & -2\leq t\leq -1 \\
t-1 & 1\leq t\leq 2 \\
-t+3 & 2\leq t \leq 3 \\
t-5 & 5\leq t \leq 6 \\
0 & \text{otherwise}
\end{array}\right.
$

That's the plot below and I used the following Mathematica code with the "Which" operator to plot it:

Code:
f[t_] := Which[-6 <= t <= -5, -t - 5, -3 <= t <= -2, t + 3,
-2 <= t <= -1, -t - 1, 1 <= t <= 2, t - 1, 2 <= t <= 3, -t + 3,
5 <= t <= 6, t - 5];
Plot[f[x], {x, -6, 6}]
Now the Fourier series for the function is easy to calculate:

Let $T=\text{Abs}(-6-6), \omega_n=\frac{2\pi n}{T}$

and:

$\text{F.S}\; f(x)=\frac{a_0}{2}+\sum_{n=1}^{\infty}a_n\cos(\ome ga t)+b_n\sin(\omega t)$

with:

$a_n=\frac{2}{T}\int_{-6}^{6} f(t)\cos(\omega_n t)dt$

$b_n=\frac{2}{T}\int_{-6}^{6} f(t)\sin(\omega_n t)dt$

And if Captain Black reprimands me again for getting it wrong it's your fault.

14. shawsend, I have a similar problem to the one the OP has. Can you explain how to get a plot of the fourier approx in matlab?

anyone?

15. I don't use Matlab. But the principle is the same: calculate the coefficients, say 25 or so, put them all together in the Fourier sum as a function, then plot the results. The following is my Mathematica code. You can probably easily convert it to Matlab code assuming Matlab can handle the conditional function definition.

Code:
f[t_] := Which[-6 <= t <= -5, -t - 5, -3 <= t <= -2, t + 3,
-2 <= t <= -1, -t - 1, 1 <= t <= 2, t - 1, 2 <= t <= 3,
-t + 3, 5 <= t <= 6, t - 5, -5 <= t <= -3, 0, -1 <= t <= 1,
0, 3 <= t <= 5, 0];
fplot = Plot[f[x], {x, -6, 6}];
a0 = NIntegrate[f[t], {t, -6, 6}];
a = Table[(1/6)*NIntegrate[f[t]*Cos[((Pi*n)/6)*t], {t, -6, 6}],
{n, 1, 25}];
b = Table[(1/6)*NIntegrate[f[t]*Sin[((Pi*n)/6)*t], {t, -6, 6}],
{n, 1, 25}];
fs[x_] := N[a0/12 + Sum[a[[n]]*Cos[Pi*(n/6)*x] +
b[[n]]*Sin[Pi*(n/6)*x], {n, 1, 25}]];
fsplot = Plot[fs[x], {x, -6, 6}, PlotStyle -> Red];
Show[{fplot, fsplot}]