653 lines
24 KiB
HTML
653 lines
24 KiB
HTML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
|
<head>
|
|
<!-- 2020-10-26 lun. 14:03 -->
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
|
<title>List of filters - Matlab Implementation</title>
|
|
<meta name="generator" content="Org mode" />
|
|
<meta name="author" content="Dehaeze Thomas" />
|
|
<link rel="stylesheet" type="text/css" href="./css/htmlize.css"/>
|
|
<link rel="stylesheet" type="text/css" href="./css/readtheorg.css"/>
|
|
<link rel="stylesheet" type="text/css" href="./css/zenburn.css"/>
|
|
<script type="text/javascript" src="./js/jquery.min.js"></script>
|
|
<script type="text/javascript" src="./js/bootstrap.min.js"></script>
|
|
<script type="text/javascript" src="./js/jquery.stickytableheaders.min.js"></script>
|
|
<script type="text/javascript" src="./js/readtheorg.js"></script>
|
|
<script>MathJax = {
|
|
tex: {
|
|
tags: 'ams',
|
|
macros: {bm: ["\\boldsymbol{#1}",1],}
|
|
}
|
|
};
|
|
</script>
|
|
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="org-div-home-and-up">
|
|
<a accesskey="h" href="./index.html"> UP </a>
|
|
|
|
|
<a accesskey="H" href="./index.html"> HOME </a>
|
|
</div><div id="content">
|
|
<h1 class="title">List of filters - Matlab Implementation</h1>
|
|
<div id="table-of-contents">
|
|
<h2>Table of Contents</h2>
|
|
<div id="text-table-of-contents">
|
|
<ul>
|
|
<li><a href="#orgb83f79c">1. Low Pass</a>
|
|
<ul>
|
|
<li><a href="#orgd88840c">1.1. First Order Low Pass Filter</a></li>
|
|
<li><a href="#org0938139">1.2. Second Order</a></li>
|
|
<li><a href="#orge580369">1.3. Combine multiple first order filters</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org8c4f98e">2. High Pass</a>
|
|
<ul>
|
|
<li><a href="#org946fda0">2.1. First Order</a></li>
|
|
<li><a href="#orgdb3a46a">2.2. Second Order</a></li>
|
|
<li><a href="#org81b8ec1">2.3. Combine multiple filters</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org9a4d9f1">3. Band Pass</a>
|
|
<ul>
|
|
<li><a href="#orgb93eef3">3.1. Second Order</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org06d380e">4. Notch</a>
|
|
<ul>
|
|
<li><a href="#org064544f">4.1. Second Order</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org745749b">5. Chebyshev</a>
|
|
<ul>
|
|
<li><a href="#orgdb4d414">5.1. Chebyshev Type I</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org42f9bf3">6. Lead - Lag</a>
|
|
<ul>
|
|
<li><a href="#org0cb85e5">6.1. Lead</a></li>
|
|
<li><a href="#org19e9264">6.2. Lag</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org15058b6">7. Complementary</a></li>
|
|
<li><a href="#org2d03ba9">8. Performance Weight</a>
|
|
<ul>
|
|
<li><a href="#orge550845">8.1. Nice combination</a></li>
|
|
<li><a href="#org6202dd8">8.2. Alternative</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org5e21f67">9. Combine Filters</a>
|
|
<ul>
|
|
<li><a href="#orga943d8f">9.1. Additive</a></li>
|
|
<li><a href="#org6cc036a">9.2. Multiplicative</a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#org80b3ca3">10. Filters representing noise</a>
|
|
<ul>
|
|
<li><a href="#org579591f">10.1. First Order Low Pass Filter</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgb83f79c" class="outline-2">
|
|
<h2 id="orgb83f79c"><span class="section-number-2">1</span> Low Pass</h2>
|
|
<div class="outline-text-2" id="text-1">
|
|
</div>
|
|
<div id="outline-container-orgd88840c" class="outline-3">
|
|
<h3 id="orgd88840c"><span class="section-number-3">1.1</span> First Order Low Pass Filter</h3>
|
|
<div class="outline-text-3" id="text-1-1">
|
|
<p>
|
|
\[ H(s) = \frac{1}{1 + s/\omega_0} \]
|
|
</p>
|
|
|
|
<p>
|
|
Parameters:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>\(\omega_0\): cut-off frequency in [rad/s]</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Characteristics:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>Low frequency gain of \(1\)</li>
|
|
<li>Roll-off equals to -20 dB/dec</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Matlab code:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% Cut-off Frequency [rad/s]</span>
|
|
|
|
H = 1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>w0);
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<div id="org65bce28" class="figure">
|
|
<p><img src="figs/filter_low_pass_first_order.png" alt="filter_low_pass_first_order.png" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-org0938139" class="outline-3">
|
|
<h3 id="org0938139"><span class="section-number-3">1.2</span> Second Order</h3>
|
|
<div class="outline-text-3" id="text-1-2">
|
|
<p>
|
|
\[ H(s) = \frac{1}{1 + 2 \xi / \omega_0 s + s^2/\omega_0^2} \]
|
|
</p>
|
|
|
|
<p>
|
|
Parameters:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>\(\omega_0\):</li>
|
|
<li>\(\xi\): Damping ratio</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Characteristics:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>Low frequency gain: 1</li>
|
|
<li>High frequency roll off: - 40 dB/dec</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Matlab code:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% Cut-off frequency [rad/s]</span>
|
|
xi = 0.3; <span class="org-comment">% Damping Ratio</span>
|
|
|
|
H = 1<span class="org-type">/</span>(1 <span class="org-type">+</span> 2<span class="org-type">*</span>xi<span class="org-type">/</span>w0<span class="org-type">*</span>s <span class="org-type">+</span> s<span class="org-type">^</span>2<span class="org-type">/</span>w0<span class="org-type">^</span>2);
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<div id="org3d51d53" class="figure">
|
|
<p><img src="figs/filter_low_pass_second_order.png" alt="filter_low_pass_second_order.png" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orge580369" class="outline-3">
|
|
<h3 id="orge580369"><span class="section-number-3">1.3</span> Combine multiple first order filters</h3>
|
|
<div class="outline-text-3" id="text-1-3">
|
|
<p>
|
|
\[ H(s) = \left( \frac{1}{1 + s/\omega_0} \right)^n \]
|
|
</p>
|
|
|
|
<p>
|
|
Matlab code:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% Cut-off frequency [rad/s]</span>
|
|
n = 3; <span class="org-comment">% Filter order</span>
|
|
|
|
H = (1<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>w0))<span class="org-type">^</span>n;
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<div id="org03c708d" class="figure">
|
|
<p><img src="figs/filter_low_pass_first_order_add.png" alt="filter_low_pass_first_order_add.png" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org8c4f98e" class="outline-2">
|
|
<h2 id="org8c4f98e"><span class="section-number-2">2</span> High Pass</h2>
|
|
<div class="outline-text-2" id="text-2">
|
|
</div>
|
|
<div id="outline-container-org946fda0" class="outline-3">
|
|
<h3 id="org946fda0"><span class="section-number-3">2.1</span> First Order</h3>
|
|
<div class="outline-text-3" id="text-2-1">
|
|
<p>
|
|
\[ H(s) = \frac{s/\omega_0}{1 + s/\omega_0} \]
|
|
</p>
|
|
|
|
<p>
|
|
Parameters:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>\(\omega_0\): cut-off frequency in [rad/s]</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Characteristics:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>High frequency gain of \(1\)</li>
|
|
<li>Low frequency slow of +20 dB/dec</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Matlab code:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% Cut-off frequency [rad/s]</span>
|
|
|
|
H = (s<span class="org-type">/</span>w0)<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>w0);
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<div id="org5e8496d" class="figure">
|
|
<p><img src="figs/filter_high_pass_first_order.png" alt="filter_high_pass_first_order.png" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-orgdb3a46a" class="outline-3">
|
|
<h3 id="orgdb3a46a"><span class="section-number-3">2.2</span> Second Order</h3>
|
|
<div class="outline-text-3" id="text-2-2">
|
|
<p>
|
|
\[ H(s) = \frac{s^2/\omega_0^2}{1 + 2 \xi / \omega_0 s + s^2/\omega_0^2} \]
|
|
</p>
|
|
|
|
<p>
|
|
Parameters:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>\(\omega_0\):</li>
|
|
<li>\(\xi\): Damping ratio</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Matlab code:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% [rad/s]</span>
|
|
xi = 0.3;
|
|
|
|
H = (s<span class="org-type">^</span>2<span class="org-type">/</span>w0<span class="org-type">^</span>2)<span class="org-type">/</span>(1 <span class="org-type">+</span> 2<span class="org-type">*</span>xi<span class="org-type">/</span>w0<span class="org-type">*</span>s <span class="org-type">+</span> s<span class="org-type">^</span>2<span class="org-type">/</span>w0<span class="org-type">^</span>2);
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<div id="orga48ef87" class="figure">
|
|
<p><img src="figs/filter_high_pass_second_order.png" alt="filter_high_pass_second_order.png" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org81b8ec1" class="outline-3">
|
|
<h3 id="org81b8ec1"><span class="section-number-3">2.3</span> Combine multiple filters</h3>
|
|
<div class="outline-text-3" id="text-2-3">
|
|
<p>
|
|
\[ H(s) = \left( \frac{s/\omega_0}{1 + s/\omega_0} \right)^n \]
|
|
</p>
|
|
|
|
<p>
|
|
Matlab code:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% [rad/s]</span>
|
|
n = 3;
|
|
|
|
H = ((s<span class="org-type">/</span>w0)<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>w0))<span class="org-type">^</span>n;
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<div id="org99826f5" class="figure">
|
|
<p><img src="figs/filter_high_pass_first_order_add.png" alt="filter_high_pass_first_order_add.png" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org9a4d9f1" class="outline-2">
|
|
<h2 id="org9a4d9f1"><span class="section-number-2">3</span> Band Pass</h2>
|
|
<div class="outline-text-2" id="text-3">
|
|
</div>
|
|
<div id="outline-container-orgb93eef3" class="outline-3">
|
|
<h3 id="orgb93eef3"><span class="section-number-3">3.1</span> Second Order</h3>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org06d380e" class="outline-2">
|
|
<h2 id="org06d380e"><span class="section-number-2">4</span> Notch</h2>
|
|
<div class="outline-text-2" id="text-4">
|
|
</div>
|
|
<div id="outline-container-org064544f" class="outline-3">
|
|
<h3 id="org064544f"><span class="section-number-3">4.1</span> Second Order</h3>
|
|
<div class="outline-text-3" id="text-4-1">
|
|
\begin{equation}
|
|
\frac{s^2 + 2 g_c \xi \omega_n s + \omega_n^2}{s^2 + 2 \xi \omega_n s + \omega_n^2}
|
|
\end{equation}
|
|
|
|
<p>
|
|
Parameters:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>\(\omega_n\): frequency of the notch</li>
|
|
<li>\(g_c\): gain at the notch frequency</li>
|
|
<li>\(\xi\): damping ratio (notch width)</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Matlab code:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">gc = 0.02;
|
|
xi = 0.1;
|
|
wn = 2<span class="org-type">*</span><span class="org-constant">pi</span>;
|
|
|
|
H = (s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>gm<span class="org-type">*</span>xi<span class="org-type">*</span>wn<span class="org-type">*</span>s <span class="org-type">+</span> wn<span class="org-type">^</span>2)<span class="org-type">/</span>(s<span class="org-type">^</span>2 <span class="org-type">+</span> 2<span class="org-type">*</span>xi<span class="org-type">*</span>wn<span class="org-type">*</span>s <span class="org-type">+</span> wn<span class="org-type">^</span>2);
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<div id="orgba70cf5" class="figure">
|
|
<p><img src="figs/filter_notch_xi.png" alt="filter_notch_xi.png" />
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div id="orga3207e8" class="figure">
|
|
<p><img src="figs/filter_notch_gc.png" alt="filter_notch_gc.png" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org745749b" class="outline-2">
|
|
<h2 id="org745749b"><span class="section-number-2">5</span> Chebyshev</h2>
|
|
<div class="outline-text-2" id="text-5">
|
|
</div>
|
|
<div id="outline-container-orgdb4d414" class="outline-3">
|
|
<h3 id="orgdb4d414"><span class="section-number-3">5.1</span> Chebyshev Type I</h3>
|
|
<div class="outline-text-3" id="text-5-1">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">n = 4; <span class="org-comment">% Order of the filter</span>
|
|
Rp = 3; <span class="org-comment">% Maximum peak-to-peak ripple [dB]</span>
|
|
Wp = 2<span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% passband-edge frequency [rad/s]</span>
|
|
|
|
[A,B,C,D] = cheby1(n, Rp, Wp, <span class="org-string">'high'</span>, <span class="org-string">'s'</span>);
|
|
H = ss(A, B, C, D);
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org42f9bf3" class="outline-2">
|
|
<h2 id="org42f9bf3"><span class="section-number-2">6</span> Lead - Lag</h2>
|
|
<div class="outline-text-2" id="text-6">
|
|
</div>
|
|
<div id="outline-container-org0cb85e5" class="outline-3">
|
|
<h3 id="org0cb85e5"><span class="section-number-3">6.1</span> Lead</h3>
|
|
<div class="outline-text-3" id="text-6-1">
|
|
\begin{equation}
|
|
H(s) = \frac{1 + \frac{s}{w_c/\sqrt{a}}}{1 + \frac{s}{w_c \sqrt{a}}}, \quad a > 1
|
|
\end{equation}
|
|
|
|
<p>
|
|
Parameters:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>\(\omega_c\): frequency at which the phase lead is maximum</li>
|
|
<li>\(a\): parameter to adjust the phase lead, also impacts the high frequency gain</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Characteristics:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>the low frequency gain is \(1\)</li>
|
|
<li>the high frequency gain is \(a\)</li>
|
|
<li>the phase lead at \(\omega_c\) is equal to (Figure <a href="#org6e073c7">10</a>):
|
|
\[ \angle H(j\omega_c) = \tan^{-1}(\sqrt{a}) - \tan^{-1}(1/\sqrt{a}) \]</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Matlab code:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">a = 0.6; <span class="org-comment">% Amount of phase lead / width of the phase lead / high frequency gain</span>
|
|
wc = 2<span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% Frequency with the maximum phase lead [rad/s]</span>
|
|
|
|
H = (1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">/</span>sqrt(a)))<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>(wc<span class="org-type">*</span>sqrt(a)));
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<div id="orgf77036f" class="figure">
|
|
<p><img src="figs/filter_lead.png" alt="filter_lead.png" />
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div id="org6e073c7" class="figure">
|
|
<p><img src="figs/filter_lead_effect_a_phase.png" alt="filter_lead_effect_a_phase.png" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org19e9264" class="outline-3">
|
|
<h3 id="org19e9264"><span class="section-number-3">6.2</span> Lag</h3>
|
|
<div class="outline-text-3" id="text-6-2">
|
|
\begin{equation}
|
|
H(s) = \frac{w_c \sqrt{a} + s}{\frac{w_c}{\sqrt{a}} + s}, \quad a > 1
|
|
\end{equation}
|
|
|
|
<p>
|
|
Parameters:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>\(\omega_c\): frequency at which the phase lag is maximum</li>
|
|
<li>\(a\): parameter to adjust the phase lag, also impacts the low frequency gain</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Characteristics:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>the low frequency gain is increased by a factor \(a\)</li>
|
|
<li>the high frequency gain is \(1\) (unchanged)</li>
|
|
<li>the phase lag at \(\omega_c\) is equal to (Figure <a href="#orge3aeee4">12</a>):
|
|
\[ \angle H(j\omega_c) = \tan^{-1}(1/\sqrt{a}) - \tan^{-1}(\sqrt{a}) \]</li>
|
|
</ul>
|
|
|
|
<p>
|
|
Matlab code:
|
|
</p>
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">a = 0.6; <span class="org-comment">% Amount of phase lag / width of the phase lag / high frequency gain</span>
|
|
wc = 2<span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% Frequency with the maximum phase lag [rad/s]</span>
|
|
|
|
H = (wc<span class="org-type">*</span>sqrt(a) <span class="org-type">+</span> s)<span class="org-type">/</span>(wc<span class="org-type">/</span>sqrt(a) <span class="org-type">+</span> s);
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<div id="orgcb08a98" class="figure">
|
|
<p><img src="figs/filter_lag.png" alt="filter_lag.png" />
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div id="orge3aeee4" class="figure">
|
|
<p><img src="figs/filter_lag_effect_a_phase.png" alt="filter_lag_effect_a_phase.png" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org15058b6" class="outline-2">
|
|
<h2 id="org15058b6"><span class="section-number-2">7</span> Complementary</h2>
|
|
</div>
|
|
|
|
<div id="outline-container-org2d03ba9" class="outline-2">
|
|
<h2 id="org2d03ba9"><span class="section-number-2">8</span> Performance Weight</h2>
|
|
<div class="outline-text-2" id="text-8">
|
|
</div>
|
|
<div id="outline-container-orge550845" class="outline-3">
|
|
<h3 id="orge550845"><span class="section-number-3">8.1</span> Nice combination</h3>
|
|
<div class="outline-text-3" id="text-8-1">
|
|
\begin{equation}
|
|
W(s) = G_c * \left(\frac{\frac{1}{\omega_0}\sqrt{\frac{1 - \left(\frac{G_0}{G_c}\right)^{\frac{2}{n}}}{1 - \left(\frac{G_c}{G_\infty}\right)^{\frac{2}{n}}}} s + \left(\frac{G_0}{G_c}\right)^{\frac{1}{n}}}{\frac{1}{\omega_0} \sqrt{\frac{1 - \left(\frac{G_0}{G_c}\right)^{\frac{2}{n}}}{\left(\frac{G_\infty}{G_c}\right)^{\frac{2}{n}} - 1}} s + 1}\right)^n
|
|
\end{equation}
|
|
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">n = 2; w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>11; G0 = 1<span class="org-type">/</span>10; G1 = 1000; Gc = 1<span class="org-type">/</span>2;
|
|
wL = Gc<span class="org-type">*</span>(((G1<span class="org-type">/</span>Gc)<span class="org-type">^</span>(1<span class="org-type">/</span>n)<span class="org-type">/</span>w0<span class="org-type">*</span>sqrt((1<span class="org-type">-</span>(G0<span class="org-type">/</span>Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>n))<span class="org-type">/</span>((G1<span class="org-type">/</span>Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>n)<span class="org-type">-</span>1))<span class="org-type">*</span>s <span class="org-type">+</span> (G0<span class="org-type">/</span>Gc)<span class="org-type">^</span>(1<span class="org-type">/</span>n))<span class="org-type">/</span>(1<span class="org-type">/</span>w0<span class="org-type">*</span>sqrt((1<span class="org-type">-</span>(G0<span class="org-type">/</span>Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>n))<span class="org-type">/</span>((G1<span class="org-type">/</span>Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>n)<span class="org-type">-</span>1))<span class="org-type">*</span>s <span class="org-type">+</span> 1))<span class="org-type">^</span>n;
|
|
|
|
n = 3; w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>9; G0 = 10000; G1 = 0.1; Gc = 1<span class="org-type">/</span>2;
|
|
wH = Gc<span class="org-type">*</span>(((G1<span class="org-type">/</span>Gc)<span class="org-type">^</span>(1<span class="org-type">/</span>n)<span class="org-type">/</span>w0<span class="org-type">*</span>sqrt((1<span class="org-type">-</span>(G0<span class="org-type">/</span>Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>n))<span class="org-type">/</span>((G1<span class="org-type">/</span>Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>n)<span class="org-type">-</span>1))<span class="org-type">*</span>s <span class="org-type">+</span> (G0<span class="org-type">/</span>Gc)<span class="org-type">^</span>(1<span class="org-type">/</span>n))<span class="org-type">/</span>(1<span class="org-type">/</span>w0<span class="org-type">*</span>sqrt((1<span class="org-type">-</span>(G0<span class="org-type">/</span>Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>n))<span class="org-type">/</span>((G1<span class="org-type">/</span>Gc)<span class="org-type">^</span>(2<span class="org-type">/</span>n)<span class="org-type">-</span>1))<span class="org-type">*</span>s <span class="org-type">+</span> 1))<span class="org-type">^</span>n;
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="outline-container-org6202dd8" class="outline-3">
|
|
<h3 id="org6202dd8"><span class="section-number-3">8.2</span> Alternative</h3>
|
|
<div class="outline-text-3" id="text-8-2">
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">w0 = 2<span class="org-type">*</span><span class="org-constant">pi</span>; <span class="org-comment">% [rad/s]</span>
|
|
A = 1e<span class="org-type">-</span>2;
|
|
M = 5;
|
|
|
|
H = (s<span class="org-type">/</span>sqrt(M) <span class="org-type">+</span> w0)<span class="org-type">^</span>2<span class="org-type">/</span>(s <span class="org-type">+</span> w0<span class="org-type">*</span>sqrt(A))<span class="org-type">^</span>2;
|
|
</pre>
|
|
</div>
|
|
|
|
|
|
<div id="org503aff1" class="figure">
|
|
<p><img src="figs/weight_first_order.png" alt="weight_first_order.png" />
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org5e21f67" class="outline-2">
|
|
<h2 id="org5e21f67"><span class="section-number-2">9</span> Combine Filters</h2>
|
|
<div class="outline-text-2" id="text-9">
|
|
</div>
|
|
<div id="outline-container-orga943d8f" class="outline-3">
|
|
<h3 id="orga943d8f"><span class="section-number-3">9.1</span> Additive</h3>
|
|
<div class="outline-text-3" id="text-9-1">
|
|
<ul class="org-ul">
|
|
<li class="off"><code>[ ]</code> Explain how phase and magnitude combine</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="outline-container-org6cc036a" class="outline-3">
|
|
<h3 id="org6cc036a"><span class="section-number-3">9.2</span> Multiplicative</h3>
|
|
</div>
|
|
</div>
|
|
<div id="outline-container-org80b3ca3" class="outline-2">
|
|
<h2 id="org80b3ca3"><span class="section-number-2">10</span> Filters representing noise</h2>
|
|
<div class="outline-text-2" id="text-10">
|
|
<p>
|
|
Let’s consider a noise \(n\) that is shaped from a white-noise \(\tilde{n}\) with unitary PSD (\(\Phi_\tilde{n}(\omega) = 1\)) using a transfer function \(G(s)\).
|
|
The PSD of \(n\) is then:
|
|
\[ \Phi_n(\omega) = |G(j\omega)|^2 \Phi_{\tilde{n}}(\omega) = |G(j\omega)|^2 \]
|
|
</p>
|
|
|
|
<p>
|
|
The PSD \(\Phi_n(\omega)\) is expressed in \(\text{unit}^2/\text{Hz}\).
|
|
</p>
|
|
|
|
<p>
|
|
And the root mean square (RMS) of \(n(t)\) is:
|
|
\[ \sigma_n = \sqrt{\int_{0}^{\infty} \Phi_n(\omega) d\omega} \]
|
|
</p>
|
|
</div>
|
|
|
|
<div id="outline-container-org579591f" class="outline-3">
|
|
<h3 id="org579591f"><span class="section-number-3">10.1</span> First Order Low Pass Filter</h3>
|
|
<div class="outline-text-3" id="text-10-1">
|
|
<p>
|
|
\[ G(s) = \frac{g_0}{1 + \frac{s}{\omega_c}} \]
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">g0 = 1; <span class="org-comment">% Noise Density in unit/sqrt(Hz)</span>
|
|
wc = 1; <span class="org-comment">% Cut-Off frequency [rad/s]</span>
|
|
|
|
G = g0<span class="org-type">/</span>(1 <span class="org-type">+</span> s<span class="org-type">/</span>wc);
|
|
|
|
<span class="org-comment">% Frequency vector [Hz]</span>
|
|
freqs = logspace(<span class="org-type">-</span>3, 3, 1000);
|
|
|
|
<span class="org-comment">% </span><span class="org-comment"><span class="org-constant">PSD </span></span><span class="org-comment">of n in [unit^2/Hz]</span>
|
|
Phi_n = abs(squeeze(freqresp(G, freqs, <span class="org-string">'Hz'</span>)))<span class="org-type">.^</span>2;
|
|
|
|
<span class="org-comment">% </span><span class="org-comment"><span class="org-constant">RMS </span></span><span class="org-comment">value of n in [unit, rms]</span>
|
|
sigma_n = sqrt(trapz(freqs, Phi_n))
|
|
</pre>
|
|
</div>
|
|
|
|
<p>
|
|
\[ \sigma = \frac{1}{2} g_0 \sqrt{\omega_c} \]
|
|
with:
|
|
</p>
|
|
<ul class="org-ul">
|
|
<li>\(g_0\) the Noise Density of \(n\) in \(\text{unit}/\sqrt{Hz}\)</li>
|
|
<li>\(\omega_c\) the bandwidth over which the noise is located, in rad/s</li>
|
|
<li>\(\sigma\) the rms noise</li>
|
|
</ul>
|
|
|
|
<p>
|
|
If the cut-off frequency is to be expressed in Hz:
|
|
\[ \sigma = \frac{1}{2} g_0 \sqrt{2\pi f_c} = \sqrt{\frac{\pi}{2}} g_0 \sqrt{f_c} \]
|
|
</p>
|
|
|
|
|
|
<p>
|
|
Thus, if a sensor is said to have a RMS noise of \(\sigma = 10 nm\ rms\) over a bandwidth of \(\omega_c = 100 rad/s\), we can estimated the noise density of the sensor to be (supposing a first order low pass filter noise shape):
|
|
\[ g_0 = \frac{2 \sigma}{\sqrt{\omega_c}} \quad \left[ m/\sqrt{Hz} \right] \]
|
|
</p>
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">2<span class="org-type">*</span>10e<span class="org-type">-</span>9<span class="org-type">/</span>sqrt(100)
|
|
</pre>
|
|
</div>
|
|
|
|
<pre class="example">
|
|
2e-09
|
|
</pre>
|
|
|
|
|
|
<div class="org-src-container">
|
|
<pre class="src src-matlab">6<span class="org-type">*</span>0.5<span class="org-type">*</span>20e<span class="org-type">-</span>12<span class="org-type">*</span>sqrt(2<span class="org-type">*</span><span class="org-constant">pi</span><span class="org-type">*</span>100)
|
|
</pre>
|
|
</div>
|
|
|
|
<pre class="example">
|
|
1.504e-09
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="postamble" class="status">
|
|
<p class="author">Author: Dehaeze Thomas</p>
|
|
<p class="date">Created: 2020-10-26 lun. 14:03</p>
|
|
</div>
|
|
</body>
|
|
</html>
|