1
$\begingroup$

Is there any posibility to apply Parseval identity(energy in time domain is equal to freq. domain) on One/Single-side Fourier transform?

In other word for "standard" FT the test Mathematica can be

nn = 250; T = 20.;
t = Range[0, T, T/nn];
f = Exp[-(t - 5)^2]*Sin[t - 5];
ts = t[[2]] - t[[1]];
ws = 2 π/ts/(nn);
F = RotateLeft[Abs[Fourier[f]], Floor[Length[f]/2]];
w = ws*Range[-Floor[nn/2] - 1, Floor[nn/2]];
q1 = Total[(w[[2]] - w[[1]])*Abs[F]^2];
q2 = Total[ts*Abs[f]^2];
Fp = F*Sqrt[(q2/q1)];
aries = FourierTransform[
Exp[-(τ - 5)^2]*Sin[τ - 5], τ, ω];
ListLinePlot[Partition[Riffle[t, f], 2], PlotRange -> All]
Show[ListPlot[Partition[Riffle[w, Fp], 2]],
Plot[Abs[aries], {ω, -7, 7}, PlotStyle -> Red], 
PlotRange -> All]

One side FT is used for example damped oscilator where t=>0 where the solution can be Exp[-1 t]*Sin[2. t] . The script is

dt = 0.05;
t = Range[0, 10, dt];
fun = Exp[-1 t]*Sin[2. t];
vys = Assuming[ω > 0, 
Integrate[
Exp[-tt]*Sin[2 tt]*Exp[I ω tt], {tt, 0, ∞}]];
r = RotateLeft[Im[Fourier[fun]], Floor[Length[Im[Fourier[fun]]]/2]];
r1 = RotateLeft[Fourier[fun], Floor[Length[Im[Fourier[fun]]]/2]];
an = Table[{ω, Im[vys]}, {ω, 0, 10, 0.1}];
dw = 2 π/dt/Length[t];
w = dw*Range[-Floor[Length[t]/2]+1, Floor[Length[t]/2]];
a = Total[t*fun^2]
b = Chop[Total[dw*r1*Conjugate[r1]]];
Show[ListPlot[Partition[Riffle[w, r], 2], PlotRange -> All], 
ListLinePlot[Partition[Riffle[an[[All, 1]], an[[All, 2]]], 2], 
PlotRange -> All], PlotRange -> All]

I have numerical data(in this case generated with function fun = Exp[-1 t]*Sin[2. t];). I like to evaluate integral((Integrate[Exp[-tt]*Sin[2 tt]*Exp[I ω tt], {tt, 0, ∞}]])) on this data. I am wondering if is possible to use fft(Fourier command) to evaluate this integral with numerical data. Note, there is analytical and numerical solution for comparision(This is test a script, in the final, there will be only numerical data). The graph shows numerical and analytical solution, the position/freq match is OK, but the amplitude don’t fit.

Thank you for your help and suggestions(I'm new in FT, so all answers will be gladly appreciate) and sorry for bad english.

$\endgroup$
2
  • $\begingroup$ I am having a difficult time figuring out what is being done here. Does it help to use a "full" FT with a cut-off function? What I have in mind: vys2 = FourierTransform[Exp[-tt]*Sin[2 tt]*HeavisideTheta[tt], tt, \[Omega]]. $\endgroup$ Nov 11, 2015 at 19:24
  • $\begingroup$ Dear Mr. Lichtblau, thank you for your answer. The question was re-editet. Hope that it now much clearer. $\endgroup$
    – Eduard
    Nov 12, 2015 at 14:25

2 Answers 2

1
$\begingroup$

I think you want to pad to the left with zeros. The slight alterations below might put you closer to what you want.

dt = 0.05;
t1 = Range[0, 10, dt];
t = Join[Reverse[-Rest[t1]], t1];
fun1 = Exp[-1 t1]*Sin[2. t1]; (* Use the nonnegative values here *)
fun = PadLeft[fun1, 2*Length[fun1] - 1]; (* Now pad on the negative side with zeroes *)
(* The purpose here is to emulate the fact that for negative values your function under consideration should be zero *)

vys = Assuming[Element[\[Omega], Reals], 
   Integrate[
    HeavisideTheta[tt]*Exp[-tt]*Sin[2 tt]*
     Exp[I \[Omega] tt], {tt, -\[Infinity], \[Infinity]}]];
r = RotateLeft[Im[Fourier[fun]], Floor[Length[Im[Fourier[fun]]]/2]];
r1 = RotateLeft[Fourier[fun], Floor[Length[Im[Fourier[fun]]]/2]];

an = Table[{\[Omega], Im[vys]}, {\[Omega], 0, 10, 0.1}];
dw = 2 \[Pi]/dt/Length[t];
w = dw*Range[-Floor[Length[t]/2] + 1, Floor[Length[t]/2]];

a = Total[t*fun^2]
b = Chop[Total[dw*r1*Conjugate[r1]]];

(* Out[109]= 2.80000401905 *)

Show[ListPlot[Partition[Riffle[w, r], 2], PlotRange -> All], 
 ListLinePlot[Partition[Riffle[an[[All, 1]], an[[All, 2]]], 2], 
  PlotRange -> All], PlotRange -> All]

enter image description here

If this is way off then you really need to make more clear what it is you are trying to do.

$\endgroup$
1
$\begingroup$

I too am not clear what you want. I think you may need to use FourierParameters correctly. I will give you an illustration using your example.

nn = 250; T = 20.;
t = Range[0, T, T/nn];
f = Exp[-(t - 5)^2]*Sin[t - 5];

I will now work out the mean square value of the time values

f.f/Length[f]

(* 0.0122794 *)

Now we take the Fourier transform and use one example of FourierParameters

ft = Fourier[f, FourierParameters -> {-1, -1}];

The values are complex and we work out the sum of their modulus values squared.

ft.Conjugate[ft]

(* 0.0122794 + 0. I*)

This is the same value as above. If you wish to use half of the Fourier spectrum then you will be out by a factor of two. Thus

ft2 = ft[[1 ;; Round[Length[ft]/2]]];
ft2.Conjugate[ft2]
(*0.0061397 + 0. I *)

I have put some details on basics of Fourer here. You may choose alternative values for FourierParameters which may suit your needs better. As illustrated Fourier does obey Parsevals theorem.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.