There is provided a waveform generator that generates a waveform. The
waveform generator includes: a lamp waveform generating section that
generates a lamp wave of which a signal value linearly changes for a
predetermined period; a square wave generating section that generates a
square wave of which pulse width is generally equivalent to the
predetermined period; a waveform adding section that generally accords a
timing at which a signal value in the lamp wave begins to be changed and
a timing at a leading edge of the square wave, to add the lamp wave and
the square wave; and a low-pass filter that removes a predetermined
frequency band component from a waveform output from the waveform adding
section.