sinpiece[x_,h_] = (UnitStep[x+h/2] - UnitStep[x-h/2]) Sin[2 π x]
FTsinpiece[k_,h_] = FourierTransform[sinpiece[x,h],x,k]//FullSimplify 
PSsinpiece[k_,h_] = Abs[FTsinpiece[k,h]]

Plot[sinpiece[x,10],{x,-10,10}]
Plot[PSsinpiece[k,10],{k,-10,10},PlotRange->All]

Plot3D[PSsinpiece[k,h],{k,-10,10},{h,0,20},PlotRange->All,PlotPoints->100]