The [[Frequency Response Function]] of some [[Signal Filter]] is a [[Function]] [[Invariant]] of the [[Time Domain]] $H(\omega)$.
This function comes about from the process of assuming our input $x_{t}$ is of the form of $e^{i\omega t}$ and getting filter output $y_{t}=H(\omega)e^{i\omega t}$, where $H(\omega)\in \mathbb{C}$.
$\huge
\begin{align}
y_{t} &= H(\omega) e^{i\omega t} \\
H(\omega) &= r_{\omega}e^{i\theta_{\omega}} \\
\end{align} $
>[!note]
> This page uses the second example from [[Finite Impulse Response Filters]].
## Magnitude and Phase Response
The [[Frequency Response Function|magnitude response]] is defined as the [[Absolute Value]] of $H(\omega)$
$\huge \begin{align}
H(\omega) &= \underbrace{\left| H(\omega) \right|}_{\text{Magnitude Response}}e^{i \overbrace{\theta \omega}^{\text{Phase Response}}} \\
\end{align}
$
Where $\theta$ is the [[Phase]].
$H(\omega)$ is a function of a [[Real Numbers|Real Number]] *or* can be "embedded" into the [[Complex Plane]] on the [[Unit Circle]], ie with inputs $e^{i\omega}$ with $0\leq\omega\leq{2}\pi$.
>[!example] Simple Observations on the unit circle and [[Frequency Response Function|Magnitude Response]]
> $\huge \begin{align}
> y_{t} = x_{t}-a_{1}x_{t-1}, \, 0<a_{1}<1, a_{1} \approx 1
> \end{align} $
> $\huge \begin{align}
> \mathcal{H}(z) &= 1-a_{1} z^{-1} \\
> H(\omega) &= \frac{{e^{i \omega }-a_{1}}}{e^{i\omega}} \\
>
> \left| H(\omega) \right| &= \left| \frac{{e^{i \omega }-a_{1}}}{e^{i\omega}} \right| \\
> |e^{i\omega} | &= 1 \\
> |H(\omega)| &= \left| e^{i\omega} -a_{1} \right|
> \end{align} $
>
> Note that $t$ is in [[Sampling|samples]].
>
> $\huge \begin{align}
> \min|H(\omega)| &= 1-a_{1} \\
> \max|H(\omega)| &= 1+a_{1} \\
> \end{align}
> $
>
> Because higher $\omega$ are staying at one or decreasing and lower $\omega$ gets smaller, this is a [[High Pass Filter]].
>
> A similar [[Low Pass Filter]] can be obtained by letting $a_{1} <0$ ie. $a_{1}\in[-1,0]$ but closer to $-1$.
$\huge \begin{align}
y_{t} &= x_{t}-x_{t-1}+x_{t-2} \\
\mathcal{H}(z)&= 1-z^{-1}+z^{-2} \\
H(z) &=1-e^{-i\omega}+e^{-i 2\omega}
\end{align} $
This case is palindromic hence has a [[Linear Phase|linear phase function]].
$\huge \begin{align}
H(\omega) &= e^{-i \omega} \left( e^{i \omega}-1+e^{-i \omega} \right) \\
&=e^{-i \omega} \left( 2\cos \omega - 1\right) \\
\mathcal{H}(z) &= (1-z^{-1}+z^{-2}) \frac{z^{2}}{z^{2}} \\
&= \frac{z^{2}-z+1}{z^{2}} \\
H(\omega) &=\frac{e^{i {2} \omega } - e^{i \omega}+1}{e^{i 2 \omega}} \\
|H(\omega)| &= \left| e^{i 2 \omega} - e^{i \omega} + 1 \right| \\
\end{align} $
$\huge \begin{align}
\mathcal{H}(z) &= \left( z - \left( \frac{1}{2} + i \frac{\sqrt{ 3 }}{2} \right) \right)
\left( z - \left( \frac{1}{2} - i \frac{\sqrt{ 3 }}{2} \right) \right) \\
&=\left( z-e^{i \frac{\pi}{3}} \right)\left( z- e^{-i \frac{\pi}{3}} \right) \\
|H(\omega)| &= |e^{i\omega}-e^{i \frac{\pi}{3}}| \cdot|e^{i \omega}-e^{-i \frac{\pi}{3}}|
\end{align} $
This shows that this filter decreases the amplitudes of frequencies close to $\pm \frac{\pi}{3}$.
## Filters with Phasors
How we get $H(\omega)$![[Frequency Response .excalidraw.svg]] by inserting $e^{i\omega t}$ into the filter as $x_{t}$, and get $y_{t}$ as $H(\omega) e^{i\omega t}$.
ie.
$\huge \begin{align}
y_t &=e^{i\omega t}+e^{i \omega(t-1)} \\
&= e^{i \omega t} \underbrace{\left( 1+e^{-i\omega} \right)}_{H(\omega)}
\end{align}
$
So the frequency response of a [[Signal Filter|filter]] is the [[Complex Numbers|Complex Number]], algebraically dependent of $\omega$, which multiples $e^{i \omega t}$ when this [[Phasor]] is input into the [[Signal Filter|filter]].