A method of generating a pulse width modulated (PWM) signal receives digital
demand
data comprising at least one more significant bit and at least one less significant
bit. The PWM signal comprises a sequence of one or more frames, each frame comprising
a plurality of PWM pulses whose duty cycle is substantially governed by the at
least one more significant bit. At least one of its PWM pulses is selected to have
its duty cycle modified in response to the at least one less significant bit. Each
of the at least one less significant bit uniquely mapping onto the at least one
selected PWM pulse of the frame. An apparatus operable according to this method
includes an optical attenuator whose optical attenuation is dependent upon its
temperature and in which the temperature and, hence, the attenuation is controlled
using the above PWM signal.