1 parent
f38cc76be5
commit
de6d56181d
89 files changed
+173
-731
No files matched your search
@@ -44,20 +44,20 @@ The Matlab [Symbolic Toolbox](https://fr.mathworks.com/help/symbolic/) can be us
|
||||
Let's consider a notch filter:
|
||||
|
||||
\begin{equation}
|
||||
G(s) = \frac{s^2 + 2 g\_c \xi \omega\_n s + \omega\_n^2}{s^2 + 2 \xi \omega\_n s + \omega\_n^2}
|
||||
G(s) = \frac{s^2 + 2 g\_c \zeta \omega\_n s + \omega\_n^2}{s^2 + 2 \zeta \omega\_n s + \omega\_n^2}
|
||||
\end{equation}
|
||||
|
||||
with:
|
||||
|
||||
- \\(\omega\_n\\): frequency of the notch
|
||||
- \\(g\_c\\): gain at the notch frequency
|
||||
- \\(\xi\\): damping ratio (notch width)
|
||||
- \\(\zeta\\): damping ratio (notch width)
|
||||
|
||||
First the symbolic variables are declared (`Ts` is the sampling time, `s` the Laplace variable and `z` the "z-transform" variable).
|
||||
|
||||
```matlab
|
||||
%% Declaration of the symbolic variables
|
||||
syms gc wn xi Ts s z
|
||||
syms gc wn zeta Ts s z
|
||||
```
|
||||
|
||||
Then the bi-linear transformation is performed to go from continuous to discrete:
|
||||
@@ -71,7 +71,7 @@ The symbolic formula of the notch filter is defined:
|
||||
|
||||
```matlab
|
||||
%% Notch Filter - Symbolic representation
|
||||
Ga = (s^2 + 2*xi*gc*s*wn + wn^2)/(s^2 + 2*xi*s*wn + wn^2);
|
||||
Ga = (s^2 + 2*zeta*gc*s*wn + wn^2)/(s^2 + 2*zeta*s*wn + wn^2);
|
||||
```
|
||||
|
||||
Finally, the numerator and denominator coefficients can be extracted:
|
||||
@@ -90,7 +90,7 @@ org_babel_eoe
|
||||
```
|
||||
|
||||
```text
|
||||
den = (Ts^2*wn^2 - 4*Ts*wn*xi + 4) + (2*Ts^2*wn^2 - 8) * z + (Ts^2*wn^2 + 4*Ts*wn*xi + 4) * z^2
|
||||
den = (Ts^2*wn^2 - 4*Ts*wn*zeta + 4) + (2*Ts^2*wn^2 - 8) * z + (Ts^2*wn^2 + 4*Ts*wn*zeta + 4) * z^2
|
||||
```
|
||||
|
||||
|
||||
@@ -99,19 +99,19 @@ den = (Ts^2*wn^2 - 4*Ts*wn*xi + 4) + (2*Ts^2*wn^2 - 8) * z + (Ts^2*wn^2 + 4*Ts*w
|
||||
Let's consider a second order low pass filter:
|
||||
|
||||
\begin{equation}
|
||||
G(s) = \frac{1}{1 + 2 \xi \frac{s}{\omega\_n} + \frac{s^2}{\omega\_n^2}}
|
||||
G(s) = \frac{1}{1 + 2 \zeta \frac{s}{\omega\_n} + \frac{s^2}{\omega\_n^2}}
|
||||
\end{equation}
|
||||
|
||||
with:
|
||||
|
||||
- \\(\omega\_n\\): Cut off frequency
|
||||
- \\(\xi\\): damping ratio
|
||||
- \\(\zeta\\): damping ratio
|
||||
|
||||
First the symbolic variables are declared (`Ts` is the sampling time, `s` the Laplace variable and `z` the "z-transform" variable).
|
||||
|
||||
```matlab
|
||||
%% Declaration of the symbolic variables
|
||||
syms wn xi Ts s z
|
||||
syms wn zeta Ts s z
|
||||
```
|
||||
|
||||
Then the bi-linear transformation is performed to go from continuous to discrete:
|
||||
@@ -125,7 +125,7 @@ The symbolic formula of the notch filter is defined:
|
||||
|
||||
```matlab
|
||||
%% Second Order Low Pass Filter - Symbolic representation
|
||||
Ga = 1/(1 + 2*xi*s/wn + s^2/wn^2);
|
||||
Ga = 1/(1 + 2*zeta*s/wn + s^2/wn^2);
|
||||
```
|
||||
|
||||
Finally, the numerator and denominator coefficients can be extracted:
|
||||
@@ -140,7 +140,7 @@ den = coeffs(D, z);
|
||||
```
|
||||
|
||||
```text
|
||||
gain = 1/(Ts^2*wn^2 + 4*Ts*wn*xi + 4)
|
||||
gain = 1/(Ts^2*wn^2 + 4*Ts*wn*zeta + 4)
|
||||
```
|
||||
|
||||
```text
|
||||
@@ -148,7 +148,7 @@ num = (Ts^2*wn^2) + (2*Ts^2*wn^2) * z^-1 + (Ts^2*wn^2) * z^-2
|
||||
```
|
||||
|
||||
```text
|
||||
den = 1 + (2*Ts^2*wn^2 - 8) * z^-1 + (Ts^2*wn^2 - 4*Ts*wn*xi + 4) * z^-2
|
||||
den = 1 + (2*Ts^2*wn^2 - 8) * z^-1 + (Ts^2*wn^2 - 4*Ts*wn*zeta + 4) * z^-2
|
||||
```
|
||||
|
||||
And the transfer function is equal to `gain * num/den`.
|
||||
@@ -214,19 +214,19 @@ And the transfer function is equal to `gain * num/den`.
|
||||
Let's consider a second order low pass filter:
|
||||
|
||||
\begin{equation}
|
||||
G(s) = \frac{1}{1 + 2 \xi \frac{s}{\omega\_n} + \frac{s^2}{\omega\_n^2}}
|
||||
G(s) = \frac{1}{1 + 2 \zeta \frac{s}{\omega\_n} + \frac{s^2}{\omega\_n^2}}
|
||||
\end{equation}
|
||||
|
||||
with:
|
||||
|
||||
- \\(\omega\_n\\): Cut off frequency
|
||||
- \\(\xi\\): damping ratio
|
||||
- \\(\zeta\\): damping ratio
|
||||
|
||||
First the symbolic variables are declared (`Ts` is the sampling time, `s` the Laplace variable and `z` the "z-transform" variable).
|
||||
|
||||
```matlab
|
||||
%% Declaration of the symbolic variables
|
||||
syms wn xi Ts s z
|
||||
syms wn zeta Ts s z
|
||||
```
|
||||
|
||||
Then the bi-linear transformation is performed to go from continuous to discrete:
|
||||
@@ -240,7 +240,7 @@ The symbolic formula of the notch filter is defined:
|
||||
|
||||
```matlab
|
||||
%% Second Order Low Pass Filter - Symbolic representation
|
||||
Ga = (s^2/wn^2)/(1 + 2*xi*s/wn + s^2/wn^2);
|
||||
Ga = (s^2/wn^2)/(1 + 2*zeta*s/wn + s^2/wn^2);
|
||||
```
|
||||
|
||||
Finally, the numerator and denominator coefficients can be extracted:
|
||||
@@ -255,7 +255,7 @@ den = coeffs(D, z);
|
||||
```
|
||||
|
||||
```text
|
||||
gain = 1/(Ts^2*wn^2 + 4*Ts*wn*xi + 4)
|
||||
gain = 1/(Ts^2*wn^2 + 4*Ts*wn*zeta + 4)
|
||||
```
|
||||
|
||||
```text
|
||||
@@ -263,7 +263,7 @@ num = (4) + (-8) * z^-1 + (4) * z^-2
|
||||
```
|
||||
|
||||
```text
|
||||
den = 1 + (2*Ts^2*wn^2 - 8) * z^-1 + (Ts^2*wn^2 - 4*Ts*wn*xi + 4) * z^-2
|
||||
den = 1 + (2*Ts^2*wn^2 - 8) * z^-1 + (Ts^2*wn^2 - 4*Ts*wn*zeta + 4) * z^-2
|
||||
```
|
||||
|
||||
And the transfer function is equal to `gain * num/den`.
|
||||
@@ -309,9 +309,3 @@ The coefficients are simply computed with a Matlab function.
|
||||
|
||||
|
||||
### Moving Average {#moving-average}
|
||||
|
||||
|
||||
## Bibliography {#bibliography}
|
||||
|
||||
<style>.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}</style><div class="csl-bib-body">
|
||||
</div>
|
||||
Reference in new issue
Block a user