diff --git a/content/zettels/digital_filters.md b/content/zettels/digital_filters.md index 8055f9e..a48242f 100644 --- a/content/zettels/digital_filters.md +++ b/content/zettels/digital_filters.md @@ -10,6 +10,80 @@ Tags A nice open access book on digital filter is accessible here: +## Analog to Digital Filter {#analog-to-digital-filter} + +In order to convert an analog filter (Laplace domain) to a digital filter (z-domain), the `c2d` command can be used ([doc](https://fr.mathworks.com/help/control/ref/lti.c2d.html)). + +
+ +Let's define a simple first order low pass filter in the Laplace domain: + +```matlab +s = tf('s'); +G = 1/(1 + s/(2*pi*10)); +``` + +To obtain the equivalent digital filter: + +```matlab +Ts = 1e-3; % Sampling Time [s] +Gz = c2d(G, Ts, 'tustin'); +``` + +
+ +There are several methods to go from the analog to the digital domain, `Tustin` is the one I use the most as it ensures the stability of the digital filter provided that the analog filter is stable. + + +## Bilinear transform {#bilinear-transform} + +The bilinear transform also known as the Tustin's method (see the [wikipedia page](https://en.wikipedia.org/wiki/Bilinear_transform)) is used to convert a continuous-time system representations to discrete-time. + +It uses the fact that \\(z = e^{sT} \approx \frac{1 + sT/2}{1-sT/2}\\). + +To go from the Laplace domain to the z-domain, we just have to use the following approximation: + +\begin{equation} +\boxed{s \approx \frac{2}{T\_s} \frac{z - 1} {z + 1} = \frac{2}{T\_s}\frac{1 - z^{-1}}{1 + z^{-1}}} +\end{equation} + + +## Standard Digital Filters {#standard-digital-filters} + + +### First order low pass filter {#first-order-low-pass-filter} + +\begin{equation} +G(s) = \frac{1}{1 + s/\omega\_0} +\end{equation} + +Using the bilinear transform, we obtain: + +\begin{equation} +G(z) = \frac{a(1 + z^{-1})}{1 + b z^{-1}} +\end{equation} + +with: + +\begin{align} +a &= \frac{2}{T\_s\omega\_0} + 1\\\\ +b &= \frac{2}{T\_s\omega\_0} - 1 +\end{align} + +If we want to compute how the filter output \\(y[n]\\) depends on previous output \\(y[n-1]\\), previous input \\(x[n-1]\\) and current input \\(x[n]\\) we can write: + +\begin{equation} +y[n] = G(z) x[n] +\end{equation} + +By developing the relation and using the fact that \\(z^{-1} x[n] = x[n-1]\\), we obtain: + +\begin{align} +y[n] &= a (x[n] + x[n-1]) + b y[n-1] \\\\ + &= \left( \frac{2}{T\_s \omega\_0} + 1 \right) (x[n] + x[n-1]) + \left(\frac{2}{T\_s\omega\_0} - 1\right) y[n-1] +\end{align} + + ## Bibliography {#bibliography}
diff --git a/content/zettels/tuned_mass_damper.md b/content/zettels/tuned_mass_damper.md index 46698de..f0058f6 100644 --- a/content/zettels/tuned_mass_damper.md +++ b/content/zettels/tuned_mass_damper.md @@ -117,6 +117,8 @@ This relation can help to determine the minimum mass of the TMD that will give a ## Manufacturers {#manufacturers} + + ## Ways to add damping {#ways-to-add-damping}