A switching frequency jitter having output ripple cancel includes a
pattern generator generating a pattern code in response to a clock
signal. An oscillator generates an oscillation signal for determining a
switching frequency of a switching signal in response to the variation of
the pattern code. An attenuator is connected to a voltage feedback loop
for attenuating a feedback signal. The feedback signal is utilized to
control the pulse width of the switching signal. A programmable resistor
is connected to the attenuator for programming an attenuation rate of the
attenuator in response to the pattern code. The attenuation rate is
increased whenever the switching frequency increases. The pulse width of
the switching signal is thus reduced, which compensates the decrease of
the switching period and keeps the output power and the output voltage of
the power supply constant.