title: FFT noise frequency remove
body: <p>I use audacity to generate a 10Hz tone with 48KHz samplerate and 1 seconds duration. then load it with below script to plot FFT graph:</p>
  
  <pre><code>from scipy.io import wavfile
  from scipy.fftpack import fft, fftfreq
  import matplotlib.pyplot as plt
  from pydub import AudioSegment
  import numpy as np
  
  wav_filename = "\\test\\10Hz.wav"
  samplerate, data = wavfile.read(wav_filename)
  total_samples = len(data)
  limit = int((total_samples /2)-1)
  fft_abs = abs(fft(data))*2/total_samples
  fft_db = 20*np.log10(fft_abs/32760)
  freqs = fftfreq(total_samples,1/samplerate)
  # plot the frequencies
  plt.plot(freqs[:limit], fft_db[:limit])
  plt.xscale('log',basex=10)
  plt.title("Frequency spectrum")
  plt.xlabel('Hz')
  plt.ylabel('amplitude')
  plt.show()
  </code></pre>
  
  <p>I got below noisy graph:
  <a href="https://i.stack.imgur.com/vdjll.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vdjll.png" alt="enter image description here"></a></p>
  
  <p>But if I use audacity to view the spectrum graph, it's pretty good.</p>
  
  <p>How should I improve my script to get better FFT drawing?</p>