\section{Filters}

\subsection{Normalized Frequency}

For this section we will always use a normalized frequency \(\Omega = \omega/\omega_r\) for some reference frequency \(\omega_r\). For TP and HP filters \(\omega_r = \omega_D\) (cut-off frequency), whereas for BP and BS \(\omega_r = \omega_m\) (frequency in the middle of the band).

\begin{figure}[]
  \centering
  \begin{tikzpicture}[
      axis tick/.style = {
        inner sep = 1mm,
        outer sep = 1mm,
      },
      x axis tick/.style = {
        axis tick,
        path picture = {
          \draw[thick, -]
            ($(path picture bounding box) + (0,.1)$) --
            ($(path picture bounding box) - (0,.1)$);
        }
      },
      y axis tick/.style = {
        axis tick,
        path picture = {
          \draw[thick, -]
            ($(path picture bounding box) + (.1,0)$) --
            ($(path picture bounding box) - (.1,0)$);
        }
      }
    ]

    \pgfmathsetmacro\xlen{5}
    \pgfmathsetmacro\ylen{3}

    \coordinate (O) at (0,0);
    \draw[thick, ->] (O) to
      % node[pos = .5, x axis tick, label = -90:1] {}
      node[pos = .4, x axis tick, label = -90:\(\Omega_D\)] (OmegaD) {}
      node[pos = .65, x axis tick, label = -90:\(\Omega_S\)] (OmegaS) {}
      ++(\xlen,0) node[right] {\(\Omega\)};

    \draw[thick, ->] (O) to
      node[pos = .2, y axis tick, label = 180:\(A_\text{max}\)] (Amax) {}
      node[pos = .7, y axis tick, label = 180:\(A_\text{min}\)] (Amin) {}
      ++(0,\ylen) node[above] {\(A\)/dB};

    \draw[dashed, lightgray]
      (Amin) -- ++(\xlen,0)
      (Amax) -- ++(\xlen,0)
      (OmegaD) -- ++(0,\ylen)
      (OmegaS) -- ++(0,\ylen);

    \draw[very thick, red!80!black] (Amax) -| ($(OmegaD) +(0,3)$);
    \draw[very thick, red!80!black] (OmegaS) -- (Amin -| OmegaS) -- ++(1.5,0);

    \node[align = center] at (1,1.3) {Stamp \\ (passband)};
    \node[align = center] at (4.3,1.3) {Mold \\ (stopband)};

  \end{tikzpicture}
\end{figure}

\subsection{LPF Approximations}
The approximations of ideal low pass filters generally have (with some exceptions) the form
\[
  |H(j\Omega)|^2 = H(j\Omega)\cdot H^*(j\Omega)= \frac{1}{1 + K(\Omega^2)},
\]
where \(K\) is the so called \emph{charcteristic function}. For a nicer notation we will define the \emph{attenuation} function
\[
  A(\Omega) = 10 \log \left(|H(j\Omega)|^{-2}\right),
  \quad [A] = \text{dB}.
\]
With that, ideally wish to have an approximation that satisfies the following requirements:
\begin{itemize}
  \item \(A(\Omega = 0) = 1\) = 0\text{ dB}
  \item \(A(\Omega = 1) = 1/\sqrt{2} \approx -3\text{ dB}\)
  \item \(A(\Omega \to \infty) = 0\)
\end{itemize}

\paragraph{Critically damped filter}

\paragraph{Butterworth} Let \(K(\Omega^2) = \Omega^{2n}\), thus
\[
  A(\Omega) = 10 \log\left(1 + \Omega^{2n}\right).
\]
To find the order of the filter given two parameters the formula is
\[
  n = \left\lceil \frac{1}{2} \log\left(
        \frac{10^{A_\text{min}/10} -1}{10^{A_\text{max}/10} -1}
        - \frac{\Omega_S}{\Omega_D}
      \right) \right\rceil.
\]

\paragraph{Chebyshev I} Let \(K(\Omega^2) = e^2 C_n^2(\Omega)\), so
\[
  A(\Omega) = 10 \log\left(1 + e^2C_n^2(\Omega) \right),
\]
where \(C_n = \cos(n\arccos(\Omega))\) for \(|\Omega| \leq 1\) (in the passband), and when \(|\Omega| > 1\) (in the stopband) \(C_n = \cosh(n\arccosh(\Omega))\), is a so called Chebyshev polynomial of \(n\)-th order. The ripple factor \(e\) is a parameter, \emph{not the natural number (2.71\ldots)}. Chebyshev polynomials can be computed recursively with the formula
\[
  C_n = 2\Omega C_{n-1} - C_{n-2},
\]
and knowing that \(C_1 = \Omega\) and \(C_2 = 2\Omega^2 - 1\).

The idea is that in the passband the attenuation is periodic and stays more or less constant, and in the stopband the function is no longer periodic and damps the frequencies. To find the ripple factor \(e\) given an \(A_\text{max}\)
\[
  e = \sqrt{10^{A_\text{max}/10} - 1},
\]
and to find the order given two parameters
\[
  n = \left\lceil \frac{
    \arccosh\sqrt{
      \frac{10^{A_\text{min}/10} -1}{10^{A_\text{max}}-1}
    }
  }{
    \arccosh(\Omega_S/\Omega_D)
  } \right\rceil.
\]

\paragraph{Chebyshev II} Also known as \emph{inverse} Chebyshev because \(K(\Omega^2) = 1/e^2 C_n^2(1/\Omega)\).

\paragraph{Cauer}

% vim:ts=2 sw=2 et:
