MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

gaussian function?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg33303] gaussian function?
  • From: rishi.kulkarni at voxpath.com (rishi)
  • Date: Thu, 14 Mar 2002 02:22:07 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

I have a following code below:

makegaussianq[bt_,bitperiod_]:=
    (          
              kg=N[Sqrt[2/Log[2]] Pi];
              filterb=bt;
              width=-1 ( Ceiling[1/(2 bt)]);
              duration=(-2 width)+1;
            
        p[t_]:=( Erf[-1 kgfilterb (t-bitperiod/2)]+
                 Erf[kg filterb(t+bitperiod/2)])/(bitperiod \ 4);
             
        qfunc=Table[NIntegrate[p[t],{t,width,k}],{k,width,-1 width,.1}];
        gaussq=Interpolation[Table[{n/10,qfunc[[n+1]]},{n,0,Length[qfunc]-1}]];
               Clear[q];
               q[t_]:=0/;t<0;
               q[t_]:=gaussq[t]/;0<=t<=(-2 width);
               q[t_]:=.5/;t>(-2 width)
)

I have very newbie quesiton ....
how/when is the q[t_] called?
i mean, if i write stg like this 

  x = makegaussianq[0.38, 10]

what would this fuction return.
would it return q[t] to x ?

basically how do i read the above code?

my background is basically in C and C++ coding and i am finding it 
difficult to read the above code.


  • Prev by Date: Re: compiling
  • Next by Date: Re: symbolic solution (ArcTan)
  • Previous by thread: Re: Integrating using If[ ]
  • Next by thread: Use of Import inside of Module