# Fourier-Analysis How to display every period correctly? [duplicate]

I want to express a function as a sum of fourier series.
I tried the code below. It works. But only get one period (from 0 to 1).
How to display every period correctly?

f = Piecewise[{{10 x, 0 <= x < 0.1}, {-(10/9) x + (10/9), 0.1 <= x < 1}}];
coeff = 1/4 Integrate[f, {x, 0, 1}];
coeff[n_] = 1/4 Integrate[f*Exp[I Pi n x/2], {x, 0, 1}];
series[m_, x_] := Sum[Exp[-I Pi n x/2] coeff[n], {n, -m, m}];
Plot[Evaluate[Table[series[j, x], {j, 1, 5}]], {x, -2, 2}] • This question, as it is asked, is more related to mathematics rather than Mathematica. I suggest you read more about Fourier Transform, Integral, Series, so you grasp the concepts and the relationships between them. – Sektor Nov 14 '13 at 6:49

You can try using Mathematica FourierSeries function directly. Change the plot range to see more periods. Manipulate[

Module[{x, f, g},
f = Piecewise[{{10 x, 0 <= x < 01/10}, {-(10/9) x + (10/9),1/10 <= x < 1}}];
g = FourierSeries[f, x, n];
Plot[{f, g}, {x, -lim, lim}, PlotRange -> All, ImageSize -> 300,ImagePadding -> 20]
],

{{n, 3, "number of terms"}, 0, 10, 1, ImageSize -> Tiny,Appearance -> "Labeled"},
{{lim, 10, "plot range"}, 1, 30, .1, ImageSize -> Tiny,Appearance -> "Labeled"},

SynchronousUpdating -> False,
SynchronousInitialization -> False,
ContinuousAction -> False,
Alignment -> Center,
ImageMargins -> 5,
FrameMargins -> 5,
ControlPlacement -> Top
]