FourierTransform[1,t,s,FourierParameters->{-1,1}]

f[t_,T0_]:=Module[{},
If[t≤-T0/2,0,If[t≥T0/2,0,  Cos[t]]]
]
Plot[f[t,Pi],{t,-Pi,Pi}]

FourierTransform[f[t,Pi],t,f,FourierParameters->{-1,1}]
% /.f->2 Pi f

Integrate[A Cos[Pi t/T0] Exp[-I*2*Pi*f*t ],{t,-T0/2,T0/2}]

f[x_]:=If[x≥  ((-1)/2)&&x≤ (1/2),1,0]
T0=2;
Plot[f[x],{x,-4,4}]
coef[n_]:=Module[{k,x,int},
int=(1/T0) Integrate[f[x]*Exp[-I*2 Pi/T0*x*k],{x,-2,2}];
Limit[int,k->n]
]

coef[0]

coef[1]

from=-40;to=40;
coeff=Table[coef[k],{k,from,to}]
getCoeff[k_]:=coeff[[k+(to+1)]];
xApprox[t_]:=Module[{k},Sum[getCoeff[k]*Exp[I*Pi*t*k],{k,from,to}]]

y=Table[xApprox[t],{t,-4,4,.01}];
data=Transpose[{Range[-4,4,.01],y}];
ListPlot[data,Joined->True,PlotRange->All,PlotTheme->"Classic"]

coef[k]

Limit[((Sin[((k π)/2)])/(k π)),k->0]

f[x_] := If[x >= -2^(-1) && x <= 1/2, 1, 0]
T = 2; 
Clear[x, k]; 
int = (1/T)*Integrate[f[x]*Exp[(-I)*2*(Pi/T)*x*k], 
    {x, -2, 2}]
coef[n_] := Limit[int, k -> n]

N[Table[coef[n], {n, -7, 7}]]

s= TriangleWave[{-1,1},x] UnitStep[x]- TriangleWave[{-1,1},x]UnitStep[x-.5]

Plot[ s,{x,-3,3},PlotRange->All]
FourierTransform[s,x,w]

Fourier[{1,1,1,1,1}]//Chop

?Fourier

Sum[Exp[-I w m],{m,-2,2}]//ExpToTrig

Sum[Exp[-I w m],{m,-2,2}]//ExpToTrig

Plot[UnitStep[x],{x,-10,10}]

Clear[x,s];
res=FourierTransform[UnitStep[x],x,s,FourierParameters->{-1,1}]