Resources: page=680

Ideal filters are non-causal and infinite lasting. Example with an ideal low pass filter:

\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[
ymax = 0.3,
clip = false,
ycomb,
axis lines = middle,
xlabel = $n$,
ylabel = {h[n]},
title = {Ideal discrete low pass filter}
]
\addplot
[ 
 color = red,
 samples=50, 
 domain=-20:20,
 mark=o,
 ]{pi/4/pi*(sin(deg(pi/4*x)))/(pi/4*x)} 
 node[right, pos=1]{$f(x)=pi/4/pi*(sin(deg(pi/4*x)))/(pi/4*x)$};
\end{axis}
\end{tikzpicture}
\end{document}

We want causal linear-phase filters which needs approximations. The filter must not “spill” into the next frequency band.

FIR vs IIR

FIR:

  • Always stable
  • Can achieve exactly Linear Phase
  • Easily designed with linear methods
  • Easy to implement

IIR:

  • Fewer parameters (low filter order)
  • Less memory
  • Low delay
  • Lower computational complexity
  • Typically designed by transforming an analog filter design

FIR

Goal - Find :

Design Using Windows

Using this method, we begin with the desired frequency response specification, , and then determine the corresponding unit sample response .

We are looking at Finite Impulse Response, therefore we look at . This can we done with a window function like this

And looking at the Fourier transform gives us

We also have tons of other window functions

IIR

Goal - Find and :

\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[
clip = false,
axis lines = middle,
xlabel = $x$,
ylabel = $y$,
title = {edvard er homo}
]
\addplot
[ 
 color = blue,
 samples=50, 
 domain=-2:2,
 ]{x²} 
 node[right, pos=1]{$f(x)=x²$};
\end{axis}
\end{tikzpicture}
\end{document}