A power supply (50, 121), comprising: at least one input for coupling the power supply to an ac power source; at least one switched-mode power circuit configured to extract power from the power source, wherein the power is to be transferred to a load; at least one current sense resistor for sensing a current signal at the input of the power supply; and at least one control module (58, 122), the at least one current sensor and the at least one control module (58, 122) are coupled between the at least one input and the at least one switched-mode power circuit, the at least one control module (58, 122) comprising: an error amplifier having an inverting input terminal, a non-inverting input terminal and an output terminal, wherein the inverting input terminal is configured for receiving a first signal and a second signal; a control unit (65, 122) configured to receive a signal from the output terminal of the error amplifier and to generate a control signal, and configured to provide the control signal to the at least one switched-mode power circuit; wherein the first signal is a rectified voltage signal of the power source and the second signal is a signal from the current sense resistor; the error amplifier is configured to detect a difference between the first signal and the second signal at various angles of the voltage and current waves supplied by the power source and to adjust the signal at its output terminal in accordance with the detected difference; wherein the control module (58, 122) is configured to base the control of the switched-mode power circuit on the detected difference, such that in operation a voltage-to-current ratio at the at least one input of the power supply is regulated to be constant, or linear, over time, such as to mitigate output voltage ripple or output current ripple. at least one input for coupling the power supply to an ac power source; at least one switched-mode power circuit configured to extract power from the power source, wherein the power is to be transferred to a load; at least one current sense resistor for sensing a current signal at the input of the power supply; and at least one control module (58, 122), the at least one current sensor and the at least one control module (58, 122) are coupled between the at least one input and the at least one switched-mode power circuit, the at least one control module (58, 122) comprising: an error amplifier having an inverting input terminal, a non-inverting input terminal and an output terminal, wherein the inverting input terminal is configured for receiving a first signal and a second signal; a control unit (65, 122) configured to receive a signal from the output terminal of the error amplifier and to generate a control signal, and configured to provide the control signal to the at least one switched-mode power circuit; wherein the first signal is a rectified voltage signal of the power source and the second signal is a signal from the current sense resistor; the error amplifier is configured to detect a difference between the first signal and the second signal at various angles of the voltage and current waves supplied by the power source and to adjust the signal at its output terminal in accordance with the detected difference; wherein the control module (58, 122) is configured to base the control of the switched-mode power circuit on the detected difference, such that in operation a voltage-to-current ratio at the at least one input of the power supply is regulated to be constant, or linear, over time, such as to mitigate output voltage ripple or output current ripple. an error amplifier having an inverting input terminal, a non-inverting input terminal and an output terminal, wherein the inverting input terminal is configured for receiving a first signal and a second signal; a control unit (65, 122) configured to receive a signal from the output terminal of the error amplifier and to generate a control signal, and configured to provide the control signal to the at least one switched-mode power circuit; wherein the first signal is a rectified voltage signal of the power source and the second signal is a signal from the current sense resistor; the error amplifier is configured to detect a difference between the first signal and the second signal at various angles of the voltage and current waves supplied by the power source and to adjust the signal at its output terminal in accordance with the detected difference; wherein the control module (58, 122) is configured to base the control of the switched-mode power circuit on the detected difference, such that in operation a voltage-to-current ratio at the at least one input of the power supply is regulated to be constant, or linear, over time, such as to mitigate output voltage ripple or output current ripple.