[pstricks] si-function

Herbert Voss LaTeX at zedat.fu-berlin.de
Wed Dec 14 22:26:32 CET 2005


Christoph Bersch wrote:
> Karsten Schmeling schrieb:
> 
>>Now I'm writing my Bachelor-work in Latex and I need a si-function to 
>>discribe the Method of OFDM.
>>Can someone help me?
> 
> 
> Hi!
> 
> Use the SINC function included in the package pst-math
> <http://www.ctan.org/tex-archive/graphics/pstricks/contrib/pst-math/):

this is only sin(x)/x, but SI(x) is the integral

Herbert

\documentclass{article}
\usepackage{pst-plot}
\usepackage{pst-math,pst-func}
\makeatletter
\def\psSI{\pst at object{psSI}}
\def\psSI at i#1#2{%
   \begin at SpecialObj%
   \addto at pscode{
     /a #1  def
     /dx #2 #1 sub \psk at plotpoints\space div def
     /b a dx add def
     /scx { \pst at number\psxunit mul } def
     /scy { \pst at number\psyunit mul } def
     tx at FuncDict begin /SFunc { SINC } def end
     a scx 0 moveto
     \psk at plotpoints 1 sub {
       a b \psk at Simpson % a b M on Styack
       tx at FuncDict begin Simpson I end % y value on stack
       scy b scx exch lineto
       /b b dx add def
     } repeat
     stroke
   }%
   \end at SpecialObj%
}
\makeatother
\begin{document}

\psset{xunit=0.5cm,yunit=1cm}
\begin{pspicture}(-10,-0.3)(10,1.5)
    \psaxes{->}(0,0)(-10,-0.3)(10,1.5)
    \psplot[plotpoints=200]{-10}{10}{x SINC}
\end{pspicture}

\vspace{1cm}
\psset{yunit=1cm}
\begin{pspicture}(-10,-.5)(10,4)
    \psaxes[dx=1cm,Dx=2]{->}(0,0)(-10,0)(10,4)
    \psSI[plotpoints=200]{-10}{10}
\end{pspicture}

\end{document}




More information about the PSTricks mailing list