Some examples of Fourier Transforms

squarewave[x_,n_] = UnitStep[x-n] - UnitStep[x-n -.5]

squarewave[x,1]

Plot[squarewave[x,.5],{x,0,5}]

swtrain[x_] = Sum[squarewave[x,n],{n,20}];
Plot[swtrain[x],{x,0,20},Filling->Axis]

ftswtrain[w_] = Abs[FourierTransform[swtrain[x],x,w]];
Plot[Log[ftswtrain[w]],{w,0,20},PlotRange->All]

f[x_] = Piecewise[{{0,x<0},{Sin[x],x>0}}]
Plot[f[x],{x,0,20}]
ff[k_] = FourierTransform[f[x],x,k]
Plot[ff[k],{k,-5,5},PlotRange->All]
Plot[ff[k],{k,.5,1.5}]

f[x_] = Piecewise[{{0,x<0},{Sin[x],0<x<2 Pi}}]
Plot[f[x],{x,-10,10}]
ff[k_] = FourierTransform[f[x],x,k]
Plot[Abs[ff[k]],{k,-10,10},PlotRange->All]

f[x_] = Piecewise[{{0,x<0},{Sin[x],0<x< 1.5 Pi}}]
Plot[f[x],{x,-10,10}]
ff[k_] = FourierTransform[f[x],x,k]
Plot[Abs[ff[k]],{k,-10,10},PlotRange->All]

f[x_] = Piecewise[{{0,x<0},{Sin[x],0<x< 1.3 Pi}}]
Plot[f[x],{x,-10,10}]
ff[k_] = FourierTransform[f[x],x,k]
Plot[Abs[ff[k]],{k,-10,10},PlotRange->All]

f[t_] = Sin[2 Pi t];
timesamples = Table[.1 i,{i,20}];
fsamples = f[timesamples];
ListPlot[fsamples]

ListPlot[Abs[Fourier[fsamples]],PlotRange->All,Joined->True]