1. A method comprising: measuring a mutual capacitance on a sense element of a matrix-scanning device using a modulation circuit, wherein the matrix-scanning device comprises a plurality of drive lines and a plurality of sense lines and the sense element is located at an intersection of one of the plurality of drive lines and one of the plurality of sense lines; and switching the sense element to be coupled and decoupled to a capacitor of the modulation circuit using a first plurality of switches, wherein the first plurality of switches are controlled by a clock; converting the mutual capacitance measured on the sense element to a first digital value; measuring a self-capacitance on at least one of the plurality of drive lines; switching the at least one of the plurality of drive lines to be coupled and decoupled to the capacitor using a second plurality of switches, wherein the second plurality of switches are controlled by the clock; and converting the self-capacitance measured on the at least one of the plurality of drive lines to a second digital value.