title: How to create a white noise signal in Python, and filter the noise signal with bandpass filter?
body: <p>I'm doing a project about speech processing. I wonder how to create a white noise signal in Python, and filter the noise signal with bandpass filter?</p>
  
  <pre><code>import pyaudio
  import numpy as np
  import scipy.signal as signal
  
  CHUNK = 64 #the block size
  Q = 50
  
  pa = pyaudio.PyAudio()
  stream = pa.open(format=pyaudio.paFloat32,
                              channels=1,
                              rate=44100,
                              output=True)
  while True:
      noise = np.random.uniform(-1,1,CHUNK)
      b,a = signal.iirfilter(1,[2*500*(1-1/(2*Q))/44100,2*500*(1+1/(2*Q))/44100])
      output = signal.lfilter(b,a,noise)
      output.astype(np.float32)
      output = output.tobytes()
      stream.write(output)
  </code></pre>
  
  <p>Is the code right? And what is the difference between <code>signal.iirfilter</code> and <code>signal.butter</code>?
  Thank you very much.</p>