I have the following code that records the audio through mic, then computes and plots its FFT.
recorder = audiorecorder(44100,16,1);
xtmessage = getaudiodata(recorder);
xaxis = zeros(88200,1);
Now, I generate sound using online tone generators in a quiet room with no background noise. However, the FFT plot always shows the 2x the frequency of the tone I generate. For instance, I make 440Hz sound, FFT shows impulses at +-880Hz, I make 2kHz sound, FFT shows impulses at +-4kHz. Following screenshot illustrates my problem,
Why is this? What am I doing wrong?