Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10190

Re: Fourier DFT scaling problem

From W Craig Carter <ccarter@mit.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Fourier DFT scaling problem
Date 2012-05-24 07:33 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jpko8h$elv$1@smc.vnet.net> (permalink)
References <jpflom$ktd$1@smc.vnet.net> <201205230730.DAA05002@smc.vnet.net>

Show all headers | View raw


Hello Kevin,
The snippet you provided was useful and timely for me.  Would you happen 
to have something similar for spectral derivatives using Fourier[], 
FourierDCT[], and FourierDST[]?
Thanks in any case,

Craig Carter




On May 23, 2012, at Wed, May 23, 12 ---3:30 AM, Kevin J. McCann wrote:

> Psi[x_] := \[Pi]^(-1/4) E^(-(x^2/2))
>
> \[ScriptCapitalN] = 2^8;
> L = 32.0;
> \[CapitalDelta]x = L/\[ScriptCapitalN];
> x = -16 + Table[i, {i, 0, \[ScriptCapitalN] - 1}]*\[CapitalDelta]x;
> \[CapitalDelta]k = 1/L;
>
> f = Psi[x];
> k = Table[n \[CapitalDelta]k, {n, 0, \[ScriptCapitalN] - 1}];
>
> F = \[CapitalDelta]x Fourier[f, FourierParameters -> {1, -1}];
> ListPlot[Transpose[{k, Abs[F]^2}], PlotRange -> All, Joined -> True]
> (* This part rotates the k-spectrum so it "looks right" *)
> krot = Table[
>    n \[CapitalDelta]k, {n, -(\[ScriptCapitalN]/2), \[ScriptCapitalN]/
>      2 - 1}];
> Frot = RotateRight[F, \[ScriptCapitalN]/2];
> ListPlot[Transpose[{krot, Abs[Frot]^2}], PlotRange -> All,
>  Joined -> True]
> (* Check that Parseval is right *)
> {Total[Abs[f]^2] \[CapitalDelta]x, Total[Abs[F]^2] \[CapitalDelta]k}

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Fourier DFT scaling problem Arthur <arth_e@ymail.com> - 2012-05-22 09:20 +0000
  Re: Fourier DFT scaling problem "Kevin J. McCann" <kjm@KevinMcCann.com> - 2012-05-23 07:31 +0000
  Re: Fourier DFT scaling problem W Craig Carter <ccarter@mit.edu> - 2012-05-24 07:33 +0000
  Re: Fourier DFT scaling problem Joseph Gwinn <joegwinn@comcast.net> - 2012-05-24 07:36 +0000

csiph-web