<< Calculus`FourierTransform`

f[x_]  =  UnitStep[x]
Plot[f[x], {x, -1, 1}]

FourierTrigSeries[f[x], x, 5]

Plot[%, {x, - .5,  .5}]

fs[x_]  =  FourierTrigSeries[f[x], x, 25]
Plot[fs[x], {x, - .5,  .5}]

Plot[fs[x], {x, -2, 2}]

f[x_]  =  UnitStep[x ] -  .5
Plot[f[x], {x, -1, 1}]

fs[x_]  =  FourierTrigSeries[f[x], x, 5]
Plot[fs[x], {x, - .5,  .5}]