An electronic device is disclosed. The electronic device comprises: a speaker; a first
microphone; a second
microphone; a memory for storing one or more computer programs; and one or more processors communicatively connected to the speaker, the first
microphone, the second microphone, and the memory, wherein the one or more computer programs include computer-
executable instructions and, when individually or collectively executed by the one or more processors, may control an external speaker to output sound of a first frequency, obtain a first sound
signal corresponding to the sound of the first frequency through the first microphone, obtain a
second sound signal including the first sound
signal through the second microphone, obtain a first
noise canceling
signal on the basis of the first sound signal and the
second sound signal, output, through the speaker, a second
noise canceling signal, in which at least one of the phase or the
gain of the first
noise canceling signal has been changed, and a third sound signal of a second frequency, obtain the
second sound signal by changing at least one of the phase or the
gain, and identify at least one of a target phase or a target
gain on the basis of a third frequency component that is related to
distortion product
otoacoustic emission (DPOAE) of the first frequency and the second frequency and is included in the second sound signal.