summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pst-am
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-12-12 01:04:00 +0000
committerKarl Berry <karl@freefriends.org>2009-12-12 01:04:00 +0000
commit765461ffc288b6d5d2b0c1d96c539a20b2cc93f2 (patch)
treed9c5efbe098c5e5ca68eab2479367d136ab9c186 /Master/texmf-dist/tex/latex/pst-am
parentd69c8e6f02c8ccddda5d0e298d8ef6dd9e3810c0 (diff)
new pstricks package pst-am (8dec09)
git-svn-id: svn://tug.org/texlive/trunk@16371 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pst-am')
-rw-r--r--Master/texmf-dist/tex/latex/pst-am/pst-am.sty260
1 files changed, 260 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/pst-am/pst-am.sty b/Master/texmf-dist/tex/latex/pst-am/pst-am.sty
new file mode 100644
index 00000000000..543aede6836
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/pst-am/pst-am.sty
@@ -0,0 +1,260 @@
+%% $Id: pst-am.sty 166 2009-12-08 14:48:53Z herbert $
+%%
+%% This is file `pst-am.sty',
+%%
+%% This program can be redistributed and/or modified under the terms
+%% of the LaTeX Project Public License Distributed from CTAN archives
+%% in directory macros/latex/base/lppl.txt.
+%%
+%% Manuel Luque <Mluque5130 _at_ aol.com> (France)
+%% Herbert Voss <hvoss _at_ tug.org (Germany)
+%%
+%% 2009/12/08
+%%
+%% DESCRIPTION:
+%% `pst-am' is a package intended for the representation
+%% of the amplitude modulation of the radio waves
+%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{pst-am}
+ [2009/12/00 v1.01 Modulation of radio waves (ml,hv)]
+\RequirePackage{pstricks}
+\RequirePackage{pst-plot}
+\RequirePackage{pst-node}
+\RequirePackage{pst-xkey}
+\RequirePackage{numprint}
+\RequirePackage{multido}
+
+\pst@addfams{pst-am}
+\SpecialCoor
+\definecolor{Bleu}{cmyk}{1,1,0,0.3}
+\newpsstyle{cadre}{framearc=0.05,linecolor=black}
+\newpsstyle{screen}{fillstyle=solid,fillcolor=yellow!70!white!30}
+\newpsstyle{signalModulant}{plotpoints=1000,linecolor=green,linewidth=2\pslinewidth}
+\newpsstyle{signalPorteuse}{plotpoints=2000,linecolor=blue}
+\newpsstyle{signalRedresse}{plotpoints=2000,linecolor=Bleu}
+\newpsstyle{signalDemodule}{plotpoints=4000,linecolor=red}
+\newpsstyle{signalModule}{plotpoints=4000,linecolor=blue}
+\newpsstyle{XY}{plotpoints=4000,linecolor=blue}
+%
+\define@key[psset]{pst-am}{title}{\def\psk@title{#1}}
+\define@key[psset]{pst-am}{frequencePorteuse}[2e4]{\def\psk@frequencePorteuse{#1}}
+\define@key[psset]{pst-am}{frequenceAudio}[1e3]{\def\psk@frequenceAudio{#1}}
+\psset[pst-am]{title={},%{Luc\'e Auguste Fresnel},
+ frequencePorteuse=2e4,frequenceAudio=1e3} % les fréquences
+%
+\define@key[psset]{pst-am}{R}[3300]{\def\psk@resistor{#1}}
+\define@key[psset]{pst-am}{C}[3.9e-8]{\def\psk@capacitor{#1}}
+\psset[pst-am]{R=3300,C=3.9e-8}
+%
+\define@key[psset]{pst-am}{U0}[2]{\def\psk@offset{#1}}
+\psset[pst-am]{U0=2}
+%
+\define@key[psset]{pst-am}{Up}[3.5]{\def\psk@Up{#1}}
+\define@key[psset]{pst-am}{Um}[1]{\def\psk@Um{#1}}
+\psset[pst-am]{Up=3.5,Um=1}
+%
+\define@key[psset]{pst-am}{k}[0.1]{\def\psk@k{#1}}
+\psset[pst-am]{k=0.1} % coefficient multiplicateur
+%
+\define@key[psset]{pst-am}{timeDiv}[2e-4]{\def\psk@timeDiv{#1}}
+\define@key[psset]{pst-am}{voltDivY1}[1]{\def\psk@voltDivA{#1}} % coeff d'amplitude vertical curve Y1
+\define@key[psset]{pst-am}{voltDivY2}[1]{\def\psk@voltDivB{#1}} % coeff d'amplitude vertical curve Y2
+\psset[pst-am]{timeDiv=2e-4,voltDivY1=1,voltDivY2=1}
+%
+\define@boolkey[psset]{pst-am}[Pst@]{Centering}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{SignalModule}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{SignalPorteuse}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{SignalRedresse}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{SignalDemodule}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{SignalModulant}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{SignalModule}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{SignalFinal}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{enveloppe}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{XY}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{traceU}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{UMandUm}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{values}[true]{}
+\define@boolkey[psset]{pst-am}[Pst@]{BW}[true]{}
+\psset[pst-am]{Centering=false}
+%
+\def\psAM{\pst@object{psAM}}
+\def\psAM@i{{%
+ \pst@killglue
+ \use@par
+ \pnode(!%
+ 1 setlinejoin
+ /PI 3.14159 def
+ /Tp {1 \psk@frequencePorteuse\space div} bind def % période du signal modulés
+ /Ap \psk@Up\space def % amplitude porteuse
+ /Fm \psk@frequenceAudio\space def % frequence signa modulant
+ /Tm {1 Fm div} bind def % periode du signal modulant
+ /Am \psk@Um\space def % amplitude signal modulant
+ /U0 \psk@offset\space def % decalage
+ /k \psk@k\space def
+ /R \psk@resistor\space def
+ /C \psk@capacitor\space def
+ /m {Am U0 div} bind def
+ /Umin {k Ap mul U0 mul 1 m sub mul} bind def
+ /Umax {k Ap mul U0 mul 1 m add mul} bind def
+ /composanteContinue {Umax Umin add 2 div} bind def
+ /Tau {R C mul} bind def
+ /TimeDiv \psk@timeDiv\space def % base de temps
+ /VoltDivY1 \psk@voltDivA\space def % amplitude verticale curve Y1
+ /VoltDivY2 \psk@voltDivB\space def % amplitude verticale curve Y2
+ /DecalageTemps 0 def
+ 0 0){MEM}%
+\ifPst@BW
+ \newpsstyle{signalModulant}{plotpoints=1000,linewidth=2\pslinewidth}
+ \newpsstyle{signalPorteuse}{plotpoints=2000}
+ \newpsstyle{signalRedresse}{plotpoints=2000}
+ \newpsstyle{signalDemodule}{plotpoints=4000}
+ \newpsstyle{signalModule}{plotpoints=4000}
+ \newpsstyle{XY}{plotpoints=4000}
+\fi
+\ifPst@Centering\centering\fi
+\pspicture(0,-5)(10,5)
+\psframe[style=cadre](-0.1,-4.5)(10.1,4.5)
+\psframe[style=screen](0,-4)(10,4)
+\rput(5,4.25){\textsf{\large Modulation-Demodulation}}
+\rput(5,-4.25){\psk@title}
+\rput*(2.5,-3.5){\textsf{\large timeDiv:\numprint{\psk@timeDiv} s/div}}
+\uput*[0](6,-3.7){\textsf{\large curve 2:\psk@voltDivB V/div}}
+\uput*[0](6,-3.3){\textsf{\large curve 1:\psk@voltDivA V/div}}
+\psclip{\psframe[linestyle=none](0,-4)(10,4)}
+\ifPst@XY
+\parametricplot[style=XY]{0}{10}{% duree
+ /temps t TimeDiv mul def % t est en s
+ /SignalModulant temps Fm mul 360 mul cos Am mul U0 add def
+ /FonctionPorteuse Ap 360 Tp div temps mul cos mul def
+ /SignalModule FonctionPorteuse SignalModulant mul k mul def
+ SignalModulant VoltDivY1 div 5 add SignalModule VoltDivY2 div}
+\else
+ \ifPst@SignalModule
+ \parametricplot[style=signalModule]{0}{10}{% duree
+ /temps t TimeDiv mul def % t est en s
+ /SignalModulant temps Fm mul 360 mul cos Am mul U0 add def
+ /FonctionPorteuse Ap 360 Tp div temps mul cos mul def
+ /SignalModule FonctionPorteuse SignalModulant mul k mul def
+ t SignalModule VoltDivY2 div }
+ \ifPst@enveloppe
+ \parametricplot[style=signalModulant]{0}{10}{%
+ /temps t TimeDiv mul def % t est en s
+ /SignalModulant temps Fm mul 360 mul cos Am mul U0 add def
+ /enveloppeSup Ap SignalModulant mul k mul def
+ t enveloppeSup VoltDivY2 div }
+ \parametricplot[style=signalModulant]{0}{10}{%
+ /temps t TimeDiv mul def % t est en s
+ /SignalModulant temps Fm mul 360 mul cos Am mul U0 add def
+ /enveloppeInf Ap SignalModulant mul k mul neg def
+ t enveloppeInf VoltDivY2 div }
+ \fi
+ \fi
+ \ifPst@SignalRedresse
+ \parametricplot[style=signalRedresse]{0}{10}{% duree
+ /temps t TimeDiv mul def % t est en s
+ /SignalModulant temps Fm mul 360 mul cos Am mul U0 add def
+ /FonctionPorteuse Ap 360 Tp div temps mul cos mul def
+ /SignalModule FonctionPorteuse SignalModulant mul k mul def
+ SignalModule 0 le {/SignalRedresse 0 def} {/SignalRedresse SignalModule def} ifelse
+ t SignalRedresse VoltDivY2 div }
+ \fi
+ \ifPst@SignalDemodule
+ \parametricplot[style=signalDemodule]{0}{10}{%
+ /temps t TimeDiv mul def % t est en s
+ /SignalModulant temps Fm mul 360 mul cos Am mul U0 add def
+ /FonctionPorteuse Ap 360 Tp div temps mul cos mul def
+ /SignalModule FonctionPorteuse SignalModulant mul k mul def
+ SignalModule 0 le {/SignalRedresse 0 def} {/SignalRedresse SignalModule def} ifelse
+ /Uc U0 Ap mul
+ 1
+ m DecalageTemps 360 mul Tm div cos mul
+ add
+ mul 2.718 temps DecalageTemps sub Tau div neg exp mul k mul def
+ Uc SignalRedresse ge {/SignalDemodule Uc def} % si condition realisee
+ {/SignalDemodule SignalRedresse def
+ /DecalageTemps temps Tp div floor Tp mul def}
+ ifelse
+ t SignalDemodule VoltDivY2 div }
+ \fi
+ \ifPst@SignalModulant%
+ \parametricplot[style=signalModulant]{0}{10}{%
+ % 1 div=0.2 ms
+ /temps t TimeDiv mul def % t est en s
+ /SignalModulant temps Fm mul 360 mul cos Am mul U0 add def
+ t SignalModulant VoltDivY1 div }
+ \fi
+ \ifPst@SignalPorteuse
+ \parametricplot[style=signalPorteuse]{0}{10}{% durée
+ /temps t TimeDiv mul def % t est en s
+ /SignalModulant temps Fm mul 360 mul cos Am mul U0 add def
+ /FonctionPorteuse Ap 360 Tp div temps mul cos mul def
+ t FonctionPorteuse VoltDivY1 div }
+ \fi
+\fi
+\ifPst@SignalFinal
+ \parametricplot[style=signalDemodule]{0}{10}{%
+ /temps t TimeDiv mul def % t est en s
+ /SignalModulant temps Fm mul 360 mul cos Am mul U0 add def
+ /FonctionPorteuse Ap 360 Tp div temps mul cos mul def
+ /SignalModule FonctionPorteuse SignalModulant mul k mul def
+ SignalModule 0 le {/SignalRedresse 0 def} {/SignalRedresse SignalModule def} ifelse
+ /Uc U0 Ap mul
+ 1
+ m DecalageTemps 360 mul Tm div cos mul
+ add
+ mul 2.718 temps DecalageTemps sub Tau div neg exp mul k mul def
+ Uc SignalRedresse ge {/SignalDemodule Uc def} % si condition réalisée
+ {/SignalDemodule SignalRedresse def
+ /DecalageTemps temps Tp div floor Tp mul def}
+ ifelse
+ t SignalDemodule composanteContinue sub VoltDivY2 div }
+\fi
+
+\pnode(! 0 Umax VoltDivY2 div){UM1}
+\pnode(! 10 Umax VoltDivY2 div){UM2}
+\pnode(! 0 Umin VoltDivY2 div){Um1}
+\pnode(! 10 Umin VoltDivY2 div){Um2}
+\pnode(! 0 U0 VoltDivY1 div){U01}
+\pnode(! 10 U0 VoltDivY1 div){U02}
+\endpsclip
+\psgrid[gridlabels=0,subgriddiv=0,gridwidth=0.5\pslinewidth,subgridwidth=0.2\pslinewidth,gridcolor=black,subgridcolor=black](0,-4)(10,4)
+\psline[linestyle=dotted,linecolor=black](0,2.5)(10,2.5)
+\psline[linestyle=dotted,linecolor=black](0,-2.5)(10,-2.5)
+\multido{\nxDiv=0.0+0.2}{50}{%
+\psline[linecolor=black,linewidth=0.5\pslinewidth](\nxDiv,-.1)(\nxDiv,0.1)}
+% ajout 29 janvier 2003
+\multido{\nxDiv=0.0+0.2}{50}{%
+\psline[linecolor=black,linewidth=0.5\pslinewidth](\nxDiv,-2.05)(\nxDiv,-1.95)}
+\multido{\nxDiv=0.0+0.2}{50}{%
+\psline[linecolor=black,linewidth=0.5\pslinewidth](\nxDiv,2.05)(\nxDiv,1.95)}
+%
+\multido{\nyDiv=-4.0+0.2}{40}{%
+\psline[linecolor=black,linewidth=0.5\pslinewidth](4.9,\nyDiv)(5.1,\nyDiv)}
+\ifPst@traceU0
+ \psline[linecolor=green,linestyle=dashed](U01)(U02)
+ \uput[l](U01){$U_0$}
+\fi
+\ifPst@UMandUm%
+\psline[linecolor=blue,linestyle=dashed](UM1)(UM2)
+\psline[linecolor=blue,linestyle=dashed](Um1)(Um2)
+ \uput[l](Um1){$U_m$}
+ \uput[l](UM1){$U_M$}
+\fi
+\endpspicture%
+
+\ifPst@values
+\tabular{@{} r l @{}}\hline
+ Amplitude porteuse & \numprint{\psk@Up}\ V \\
+ Amplitude audio & \numprint{\psk@Um}\ V \\
+ Frequence porteuse & \numprint{\psk@frequencePorteuse}\ Hz \\
+ Frequence audio & \numprint{\psk@frequenceAudio}\ Hz\\
+ Decalage($U_0$) & \numprint{\psk@offset}\ V\\ \hline
+ R & \numprint{\psk@resistor}\ $\Omega$ \\
+ C & \numprint{\psk@capacitor}\ F \\ \hline
+\endtabular
+\fi
+\ifPst@Centering\par\fi
+}}
+%
+\endinput