the periodic fourier series described by the fourier integral of

f(x)=a       (-p/2,0)
f(x)=-a      (0,p/2)

where a is the amplitude and p is the period

there is a phenomenon called(I believe) the Gibbs phenomenon to describe why no mechanical method can create a true square wave