A switching mode power supply, comprising: a transformer having a primary winding and a secondary winding to supply power to a load; a feedback circuit that generates a feedback signal (V FB) that varies in relation to the load on the secondary winding; a switching circuit coupled to the primary winding, wherein the switching circuit having a switch coupled to the primary winding to control current flow through the primary winding; and a control circuit coupled to the switching circuit, wherein the control circuit outputs a switching frequency to toggle the switch of the switching circuit in response to the feedback signal (V FB) and the current flow through the primary winding; wherein the control circuit comprises: a spectrum shaping circuit (107, 207), which generates a spectrum shaping signal (S F) in response to the feedback signal (V FB), wherein the switching frequency is varied within a spectrum shaping range in accordance to the spectrum shaping signal (S F); a clock generator (105, 205), for generating a clock signal in response to the spectrum shaping signal (S F), the clock generator (105, 205) comprises a capacitor (C 0), a current source (I Ct), a switch (S 3), and a first comparator (U 1), wherein the capacitor (C 0), the current source (I Ct), and the switch (S 3) of the clock generator are coupled in parallel between a first input terminal of the first comparator (U 1) and a primary side ground, the spectrum shaping signal (S F) is coupled to a second input terminal of the first comparator, and the output of the first comparator (U 1) provides the clock signal; and a logical circuit (106, 206), wherein one input terminal of the logical circuit (106, 206) receives a comparison signal, the other input terminal of the logical circuit (106, 206) receives the clock signal, and the logical circuit (106, 206) provides a control signal which is used to control the on/off of the switching circuit (108, 208) in response to the comparison signal and the clock signal. a transformer having a primary winding and a secondary winding to supply power to a load; a feedback circuit that generates a feedback signal (V FB) that varies in relation to the load on the secondary winding; a switching circuit coupled to the primary winding, wherein the switching circuit having a switch coupled to the primary winding to control current flow through the primary winding; and a control circuit coupled to the switching circuit, wherein the control circuit outputs a switching frequency to toggle the switch of the switching circuit in response to the feedback signal (V FB) and the current flow through the primary winding; wherein the control circuit comprises: a spectrum shaping circuit (107, 207), which generates a spectrum shaping signal (S F) in response to the feedback signal (V FB), wherein the switching frequency is varied within a spectrum shaping range in accordance to the spectrum shaping signal (S F); a clock generator (105, 205), for generating a clock signal in response to the spectrum shaping signal (S F), the clock generator (105, 205) comprises a capacitor (C 0), a current source (I Ct), a switch (S 3), and a first comparator (U 1), wherein the capacitor (C 0), the current source (I Ct), and the switch (S 3) of the clock generator are coupled in parallel between a first input terminal of the first comparator (U 1) and a primary side ground, the spectrum shaping signal (S F) is coupled to a second input terminal of the first comparator, and the output of the first comparator (U 1) provides the clock signal; and a logical circuit (106, 206), wherein one input terminal of the logical circuit (106, 206) receives a comparison signal, the other input terminal of the logical circuit (106, 206) receives the clock signal, and the logical circuit (106, 206) provides a control signal which is used to control the on/off of the switching circuit (108, 208) in response to the comparison signal and the clock signal. a spectrum shaping circuit (107, 207), which generates a spectrum shaping signal (S F) in response to the feedback signal (V FB), wherein the switching frequency is varied within a spectrum shaping range in accordance to the spectrum shaping signal (S F); a clock generator (105, 205), for generating a clock signal in response to the spectrum shaping signal (S F), the clock generator (105, 205) comprises a capacitor (C 0), a current source (I Ct), a switch (S 3), and a first comparator (U 1), wherein the capacitor (C 0), the current source (I Ct), and the switch (S 3) of the clock generator are coupled in parallel between a first input terminal of the first comparator (U 1) and a primary side ground, the spectrum shaping signal (S F) is coupled to a second input terminal of the first comparator, and the output of the first comparator (U 1) provides the clock signal; and a logical circuit (106, 206), wherein one input terminal of the logical circuit (106, 206) receives a comparison signal, the other input terminal of the logical circuit (106, 206) receives the clock signal, and the logical circuit (106, 206) provides a control signal which is used to control the on/off of the switching circuit (108, 208) in response to the comparison signal and the clock signal.