MathGroup Archive 2009

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

Search the Archive

Re: Fourier[TriangleWave]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg95111] Re: Fourier[TriangleWave]
  • From: dh <dh at metrohm.com>
  • Date: Wed, 7 Jan 2009 04:05:18 -0500 (EST)
  • References: <gjjqm0$n89$1@smc.vnet.net>


Hello Sjoerd,

the problem you face is that you used rational numbers in your "Table". 

"TriangleWave" does not automatically return machine numbers if you feed 

it rationals. This happens only for spezial values like e.g. 

TriangleWave[1/4]. To force TriangleWave to return machine numbers, use 

e.g. N:

Table[TriangleWave[t] // N, {t, 0, 2 \[Pi], 2 \[Pi]/99}]

hope this helps, Daniel



Sjoerd C. de Vries wrote:

> TriangleWave and SquareWave are both functions introduced in M7, with

> similar usage. However, if you try to do a DFT of a list of

> TriangleWave values as in

> 

> Fourier[Table[TriangleWave[ t], {t, 0, 2 \[Pi], 2 \[Pi]/99}]]

> 

> you get an error message. The same problem exists for SawtoothWave.

> With SquareWave and Sin:

> 

> Fourier[Table[SquareWave[ t], {t, 0, 2 \[Pi], 2 \[Pi]/99}]]

> Fourier[Table[Sin[ t], {t, 0, 2 \[Pi], 2 \[Pi]/99}]]

> 

> it works as expected.

> 

> If you use //N everything is fine. Is there anything in the properties

> of these wave functions that should make these differences in handling

> by Fourier reasonable or expected?

> 

> 

> Cheers -- Sjoerd

> 




  • Prev by Date: Re: Combining Plots with Different Ordinate Axes in Mathematica
  • Next by Date: Manipulate, Export, .avi, forward run without the slider in the
  • Previous by thread: Re: Combining Plots with Different Ordinate Axes in Mathematica
  • Next by thread: Manipulate, Export, .avi, forward run without the slider in the