Beispiele zu Fourier-Reihen

Initialisierung von allgemeinen Funktionen

<< Graphics`Animation`

B[f_, n_, x_]:= (2 / Pi) Integrate[f[x] Sin[n x], {x, 0, Pi}]

sinApprox[f_, n_, x_] := Sum[B[f, k, x] Sin[k x], {k, 1, n}]

Stufenfunktion

step[x_] := If[x > 0, 1, -1]

sinApprox[1&, 5, x]

(4 Sin[x])/π + (4 Sin[3 x])/(3 π) + (4 Sin[5 x])/(5 π)

steptable = Table[ Plot[Evaluate[{step[x], sinApprox[1&, i, x]}],
       {x, -Pi, Pi},
       DisplayFunction -> Identity,
       PlotStyle -> {Hue[1], Hue[0.7]},
       Axes -> False,
       PlotLabel -> ToString[i]<>". Partialsumme"],
   {i, 1, 100, 5}];
  

ShowAnimation[steptable, DisplayFunction -> $DisplayFunction]

[Graphics:HTMLFiles/fourier_22.gif]

Saegezahn

saege[x_] := x

sinApprox[x&, 5, x]

2 Sin[x] - Sin[2 x] + 2/3 Sin[3 x] - 1/2 Sin[4 x] + 2/5 Sin[5 x]

saegetable = Table[ Plot[Evaluate[{saege[x], sinApprox[x&, i, x]}],
       {x, -Pi, Pi},
       DisplayFunction -> Identity,
       PlotStyle -> {Hue[1], Hue[0.7]},
       Axes -> False,
       PlotLabel -> ToString[i]<>". Partialsumme"],
   {i, 1, 100, 5}];
  

ShowAnimation[saegetable, DisplayFunction -> $DisplayFunction]

[Graphics:HTMLFiles/fourier_44.gif]

Fast Fourier Transformation

Daten = Table[N[Sin[n Pi/64] - 0.5 Cos[0.5 + n Pi/16] + (Random[Real, {-0.5, 0.5}] - 0.5)], {n, 1, 128}] ;

Daten1 = Table[N[Sin[n Pi/64] - 0.5 Cos[0.5 + n Pi/16] + (-0.5)], {n, 1, 128}] ;

orig = ListPlot[Daten, PlotJoined→True, PlotStyle→ {Hue[1.]}, DisplayFunction→Identity] ;

glatt = ListPlot[Daten1, PlotJoined→True, PlotStyle→ {Hue[0.4]}, DisplayFunction→Identity] ;

Show[orig, glatt, DisplayFunction→$DisplayFunction]

[Graphics:HTMLFiles/fourier_50.gif]

-Graphics -

FTDaten = Fourier[Daten];
ListPlot[Abs[FTDaten],
         PlotRange->All, Prolog->AbsolutePointSize[3]]

[Graphics:HTMLFiles/fourier_52.gif]

-Graphics -

TrunkFTDaten = Chop[FTDaten, 1.0];
Ergebnis     = InverseFourier[TrunkFTDaten];
invfour = ListPlot[Ergebnis, PlotJoined->True, PlotStyle -> {Hue[0.7]},
                             DisplayFunction->Identity];
Show[orig,invfour,glatt,DisplayFunction-> $DisplayFunction]

[Graphics:HTMLFiles/fourier_54.gif]

-Graphics -


Created by Mathematica  (November 13, 2007) Valid XHTML 1.1!