diff --git a/theorie-signal/exercices/plot_sx1.py b/theorie-signal/exercices/plot_sx1.py new file mode 100755 index 0000000..503eca6 --- /dev/null +++ b/theorie-signal/exercices/plot_sx1.py @@ -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) diff --git a/theorie-signal/exercices/plot_sx2.py b/theorie-signal/exercices/plot_sx2.py new file mode 100755 index 0000000..9f9e5eb --- /dev/null +++ b/theorie-signal/exercices/plot_sx2.py @@ -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) diff --git a/theorie-signal/exercices/tp1.tex b/theorie-signal/exercices/tp1.tex index 9c49739..a584eba 100644 --- a/theorie-signal/exercices/tp1.tex +++ b/theorie-signal/exercices/tp1.tex @@ -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}