title: What are 'order' and 'critical frequency' when creating a low pass filter using `scipy.signal.butter()`
body: <p><strong>Context:</strong></p>
  <p>I'm trying to create a low pass filter to cut off frequencies above 10khz of a soundfile.</p>
  <pre><code>import librosa
  import scipy.signal as sig
  import numpy as np
  import matplotlib.pyplot as plt
  
  filename = librosa.example('nutcracker')
  y, sr = librosa.load(filename)
  
  # modeled after example in scipy.signal docs:
  sos = sig.butter(10, 11, btype='lowpass', analog=False, output='sos')
  filtered = sig.sosfilt(sos, y)
  </code></pre>
  <p>Now, I know what a low-pass filter does but not how it does it or the math behind it. So the first two arguments of <code>scipy.signal.butter(N, Wn, ... )</code> are a little bit mysterious to me:</p>
  <blockquote>
  <p>N : <em><strong>int</strong></em></p>
  <p>The order of the filter.</p>
  </blockquote>
  <blockquote>
  <p>Wn : <em><strong>array_like</strong></em></p>
  <p>The critical frequency or frequencies. For lowpass and
  highpass filters, Wn is a scalar; for bandpass and bandstop filters,
  Wn is a length-2 sequence.</p>
  </blockquote>
  <p>At first I thought <code>Wn</code>, described as 'critical frequency` was the cutoff/threshold for the filter. However, setting it at anything over 1 results in an error telling me the value must be between 0 and 1.</p>
  <p><strong>Here's my work/research:</strong></p>
  <ol>
  <li><p>Googling 'low pass filter critical frequency' results in a lot of results about <strong>cut-off frequencies</strong> and <strong>corner frequencies</strong>, which sure seem to resemble my original idea of a 'cutoff point'.</p>
  </li>
  <li><p>I also found some formulas to calculate the cut-off frequency based on a filter's 'transfer function', but apparently there are many types of low pass filters, and each one might have a different transfer function.</p>
  </li>
  <li><p>This <a href="https://stackoverflow.com/questions/25191620/creating-lowpass-filter-in-scipy-understanding-methods-and-units">related question</a> talks about Nyquist frequencies used to calculate <code>Wn</code>. I know what the Nyquist sampling rate is, which is apparently different. The  Wikipedia article completely avoids talking about what nyquist frequency is conceptually.</p>
  </li>
  </ol>
  <p><strong>My Questions:</strong></p>
  <p>Obviously I know almost nothing about signal processing except what I'm learning on the fly. Explain like I'm 5, please:</p>
  <ol>
  <li>What are the first two arguments of <code>signal.butter()</code></li>
  <li>How does changing these arguments functionally alter the filter?</li>
  <li>How do I calculate them?</li>
  </ol>