Start plotting
This commit is contained in:
parent
64e5d2d484
commit
d0924fd02c
3 changed files with 55 additions and 3 deletions
8
theorie-signal/exercices/plot_sx1.py
Executable file
8
theorie-signal/exercices/plot_sx1.py
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import math
|
||||
|
||||
for x in range(-8, 9):
|
||||
if x % 2 != 0:
|
||||
f = 4/((math.pi ** 2) * (x**2))
|
||||
print(f)
|
9
theorie-signal/exercices/plot_sx2.py
Executable file
9
theorie-signal/exercices/plot_sx2.py
Executable file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import math
|
||||
|
||||
for n in range(-8, 9):
|
||||
r = 1/2
|
||||
if n != 0:
|
||||
f = (math.fabs(math.sin(n*math.pi*r)/n*math.pi))**2
|
||||
print(f)
|
|
@ -107,9 +107,6 @@ Théorie du signal --- TP1
|
|||
&= r + \sum_{n=0}^{+\infty} \frac{2\sin(n\pi r)}{n\pi} \cos(n\omega_0 t)
|
||||
\end{align*}
|
||||
|
||||
\begin{tikzpicture}
|
||||
\end{tikzpicture}
|
||||
|
||||
\subsection{Densité Spectrale de Puissance}
|
||||
|
||||
\subsubsection{Pour $x_1$}
|
||||
|
@ -132,6 +129,22 @@ Théorie du signal --- TP1
|
|||
\right.
|
||||
\end{align*}
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
\draw[help lines, dashed] (-6,-1) grid (6,3);
|
||||
\draw[-latex] (-6,0) -- (6,0) node[below]{$f$};
|
||||
\draw[-latex] (0,-1) -- (0,3) node[left]{$S_x(f)$};
|
||||
% j'ajoute 2 pour la visibilité
|
||||
\draw[-latex,very thick, teal] (-5, 0) -- (-5, 2+0.016211389382774045);
|
||||
\draw[-latex,very thick, teal] (-3, 0) -- (-3, 2+0.04503163717437234);
|
||||
\draw[-latex,very thick, teal] (-1, 0) -- (-1, 2+0.4052847345693511);
|
||||
\draw[-latex,very thick, teal] (0, 0) -- (0, 2+0.5);
|
||||
\draw[-latex,very thick, teal] (1, 0) -- (1, 2+0.4052847345693511);
|
||||
\draw[-latex,very thick, teal] (3, 0) -- (3, 2+0.04503163717437234);
|
||||
\draw[-latex,very thick, teal] (5, 0) -- (5, 2+0.016211389382774045);
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
\subsubsection{Pour $x_2$}
|
||||
\begin{equation*}
|
||||
c_0 = a_0 = r
|
||||
|
@ -150,4 +163,26 @@ Théorie du signal --- TP1
|
|||
\text{pour } r=\frac{1}{4} &\implies
|
||||
\sum_{n=-\infty}^{+\infty} \left|\frac{\sin(\frac{n\pi}{4})}{n\pi}\right|^2 \\
|
||||
\end{align*}
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}
|
||||
\draw[help lines, dashed] (-6,-1) grid (6,3);
|
||||
\draw[-latex] (-6,0) -- (6,0) node[below]{$f$};
|
||||
\draw[-latex] (0,-1) -- (0,3) node[left]{$S_x(f)$};
|
||||
|
||||
\draw[-latex,very thick, teal] (-6, 0) -- (-6, 3.700508937884072e-32);
|
||||
\draw[-latex,very thick, teal] (-5, 0) -- (-5, 0.3947841760435743);
|
||||
\draw[-latex,very thick, teal] (-4, 0) -- (-4, 3.700508937884072e-32);
|
||||
\draw[-latex,very thick, teal] (-3, 0) -- (-3, 1.0966227112321507);
|
||||
\draw[-latex,very thick, teal] (-2, 0) -- (-2, 3.700508937884072e-32);
|
||||
\draw[-latex,very thick, teal] (-1, 0) -- (-1, 9.869604401089358);
|
||||
\draw[-latex,very thick, teal] (0, 0) -- (0, 0.5);
|
||||
\draw[-latex,very thick, teal] (1, 0) -- (1, 9.869604401089358);
|
||||
\draw[-latex,very thick, teal] (2, 0) -- (2, 3.700508937884072e-32);
|
||||
\draw[-latex,very thick, teal] (3, 0) -- (3, 1.0966227112321507);
|
||||
\draw[-latex,very thick, teal] (4, 0) -- (4, 3.700508937884072e-32);
|
||||
\draw[-latex,very thick, teal] (5, 0) -- (5, 0.3947841760435743);
|
||||
\draw[-latex,very thick, teal] (6, 0) -- (6, 3.700508937884072e-32);
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
\end{document}
|
||||
|
|
Loading…
Reference in a new issue