Re: Want a smooth function from Arg[ ]
- To: mathgroup@smc.vnet.net
- Subject: [mg12251] Re: [mg12213] Want a smooth function from Arg[ ]
- From: "Jrgen_Tischer" <jtischer@pitagoras.univalle.edu.co>
- Date: Tue, 5 May 1998 03:29:46 -0400
Hi Ryan,
try this:
data1 = Arg[data];
data2 = FoldList[Round[(#1-#2)/(2Pi)] 2Pi+
#2&,First[data1],Rest[data1]]; ListPlot[data2]
Jrgen
-----Original Message-----
From: Ryan Scott <scott@vader.engr.ucdavis.edu> To:
mathgroup@smc.vnet.net
Subject: [mg12251] [mg12213] Want a smooth function from Arg[ ]
>
>I need to be able to fit an nth degree polynomial to the phase function
>for a list of data. However, the Arg[x] function wraps the phase at
>+/- Pi creating discontinuities in what would be a smooth function.
>To clearify, let me give the following example:
>
>Create a list of data with a gaussian profile and quadratic phase:
>
>nn=128;
>a=0.005; b=0.003;
>data=Table[N[Exp[-a*(t-nn/2)^2+I*b*(t-nn/2)^2]], {t,nn}];
>
>Plot the magnitude and phase:
>
>ListPlot[Abs[data],PlotRange->{0,1},PlotJoined->True,
> PlotLabel->FontForm[
> "Absolute value of waveform",{"Helvetica-Bold",10}]]
>ListPlot[Arg[data], PlotJoined->True, PlotRange->All,
> PlotLabel->FontForm[ "Phase of time waveform",
>{"Helvetica-Bold",10}]]
>
>I would like to now fit a curve to this phase (which should be 0.003*x^2
>).
> However, the wrapping of the phase would seem to make this difficult to
>do directly. Any ideas on how to manipulate the results of Arg to
>give a continuous function of data?
>
>Thanks,
>
>Ryan
>
>--
>________________________________________________
>
> Ryan P. Scott
> Laser and Electro-Optics Research Group
> UC Davis - Department of Applied Science
> Tel: (530)754-4358 Fax: (530)752-1652
> Email: scott@leorg.ucdavis.edu
>________________________________________________
>
>