---
# System prepended metadata

title: Low-pass filter

---

Low-pass filter
===

$G(z) = \dfrac{Y(z)}{U(z)} = \dfrac{1}{1+\frac{1}{2}z^{-1}}$

$Y(z)(1+\frac{1}{2}z^{-1}) = U(z)$

$y_k + \frac{1}{2}y_{k-1} = u_k$

$y_k = -\frac{1}{2}y_{k-1} + u_k$

$k=0 \qquad y_0=0$
$k=1 \qquad y_1 = -\frac{1}{2}y_0 + u_1 = u_1$
$k=2 \qquad y_2 = -\frac{1}{2}y_1 + u_2 = -\frac{1}{2}u_1 + u_2$
$k=3 \qquad y_3 = -\frac{1}{2}y_2 + u_3 = -\frac{1}{2}(-\frac{1}{2}u_1 + u_2) + u_3 = \frac{1}{4}u_1  -\frac{1}{2}u_2 + u_3$

steady state: 
$u^s \text{given}, y^s=?$
$y^s=-\frac{1}{2}y^s + u^s$
$y^s=\frac{2}{3}u^s$

## FIR filter
$G(z) = \dfrac{Y(z)}{U(z)} = \frac{1}{2} + \frac{1}{2}z^{-1}$

$Y(z) = (\frac{1}{2} + \frac{1}{2}z^{-1})U(z)$

$y_k = \frac{1}{2}u_k + \frac{1}{2}u_{k-1}$

$k=1 \qquad y_1 = \frac{1}{2}u_1 + \frac{1}{2}u_0$

steady state:
$y_k = \frac{1}{2}u_k + \frac{1}{2}u_k = u_k$

FIR of high-order
$G(z) = \dfrac{Y(z)}{U(z)} = \frac{1}{3} + \frac{1}{3}z^{-1} + \frac{1}{3}z^{-2}$



$\dot y \approx\Delta y/\Delta t = \dfrac{y_k-y_{k-1}}{T_s}$


IIND = $\int_{t-5\text{min}}^t [\max(10,\text{IND}(t))-10]\text dt$

IIND = $\sum_{k-n}^k [\max(10, \text{IND}(k))-10]$

$u(k) = [\max(10, \text{IND}(k))-10]$ ->  10 je prahova hodnota
IIND = $\sum_{k-n}^k u(k)$

IIND = $u(k) + u(k-1) + u(k-2) + \cdots + u(k-n)$

IIND = $U(z) (1 + z^{-1} + z^{-2} + \cdots + z^{-n})$

$Y(z) = U(z) (1 + z^{-1} + z^{-2} + \cdots + z^{-n})$

$\dfrac{Y(z)}{U(z)} = (1 + z^{-1} + z^{-2} + \cdots + z^{-n})$

$\dfrac{Y(z)}{U(z)} = 1 + \dfrac{1}{z} + \dfrac{1}{z^{2}} + \cdots + \dfrac{1}{z^{n}}$

$\dfrac{Y(z)}{U(z)} = \dfrac{1}{1} + \dfrac{1}{z} + \dfrac{1}{z^{2}} + \cdots + \dfrac{1}{z^{n}}$

$\dfrac{Y(z)}{U(z)} = \dfrac{1 + z^{-1} + z^{-2} + \cdots + z^{-n}}{1}$

$\dfrac{Y(z)}{U(z)} = \dfrac{1 + z^{-1} + z^{-2} + \cdots + z^{-n}}{1} \dfrac{z^{n}}{z^{n}}$

$\dfrac{Y(z)}{U(z)} = \dfrac{z^n + z^{n-1} + z^{n-2} + \cdots + z^{n-n}}{z^n}$

$\dfrac{Y(z)}{U(z)} = \dfrac{z^n + z^{n-1} + z^{n-2} + \cdots + 1}{z^n}$

n = 2

$\dfrac{Y(z)}{U(z)} = \dfrac{z^2 + z^{1} + 1}{z^2}$











## Low-pass filter
$G(z) = \dfrac{Y(z)}{U(z)} = \dfrac{z-1}{z}$

$Y(z)z = U(z)(z-1)$

$y_{k+1} = u_{k+1} - u_{k}$

$\color{red}{y_{k+1}} = \color{red}{u_{k+1}} - \color{green}{u_{k}}$

$\color{green}{y_{k+1}} = \color{green}{u_{k+1}} - \color{blue}{u_{k}}$

$\color{green}{y_{k}} = \color{green}{u_{k}} - \color{blue}{u_{k-1}}$

$y_{k} = u_{k} - u_{k-1}$

$t = 0 \quad t = 1 \quad t = 2 \quad\dots\quad \color{blue}{t=(k-1)}\quad \color{green}{t= k} \quad \color{red}{t=(k+1)}$



$k=0 \qquad y_0=0$
$k=1 \qquad y_1 = -\frac{1}{2}y_0 + u_1 = u_1$
$k=2 \qquad y_2 = -\frac{1}{2}y_1 + u_2 = -\frac{1}{2}u_1 + u_2$
$k=3 \qquad y_3 = -\frac{1}{2}y_2 + u_3 = -\frac{1}{2}(-\frac{1}{2}u_1 + u_2) + u_3 = \frac{1}{4}u_1  -\frac{1}{2}u_2 + u_3$

steady state: 
$u^s \text{given}, y^s=?$
$y^s=-\frac{1}{2}y^s + u^s$
$y^s=\frac{2}{3}u^s$

$[a, b]$
