A pulse shaping apparatus for shaping an input optical pulse into an output
optical pulse having substantially constant optical power, includes a
modulator that acts upon the input optical pulse in response to a control
signal. A sampling unit samples a portion of the input or output pulse and
generates a sample signal that corresponds to the optical power of the
input or output optical pulse. In a preferred embodiment, the sampling
unit includes a power splitter that splits off sample portion of the input
or output pulse, and directs the sample portion to the photodetector which
generates the sample signal. Processing of the sample signal may be
performed in either an analog or digital form.