We experimentally demonstrate repetitive M-ary spectral phase pulse shaping by placing a programmable pulse shaper driven by a 10-GHz source in a closed loop. This permits generation of encoded and decoded signals in the same apparatus by forming a closed loop to circulate a part of the output back into the pulse shaper. As a result, a series of M - 1 distinct encoded waveforms is sequentially generated, followed by generation of a properly decoded pulse.