title: why is amplitude of low frequency much lower than that of high frequency after using fft?
body: <p>I generate the sound using matlab and then play it over computer's speaker, meanwhile I record the sound using iphone, at last i send the 'record.wav' file to computer to analyze it. But here I found that the amplitude of low frequency much is lower than that of high frequency.</p>
  
  <p>The sound generation code looks like <code>A*sin(2*pi*697*(0:N-1)/44100)+A*sin(2*pi*1209*(0:N-1)/44100</code> if I want to generate a dial tone for number 1, N is the length that i want to generate and 44100 is the sampling frequency.</p>
  
  <p>Then I want to use FFT to analyze the frequency of the sound and plot the <a href="https://i.stack.imgur.com/1tN10.png" rel="nofollow noreferrer">FFT output</a>. Though I get the correct frequency I want, the amplitude looks different, which puzzles me a lot.</p>
  
  <p>So, what happened? Why are the two amplitudes different? </p>
  
  <pre><code>[temp,fs] = audioread('record.wav');
  [P1,f] = fft_recorder(temp,fs);
  
  function [P1,f] = fft_recorder(array,fs)
      array = fft(array);
      P2 = abs(array/length(array));
      P1 = P2(1:length(array)/2+1);
      P1(2:end-1) = 2*P1(2:end-1);
      f = fs*(0:(length(array)/2))/length(array);
  end
  
  </code></pre>