Fixed square wave function