I have an experimental data, which is basically a time-domain triangle function.
Part I: In theory
The time-domain figure is shown in Fig. 1(a), and the corresponding frequency-domain figure is shown in Fig. 1(b).
The codes are shown below
f1[x_] := Piecewise[{{1*Abs[x], Abs[x] < 2.5}, {1*Abs[2.5], Abs[x] >= 2.5}}];
Plot[f1[x], {x, -10, 10}, Axes -> False, Frame -> True, PlotRange -> All, AspectRatio -> .67, LabelStyle -> Directive[Black, FontSize -> 18], FrameLabel -> {{"Intensity", None}, {"Time (s)", None}}, ImageSize -> {300, 200}]
Chop@FourierTransform[f1[x], x, \[Omega]];
Plot[-(0.7978/\[Omega]^2) + (0.7978 Cos[2.5 \[Omega]])/\[Omega]^2 + 6.266 DiracDelta[\[Omega]], {\[Omega], -10, 10}, Frame -> True, Axes -> False, PlotRange -> All, AspectRatio -> .67, Axes -> False, LabelStyle -> Directive[Black, FontSize -> 18], FrameLabel -> {{"Intensity", None}, {"Frequency (Hz)", None}}, ImageSize -> {300, 200}]
Part II: In experiment
Then, I consider the case in experiment, using the data sampled from the same function. The time-domain figure is shown in Fig. 2(a), and the frequency-domain figure is shown in Fig. 2(b).
The corresponding codes are shown below
data = Table[{x, f1[x]}, {x, -10, 10, 0.1}];
ListLinePlot[data, PlotRange -> All, PlotStyle -> {Red}, Joined -> False, Frame -> True, AspectRatio -> .67, Axes -> False, LabelStyle -> Directive[Black, FontSize -> 18], FrameLabel -> {{"Intensity", None}, {"Time (s)", None}}, ImageSize -> {300, 200}]
{times, vals} = Transpose[data];
IFT[(w_)?NumberQ, vals_, times_] := Total[vals*Exp[(-I)*2 \[Pi]*w*times]]/Length[times];
Plot[Abs[IFT[w, vals, times]], {w, -0.5, 0.5}, PlotRange -> All, Frame -> True, Axes -> False, LabelStyle -> Directive[Black, FontSize -> 18], PlotStyle -> {Red}, AspectRatio -> .67, ImageSize -> {300, 200}, FrameLabel -> {{"Amplitude", None}, {"Frequency (Hz)", None}}]
Now, Let us compare Fig.1(b) and Fig.2(b). They are different!! I hope Fig. 1(b) should be the same as Fig. 2(b), especially, (1) remove the side lobes in Fig 2 (b); (2) the width of Fig 2 (b) should be the same as Fig 1 (b). How can I do this? Any help or suggestion is highly appreciated.
2 Pi
in your calculus ofIFT[...]=...
2) substract 2.5 to your data, such that your data are considered to be 0 outside the time interval [-10,10] (otherwise the integrationTotal[ ...times]]
should extend time from -Infinity to +Infinity, which is impraticable) $\endgroup$ – andre314 Apr 3 '16 at 19:22HeavisideLambda
distribution (= the triangle distribution), equal to the convolution of two identicalHeavisidePi
distributions (= the box distribution). The Fourier transform is therefore exactly a squared sinus cardinal (Sinc[]^2
) $\endgroup$ – andre314 Apr 3 '16 at 19:53