An analyte sensor, comprising: a detection element having a detection portion configured to undergo a change in mass in response to adsorption of a target contained in an analyte or reaction with the target, the detection element being configured to output a detection signal which is an AC signal responsive to the change in mass in the detection portion; a reference element having a reference portion configured not to adsorb the target or not to react with the target, the reference element being configured to output a reference signal which is an AC signal serving as a reference relative to the detection signal; a branching section configured to branch one of the detection signal and the reference signal into a first signal and a second signal, and to branch the other signal of the detection signal and the reference signal into a third signal and a fourth signal; a first computation portion configured to derive a first measurement signal from the first signal and the third signal by heterodyne system; a second computation portion configured to derive a second measurement signal from the second signal and the fourth signal by heterodyne system, wherein the branching section is configured to set phases of the first to fourth signals so that the first measurement signal and the second measurement signal exhibit a phase-difference of a value other than ±180°; a measurement section configured to calculate two first candidate phase change values from the first measurement signal and calculate two second candidate phase change values from the second measurement signal, and to determine a combination of a first candidate phase change value and a second candidate phase change value that are closest to each other among combinations of the two first candidate phase change values and the two second candidate phase change values, and to define the first candidate phase change value and the second candidate phase change value of the combination as a first phase change value and a second phase change value, respectively; a selection section configured to select a phase change value from the first phase change value and the second phase change value, the phase change value being closer to a reference value in terms of signal output value; and a detection amount calculation section configured to determine the amount of detection of an analyte by calculation using the phase change value. a detection element having a detection portion configured to undergo a change in mass in response to adsorption of a target contained in an analyte or reaction with the target, the detection element being configured to output a detection signal which is an AC signal responsive to the change in mass in the detection portion; a reference element having a reference portion configured not to adsorb the target or not to react with the target, the reference element being configured to output a reference signal which is an AC signal serving as a reference relative to the detection signal; a branching section configured to branch one of the detection signal and the reference signal into a first signal and a second signal, and to branch the other signal of the detection signal and the reference signal into a third signal and a fourth signal; a first computation portion configured to derive a first measurement signal from the first signal and the third signal by heterodyne system; a second computation portion configured to derive a second measurement signal from the second signal and the fourth signal by heterodyne system, wherein the branching section is configured to set phases of the first to fourth signals so that the first measurement signal and the second measurement signal exhibit a phase-difference of a value other than ±180°; a measurement section configured to calculate two first candidate phase change values from the first measurement signal and calculate two second candidate phase change values from the second measurement signal, and to determine a combination of a first candidate phase change value and a second candidate phase change value that are closest to each other among combinations of the two first candidate phase change values and the two second candidate phase change values, and to define the first candidate phase change value and the second candidate phase change value of the combination as a first phase change value and a second phase change value, respectively; to calculate two first candidate phase change values from the first measurement signal and calculate two second candidate phase change values from the second measurement signal, and to determine a combination of a first candidate phase change value and a second candidate phase change value that are closest to each other among combinations of the two first candidate phase change values and the two second candidate phase change values, and to define the first candidate phase change value and the second candidate phase change value of the combination as a first phase change value and a second phase change value, respectively; a selection section configured to select a phase change value from the first phase change value and the second phase change value, the phase change value being closer to a reference value in terms of signal output value; and a detection amount calculation section configured to determine the amount of detection of an analyte by calculation using the phase change value.