summaryrefslogtreecommitdiff
path: root/graphics/pstricks/contrib/pst-osci/oscilloscope.tex
blob: fc9f3719709b91123e84aa83448ea064a3536208 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
\documentclass [a4paper,12pt,dvips]{article}
\usepackage[latin1]{inputenc}%accepte les accents
\usepackage[francais]{babel}% règles de césure
\usepackage{pstricks}
\usepackage{pst-osci}
\usepackage{pst-char,pst-text}%,pst-plot}
%\usepackage[usenames] {pstcol}

\title {pst-osci \& AllColor}
\author {Raoul \textsc{Hatterer}}
\begin {document}
\maketitle
\section {Présentation}
J'ai trouvé ce package magnifique de puissance et de simplicité mais les couleurs employées ne passant pas à l'impression noir et blanc j'ai ajouté une option qui emploie des nuances de gris pour palier à ce problème.
\section {Utilisation}
\subsection {En préambule}
\verb+\usepackage{pst-osci}+

Remarque: \verb+\usepackage{pstcol}+ n'est pas utilisable.
\subsection {Commande}
\verb+\Oscillo[options éventuelles]+

\subsection{Compilation}
Sous MacOSX j'utilise \emph{altpdflatex} ce qui doit correspondre à \emph{latex+dvips+ps2pdf}.
\subsection {Nouvelle option}
\verb+AllColor+ qui par defaut est à \verb+true+ mais qui lorsqu'on la met à \verb+false+ permet d'obtenir des oscillogrammes qui passent mieux à l'impression.

\section {Exemples}
Je reprends les exemples du document \emph{pst-osci.pdf} de Manuel \textsc{Luque} et Christophe \textsc{Jorssen}\footnote{Les auteurs du package \emph{pst-osci}}  pour m'assurer qu'ils fonctionnent tels quels puis en rajoutant \verb+AllColor=false+. La taille est réduite à 50 \% grâce à \verb+\psscalebox {0.5}{ }+.

\subsection{Oscillo \& Oscillo[AllColor=false]}
\psscalebox{0.5}{\Oscillo \hspace{1cm}\Oscillo[AllColor=false]}

\subsection{Oscillo[offset2= 5] \& Oscillo[offset2= 5, AllColor=false]}
\psscalebox{0.5}{\Oscillo[offset2= 5] \hspace{1cm} \Oscillo[offset2= 5,AllColor=false]}

Remarque: À partir de là, je ne précise plus que la figure de droite a été obtenue en rajoutant l'option \verb+AllColor=false+.
% Extrema invisible
\subsection{ Extrema invisible: Oscillo[offset2=5, amplitude1=5]}
\psscalebox{0.5}{\Oscillo[offset2=5, amplitude1=5] \hspace{1cm}
\Oscillo[offset2=5, amplitude1=5,AllColor=false]}

% Good sensivity choice
\subsection{Good sensivity choice: Oscillo[offset2=5,amplitude1=5, sensivity1=2]}
\psscalebox{0.5}{\Oscillo[offset2=5,amplitude1=5, sensivity1=2]\hspace{1cm}
\Oscillo[offset2=5,amplitude1=5, sensivity1=2,AllColor=false]}

% Different amplitude
\subsection{Different amplitude: Oscillo[amplitude1=3, amplitude2=1.5]}
\psscalebox{0.5}{\Oscillo[amplitude1=3, amplitude2=1.5]\hspace{1cm}
\Oscillo[amplitude1=3, amplitude2=1.5,AllColor=false]}
% Different period
\subsubsection{Different period: Oscillo[amplitude1=3,amplitude2=1.5, period2=50]}
\psscalebox{0.5}{\Oscillo[amplitude1=3,amplitude2=1.5, period2=50]\hspace{1cm}
\Oscillo[amplitude1=3,amplitude2=1.5, period2=50,AllColor=false]}
% Different phase
\subsection {Different phase: Oscillo[amplitude1=3,amplitude2=1.5, phase1=60, phase2=-30]}
\psscalebox{0.5}{\Oscillo[amplitude1=3,amplitude2=1.5, phase1=60, phase2=-30]\hspace{1cm}
\Oscillo[amplitude1=3,amplitude2=1.5, phase1=60, phase2=-30,AllColor=false]}

\subsection{Damping and amplification: Oscillo[amplitude1=3,amplitude2=1.5,
damping2=0.005, damping1=-0.005]}
\psscalebox{0.5}{\Oscillo[amplitude1=3,amplitude2=1.5,
damping2=0.005, damping1=-0.005]\hspace{1cm}
\Oscillo[amplitude1=3,amplitude2=1.5,
damping2=0.005, damping1=-0.005,AllColor=false]}


\subsection {Changing the plot style}
\psscalebox{0.5}{\newpsstyle{BlueDots}{plotstyle=dots,
linecolor=blue,linewidth=0.02,plotpoints=50}
\Oscillo[amplitude1=3, plotstyle2=BlueDots,amplitude2=2]\hspace{1cm}
\newpsstyle{GreenDash}{linestyle=dashed,
linecolor=green,linewidth=0.035,plotpoints=50}
\Oscillo[amplitude1=2,phase1=90,amplitude2=3.8,period1=25,
period2=50,phase2=10, plotstyle1=GreenDash]}
\\

\psscalebox{0.5}{\newpsstyle{BlueDots}{plotstyle=dots,
linecolor=blue,linewidth=0.02,plotpoints=50}
\Oscillo[amplitude1=3, plotstyle2=BlueDots,amplitude2=2,AllColor=false]\hspace{1cm}
\newpsstyle{GreenDash}{linestyle=dashed,
linecolor=green,linewidth=0.035,plotpoints=50}
\Oscillo[amplitude1=2,phase1=90,amplitude2=3.8,period1=25,
period2=50,phase2=10, plotstyle1=GreenDash,AllColor=false]}


\begin{verbatim}
\newpsstyle{BlueDots}{plotstyle=dots,
linecolor=blue,linewidth=0.02,plotpoints=50}
\Oscillo[amplitude1=3, plotstyle2=BlueDots,amplitude2=2]\hspace{1cm}
\newpsstyle{GreenDash}{linestyle=dashed,
linecolor=green,linewidth=0.035,plotpoints=50}
\Oscillo[amplitude1=2,phase1=90,amplitude2=3.8,period1=25,
period2=50,phase2=10, plotstyle1=GreenDash]
\end{verbatim}

Remarque: Ce n'est plus possible si l'on met \verb+AllColor=false+. Mais rien ne vous empêche de faire des \verb+linecolor=black+ (cependant les \textsc{on} et \textsc{off} ne passeront pas mieux à l'impression qu'auparavant).

\subsection{Channel C: operations}
\psscalebox{0.5}{\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= add]
\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= add,offset1=2,offset2=2]
% SignalA and SignalB are invisible
\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= add,offset1=6,offset2=6]}
\\

\psscalebox{0.5}{\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= add,AllColor=false]
\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= add,offset1=2,offset2=2,AllColor=false]
% SignalA and SignalB are invisible
\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= add,offset1=6,offset2=6,AllColor=false]}

\begin{verbatim}
\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= add]
\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= add,offset1=2,offset2=2]
% SignalA and SignalB are invisible
\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= add,offset1=6,offset2=6]
\end{verbatim}

\subsection{Subtraction: Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true,operation= sub]}

\psscalebox{0.5}{\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true,
operation= sub]\hspace{1cm}
\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true,
operation= sub,AllColor=false]}

\subsection {Multiplications}
\psscalebox{0.5}{\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= mul]\hspace{1cm}
\Oscillo[amplitude1=1,amplitude2=2,
period2=50,period1=2, combine= true, operation= mul]}
\\

\psscalebox{0.5}{\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= mul,AllColor=false]\hspace{1cm}
\Oscillo[amplitude1=1,amplitude2=2,
period2=50,period1=2, combine= true, operation= mul,AllColor=false]}

\begin{verbatim}
\Oscillo[amplitude2=1.5,period2=50,period1=10,
combine= true, operation= mul]
\Oscillo[amplitude1=1,amplitude2=2,
period2=50,period1=2, combine= true, operation= mul]
\end{verbatim}

\subsection{Channel C: XY-mode}
\psscalebox{0.5}{\Oscillo[ Lissajous= true,amplitude2=2]
\Oscillo[Lissajous=true,amplitude2=3,phase2=45]
\Oscillo[Lissajous=true,amplitude2=2,phase2=90]}
\\

\psscalebox{0.5}{\Oscillo[ Lissajous=true,amplitude2=2,AllColor=false]
\Oscillo[Lissajous=true,amplitude2=3,phase2=45,AllColor=false]
\Oscillo[Lissajous=true,amplitude2=2,phase2=90,AllColor=false]}
\begin{verbatim}
\Oscillo[ Lissajous= true,amplitude2=2]
\Oscillo[Lissajous=true,amplitude2=3,phase2=45]
\Oscillo[Lissajous=true,amplitude2=2,phase2=90]
\end{verbatim}

\psscalebox{0.5}{\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,
period1=20,period2=10,phase2=0,Lissajous=true]
\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,
period1=25,period2=5,phase2=60,Lissajous=true]
\Oscillo[amplitude1=3.5,phase1=90,
amplitude2=3.5,period1=50,period2=50,
Lissajous=true,damping1=0.01,damping2=0.01]}
\\

\psscalebox{0.5}{\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,
period1=20,period2=10,phase2=0,Lissajous=true,AllColor=false]
\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,
period1=25,period2=5,phase2=60,Lissajous=true,AllColor=false]
\Oscillo[amplitude1=3.5,phase1=90,
amplitude2=3.5,period1=50,period2=50,
Lissajous=true,damping1=0.01,damping2=0.01,AllColor=false]}

\begin{verbatim}
\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,
period1=20,period2=10,phase2=0,Lissajous=true]
\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,
period1=25,period2=5,phase2=60,Lissajous=true]
\Oscillo[amplitude1=3.5,phase1=90,
amplitude2=3.5,period1=50,period2=50,
Lissajous=true,damping1=0.01,damping2=0.01]
\end{verbatim}

\subsection{Non sinusoidal signals}

%\subsubsection*{Exponential signals}
\psscalebox{0.5}{\Oscillo[amplitude1=3.5,phase1=90,
period1= 2E30,offset2=5,damping1=0.02]\hspace{1cm}
\Oscillo[amplitude1=3.5,phase1=90,
period1= 2E30,offset2=3,amplitude2=-3,damping1=0.02,
period2= 2E31,damping2=0.02,phase2=90]}

\psscalebox{0.5}{\Oscillo[amplitude1=3.5,phase1=90,
period1= 2E30,offset2=5,damping1=0.02,AllColor=false]\hspace{1cm}
\Oscillo[amplitude1=3.5,phase1=90,
period1= 2E30,offset2=3,amplitude2=-3,damping1=0.02,
period2= 2E31,damping2=0.02,phase2=90,AllColor=false]}

\begin{verbatim}
\Oscillo[amplitude1=3.5,phase1=90,
period1= 2E30,offset2=5,damping1=0.02]
\Oscillo[amplitude1=3.5,phase1=90,
period1= 2E30,offset2=3,amplitude2=-3,da
period2= 2E31,damping2=0.02,phase2=90]
\end{verbatim}

\psscalebox{0.5}{\Oscillo[ Wave1= \TriangleA,amplitude2=2,period2=20,period1=25]\hspace{1cm}
\Oscillo[ Wave1= \RectangleA,amplitude2=2,period2=20,period1=25]}
\\

\psscalebox{0.5}{\Oscillo[ Wave1= \TriangleA,amplitude2=2,period2=20,period1=25,AllColor=false]\hspace{1cm}
\Oscillo[ Wave1= \RectangleA,amplitude2=2,period2=20,period1=25,AllColor=false]}

\subsection{Combine examples}
\psscalebox{0.5}{\Oscillo[Wave2=\TriangleB,combine=true,operation=mul,amplitude2=2,period2=50,period1=2,amplitude1=1]
\Oscillo[combine=true,operation=add,amplitude2=1.5,Wave1=\RectangleA,amplitude1=1.5,period2=15]
\Oscillo[combine=true,operation=add,amplitude2=1.5,Wave1=\RectangleA,amplitude1=1.5,period2=15,Wave2=\TriangleB]}
\\

\psscalebox{0.5}{\Oscillo[Wave2=\TriangleB,combine=true,operation=mul,amplitude2=2,period2=50,period1=2,amplitude1=1,AllColor=false]
\Oscillo[combine=true,operation=add,amplitude2=1.5,Wave1=\RectangleA,amplitude1=1.5,period2=15,AllColor=false]
\Oscillo[combine=true,operation=add,amplitude2=1.5,Wave1=\RectangleA,amplitude1=1.5,period2=15,Wave2=\TriangleB,AllColor=false]
}
\begin{verbatim}
\Oscillo[Wave2=\TriangleB,combine=true,operation=mul,amplitude2=2,
period2=50,period1=2,amplitude1=1]
\Oscillo[combine=true,operation=add,amplitude2=1.5,
Wave1=\RectangleA,amplitude1=1.5,period2=15]
\Oscillo[combine=true,operation=add,amplitude2=1.5,
Wave1=\RectangleA,amplitude1=1.5,period2=15,Wave2=\TriangleB]
\end{verbatim}

\subsection{Dog's tooth signal}
\psscalebox{0.5}{\Oscillo[combine=true,operation=mul,amplitude2=1.5,
Wave1= \RDogToothA,amplitude1=1.5,period2=15]\hspace{1cm}
\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,
period1=25,period2=6.25,phase2=0,Lissajous=true,Wave2=\RDogToothB]}
\\

\psscalebox{0.5}{\Oscillo[combine=true,operation=mul,amplitude2=1.5,
Wave1= \RDogToothA,amplitude1=1.5,period2=15,AllColor=false]\hspace{1cm}
\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,
period1=25,period2=6.25,phase2=0,Lissajous=true,Wave2=\RDogToothB,AllColor=false]}

\begin{verbatim}
\Oscillo[combine=true,operation=mul,amplitude2=1.5,
Wave1= \RDogToothA,amplitude1=1.5,period2=15]
\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,
period1=25,period2=6.25,phase2=0,Lissajous=true,Wave2=\RDogToothB]
\end{verbatim}

\subsection{Frequency modulation examples}
\psscalebox{0.5}{\Oscillo[ periodmodulation1=200, freqmod1=5,period1=30,
timediv=50,plotpoints=1000,amplitude2=2,period2=200]
\Oscillo[amplitude1=1,amplitude2=1,
period2=25,period1=2,combine=true,operation=mul]
\Oscillo[amplitude1=1,amplitude2=1, CC2=2,
period2=25,period1=2,combine=true,operation=mul,offset1=5]}
\\

\psscalebox{0.5}{\Oscillo[ periodmodulation1=200, freqmod1=5,period1=30,
timediv=50,plotpoints=1000,amplitude2=2,period2=200,AllColor=false]
\Oscillo[amplitude1=1,amplitude2=1,
period2=25,period1=2,combine=true,operation=mul,AllColor=false]
\Oscillo[amplitude1=1,amplitude2=1, CC2=2,
period2=25,period1=2,combine=true,operation=mul,offset1=5,AllColor=false]}

\begin{verbatim}
\Oscillo[ periodmodulation1=200, freqmod1=5,period1=30,
timediv=50,plotpoints=1000,amplitude2=2,period2=200]
\Oscillo[amplitude1=1,amplitude2=1,
period2=25,period1=2,combine=true,operation=mul]
\Oscillo[amplitude1=1,amplitude2=1, CC2=2,
period2=25,period1=2,combine=true,operation=mul,offset1=5]
\end{verbatim}

\psscalebox{0.5}{\Oscillo[amplitude1=1,amplitude2=1,CC2=1.5,Wave2=\TriangleB,
period2=25,period1=2,combine=true,operation=mul,offset1=5]
\Oscillo[amplitude1=1,amplitude2=1,CC2=2,Wave2=\RDogToothB,
period2=25,period1=2,combine=true,operation=mul,offset1=5]
\Oscillo[amplitude1=1,amplitude2=1,CC2=-2,Wave2=\LDogToothB,
period2=20,period1=3,combine=true,operation=mul,offset1=5]}
\\

\psscalebox{0.5}{\Oscillo[amplitude1=1,amplitude2=1,CC2=1.5,Wave2=\TriangleB,
period2=25,period1=2,combine=true,operation=mul,offset1=5,AllColor=false]
\Oscillo[amplitude1=1,amplitude2=1,CC2=2,Wave2=\RDogToothB,
period2=25,period1=2,combine=true,operation=mul,offset1=5,AllColor=false]
\Oscillo[amplitude1=1,amplitude2=1,CC2=-2,Wave2=\LDogToothB,
period2=20,period1=3,combine=true,operation=mul,offset1=5,AllColor=false]}

\begin{verbatim}
\Oscillo[amplitude1=1,amplitude2=1,CC2=1.5,Wave2=\TriangleB,
period2=25,period1=2,combine=true,operation=mul,offset1=5]
\Oscillo[amplitude1=1,amplitude2=1,CC2=2,Wave2=\RDogToothB,
period2=25,period1=2,combine=true,operation=mul,offset1=5]
\Oscillo[amplitude1=1,amplitude2=1,CC2=-2,Wave2=\LDogToothB,
period2=20,period1=3,combine=true,operation=mul,offset1=5]
\end{verbatim}

\psscalebox{0.5}{\Oscillo[amplitude1=1,amplitude2=1,CC2=2,Wave2=\RDogToothB,
period2=25,period1=2,combine=true,operation=mul,
offset1=5,offset3=-1]\hspace{1cm}
\Oscillo[amplitude1=1,amplitude2=1,CC2=-2,Wave2=\LDogToothB,
period2=20,period1=3,combine=true,operation=mul,
offset1=5,offset3=1]}
\\

\psscalebox{0.5}{\Oscillo[amplitude1=1,amplitude2=1,CC2=2,Wave2=\RDogToothB,
period2=25,period1=2,combine=true,operation=mul,
offset1=5,offset3=-1,AllColor=false]\hspace{1cm}
\Oscillo[amplitude1=1,amplitude2=1,CC2=-2,Wave2=\LDogToothB,
period2=20,period1=3,combine=true,operation=mul,
offset1=5,offset3=1,AllColor=false]}

\begin{verbatim}
\Oscillo[amplitude1=1,amplitude2=1,CC2=2,Wave2=\RDogToothB,
period2=25,period1=2,combine=true,operation=mul,
offset1=5,offset3=-1]\hspace{1cm}
\Oscillo[amplitude1=1,amplitude2=1,CC2=-2,Wave2=\LDogToothB,
period2=20,period1=3,combine=true,operation=mul,
offset1=5,offset3=1]
\end{verbatim}

\subsection{More examples}
\psscalebox{0.5}{\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,period1=50,
period2=50,phase2=0,Lissajous=true,damping1=0.01,
Wave2=\RectangleB]
\Oscillo[amplitude1=2,amplitude2=1.8,Wave1=\RectangleA,
Fourier=500,period1=25,period2=12.5,combine=true,
operation=add,Wave2=\RectangleB]
\Oscillo[amplitude1=4,amplitude2=3,period1=50,
period2=5,Lissajous=true,Wave1=\RectangleA]}
\\

\psscalebox{0.5}{\Oscillo[amplitude1=3.5,phase1=90,amplitude2=3.5,period1=50,
period2=50,phase2=0,Lissajous=true,damping1=0.01,
Wave2=\RectangleB,AllColor=false]
\Oscillo[amplitude1=2,amplitude2=1.8,Wave1=\RectangleA,
Fourier=500,period1=25,period2=12.5,combine=true,
operation=add,Wave2=\RectangleB,AllColor=false]
\Oscillo[amplitude1=4,amplitude2=3,period1=50,
period2=5,Lissajous=true,Wave1=\RectangleA,AllColor=false]}


\end {document}