MathGroup Archive 2004

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

Search the Archive

Re: Problem with function

  • To: mathgroup at
  • Subject: [mg48388] Re: Problem with function
  • From: Bill Rowe <readnewsciv at>
  • Date: Wed, 26 May 2004 02:42:00 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

On 5/25/04 at 7:17 AM, paker_wawa at (DJkapi) wrote:

>>Use UnitStep to define g i.e.,

>>g = t(UnitStep[t] - UnitStep[t - 1]) + (1.5 - .5 t)(UnitStep[t -
>>1] - UnitStep[t - 3])

>>then you can do

>>Plot[g, {t,-1,4}, PlotRange->All];

>>to plot the function and

>>FourierTransform[g, t, w] to get the Fourier transform -- To reply
>>via email subtract one hundred and four

>Thanks for your answer. I have one more question. Is it possible to
>plot the result of FourierTransform? I have tried in the same way
>as you have done with the function but i got an error message.

It is possible to plot any function that outputs real values. Typically, a Fourier transform of a real valued function will be a complex valued function. It isn't possible to directly plot a complex valued function. You can plot either the magnitude of the complex values or the phase. That is if

f = FourierTransform[g, t, w];


Plot[Abs@f, {w, 0, 2 Pi}]

would plot the magnitude and

Plot[Arg@f, {w, 0, 2 Pi}]

would plot the phase

Alternatively, you could do 

Plot[Re@f, {w, 0, 2 Pi}] or
Plot[Im@f, {w, 0, 2 Pi}]

You also might want to look at the packages Graphics`ComplexMap` and Graphics`ArgColors`
To reply via email subtract one hundred and four

  • Prev by Date: RE: MultipleListPlot,Plot and combining legends
  • Next by Date: Re: Making new Contexts in Modules in a package
  • Previous by thread: Re: Problem with function
  • Next by thread: newbie problem in linux