Lösungen

1

Remove["Global`*"]

f[t_]:=t^2-t /;(-Pi/2 ≤  t && t ≤ Pi/2);
f[t_]:=f[Pi/2] /;(Pi/2 <  t && t ≤ 3 Pi/2);
f[t_]:=f[t+2Pi] /;(-5Pi/2 ≤  t && t < -Pi/2);
f[t_]:=f[t-2Pi] /;(3Pi/2 <  t && t ≤ 7Pi/2);
f1[t_]:=t^2-t;
f2[t_]:=f1[Pi/2];

a Skizze

Plot[f[t],{t,-Pi/2,3Pi/2},PlotRange->{-0.5,4.5}]

Plot[f[t],{t,-5Pi/2,7Pi/2},PlotRange->{-0.5,4.5}]

b Koeffizienten

T=2 Pi;
cc =-Pi/2;
ω = 2 Pi/T;
a[0]:=2/T NIntegrate[f[t],{t,cc,cc+T}];
a[k_]:=2/T NIntegrate[f[t] Cos[k ω t],{t,cc,cc+T}];
b[k_]:=2/T NIntegrate[f[t] Sin[k ω t],{t,cc,cc+T}];
(* c[k_]:=1/T Integrate[f[t] E^(-I k ω t),{t,cc,cc+T}]; *)
ff[t_]:=a[0]/2+Sum[a[n] Cos[n ω t]+b[n] Sin[n ω t],{n,1,Infinity}];
ff[t_,h_]:=a[0]/2+Sum[a[n] Cos[n ω t]+b[n] Sin[n ω t],{n,1,h}] //Chop;
(* ffk[t_]:=Sum[c[n] E^(I n ω t),{n,-Infinity,Infinity}]; *)
(* ffk[t_,h_]:=Sum[c[n] E^(I n ω t),{n,-h,h}]; *)
g[t_]:=(ff[u,4]/.u->t)//Simplify; g[t]

Infinity ist hier doch zu weit.

a1[0]:=2/T (Integrate[f1[t],{t,cc,cc+T/2}]+Integrate[f2[t],{t,cc+T/2,cc+T}]);
a1[k_]:=2/T (Integrate[f1[t] Cos[k ω t],{t,cc,cc+T/2}]+Integrate[f2[t] Cos[k ω t],{t,cc+T/2,cc+T}]);
b1[k_]:=2/T( Integrate[f1[t] Sin[k ω t],{t,cc,cc+T/2}]+Integrate[f2[t] Sin[k ω t],{t,cc+T/2,cc+T}]);

ff1[u_,h_]:=a1[0]/2+Sum[a1[n] Cos[n ω  u]+b1[n] Sin[n ω  u],{n,1,h}] //Chop;
g1[t_]:=(ff1[u,4]/.u->t);
g1[t]//Expand

g1N[t_]:=(ff1[u,4]/.u->t)//N;
g1N[t]

g1N[t]//Expand

a1[0]

(* a0/2, a0 *)    {0.859535903450778`, 2 0.859535903450778`}

(* ak *) {-0.27323954473516276`,-0.5` ,-0.286176313157957` ,+0.125` }

(* bk *) {0.6366197723675814`,-0.5` ,+0.07073553026306459` ,+0.25` }

c: Gute Näherung schon mit wenigen Koeffizienten

g1[Pi/2]

f[Pi/2]

%//N

f[3 Pi/2]

%//N

Abs[g1[Pi/2]-f[Pi/2]]

Abs[g1N[Pi/2]-f[Pi/2]]

Abs[g1[3 Pi/2]-f[Pi/2]]

Abs[g1N[3Pi/2]-f[3Pi/2]]

Abs[g1[3Pi/2]-f[3Pi/2]]

d:

Plot[Evaluate[{f[t],g[t]}],{t,-Pi/2,3Pi/2},PlotPoints->60]

Plot[Evaluate[{f[t],g1[t]}],{t,-Pi/2,3Pi/2}]

e

{f[Pi/2],g1[Pi/2]}

N[%]

In  (π/2)+((π^2)/4) = f[Pi/2]=g1[Pi/2]
lässt sich π auf eine Seite der Gleichung bringen und so isolieren, also berechnen.

2

a

Remove["Global`*"];

T=Pi;
cc =-Pi/2;
f[t_]:=Abs[t]+t;
ω = 2 Pi/T;
a[0]:=2/T Integrate[f[t],{t,cc,cc+T}];
a[k_]:=2/T Integrate[f[t] Cos[k ω t],{t,cc,cc+T}];
b[k_]:=2/T Integrate[f[t] Sin[k ω t],{t,cc,cc+T}];
ff[s_,h_]:=a[0]/2+Sum[a[n] Cos[n ω s]+b[n] Sin[n ω s],{n,1,h}];
ff[s,10]

N[%]

ff[4,10]

ff[s,10]/.s->t

Plot[Evaluate[{f[s],ff[s,10]}],{s,-Pi/2,Pi/2}]

b

Remove["Global`*"];

Ersetze t durch - t und Abs[t]+t durch -(Abs[-t]-t). Schiebe dann die Funktion um 3.

f[t_]:=Abs[t]+t;

f1[t_]:=3-f[-t]; f1[t]

T=Pi;
cc =-Pi/2;
ω = 2 Pi/T;
a[0]:=2/T Integrate[f1[t],{t,cc,cc+T}];
a[k_]:=2/T Integrate[f1[t] Cos[k ω t],{t,cc,cc+T}];
b[k_]:=2/T Integrate[f1[t] Sin[k ω t],{t,cc,cc+T}];
ff1[s_,h_]:=a[0]/2+Sum[a[n] Cos[n ω s]+b[n] Sin[n ω s],{n,1,h}];
ff1[s,10]//Simplify

N[%]

Plot[Evaluate[{f1[s],ff1[s,10]}],{s,-Pi/2,Pi/2}]

3  “Beidseitig”

Remove["Global`*"];

a

Wir verwenden zuerst die Skalierung nach der Periode 2 Pi. Das vereinfacht die Rechung etwas.

n=4; w = 2 Pi/n;
{x[0],y[0]}={0 w,2};
{x[1],y[1]}={1 w,2};
{x[2],y[2]}={2 w,3};
{x[3],y[3]}={3 w,3};
{x[-1],y[-1]}={-1 w,3};
{x[-2],y[-2]}={-2 w,3};
{x[-3],y[-3]}={-3 w,2};
{x[-4],y[-4]}={-4 w,2};

p[k_]:= {x[k],y[k]};
Table[p[k],{k,-(n-1),(n-1)}]

epi=Prepend[Map[Point,Table[p[k],{k,-n,n-1}]],PointSize[0.03]]

epi1=Prepend[Map[Point,Table[{k,y[k]},{k,0,n-1}]],PointSize[0.03]]

r = E^(-I 2 Pi/n);
c[s_]:= 1/n Sum[y[k] r^(s k),{k,-Floor[(n-1)/2],n-1-Floor[(n-1)/2]}];
Table[c[s],{s,0,10}]//N

fS[t_]:=Sum[c[k] E^(I k t),{k,-Floor[(n-1)/2],n-1-Floor[(n-1)/2]}];
fS[t]

%//ExpandAll

fS1[s_]:=fS[s 2Pi/n];
fS1[s]

%//ExpandAll

%//N//Simplify

fS[t]//ExpToTrig

%//ExpandAll

%//N

fS1[s]//ExpToTrig

%//ExpandAll

%//N

Plot[Re[fS[t]],{t,0,2Pi}]

Plot[Im[fS[t]],{t,0,2Pi}]

Man beachte im letzten Plot die Grösse der Amplitude.

Plot[{Re[fS[t]]},{t,-2Pi,2Pi},Epilog->epi]

Plot[{Re[fS1[s]]},{s,0,4},Epilog->epi1]

b

Um eine FFT machen zu können, braucht man eine 2-er Potenz als Anzahl der Intervalle.

c

Man muss z.B. 4 Messungen in einer Periode haben..

4

Remove["Global`*"];

a

f1[t_]:=UnitStep[x+3]-UnitStep[x-3];
Plot[f1[x],{x,-4,4}]

b

f2[t_]:=(9-x^2)(UnitStep[x+3]-UnitStep[x-3]);
Plot[f2[x],{x,-4,4}]

c  (Achtung Faktor (1/(Sqrt[π])) bei anderer Definition der Fouriertransformation!!!)

FourierTransform[f1[x],x,ω]

d  (Achtung Faktor (1/(Sqrt[π])) bei anderer Definition der Fouriertransformation!!!)

FourierTransform[f2[x],x,ω]

FourierTransform[f2[x],x,ω]//Simplify

%//ExpToTrig//Simplify

e

InverseFourierTransform[(Cos[Ω]-Sin[Ω])/Ω,Ω,x]

InverseFourierTransform[(Cos[Ω]-Sin[Ω])/Ω,Ω,x]//Simplify

5

a

Remove["Global`*"];

f[x_]:=Cos[4x]+I  Sin[4x]

FourierTransform[f[x],x,ω]//Simplify

1/ (Sqrt[2 π]) FourierTransform[f[x],x,ω]//Simplify

(Sqrt[2 π]) FourierTransform[f[x],x,ω]//Simplify

b

Remove["Global`*"];

f[x_]:=Sin[4x]+I Cos[4x]

FourierTransform[f[x],x,ω]//Simplify

1/ (Sqrt[2 π]) FourierTransform[f[x],x,ω]//Simplify

(Sqrt[2 π]) FourierTransform[f[x],x,ω]//Simplify

c

Remove["Global`*"];

fHat[x_]:=Cos[4ω]+I Sin[4ω]

InverseFourierTransform[fHat[x],ω,x]//Simplify

(Sqrt[2 π]) InverseFourierTransform[fHat[x],ω,x]//Simplify

1/(Sqrt[2 π]) InverseFourierTransform[fHat[x],ω,x]//Simplify

1/ (Sqrt[2 π]) FourierTransform[(Sqrt[2 π]) InverseFourierTransform[fHat[x],ω,x],x,ω]//Simplify

(E^(2 I ω)) // ExpToTrig

6

Modul (in Zusatzfenster betreiben!)

Remove["Global`*"];

four[fkt_,var_,perT_,start0Int_,n_,druck_]:=Module[{fktInt,tInt,nInt,znInt}, Print[" "]; Print["Output:"]; Print[" "];
Print["Ausgabe:  ω, fktInt[var], a[0], a[k], b[k], c[k], Fourierreihen ff[var,n], ff[var], ffExp[var], ffKomplexTrig[var,n], ffKomplexExp[var,n], ffKomplex[var], Plot: z.B. Plot[Evaluate[ff[t,n]],{t,perT,perT+start0Int},PlotPoints->50]"];
ω = 2 Pi/perT;    If[druck==1,  Print["ω = ",ω]," "];
fktInt[tInt_]:=Function[fkt[#]][tInt];   If[druck==1, Print["Funktion[",var,"]  = ",fktInt[var]]," "];
a[0]=2/T Integrate[fktInt[var],{var,start0Int,start0Int+perT}];     If[druck==1, Print["a[0] = ",a[0]]," "];
a[k_]:=2/T Integrate[Cos[k ω var]  fktInt[var],{var,start0Int,start0Int+perT}];     If[druck==1, Print["a[k] = ",a[k]]," "];
b[k_]:=2/T Integrate[Sin[k ω var]  fktInt[var],{var,start0Int,start0Int+perT}];     If[druck==1, Print["b[k] = ",b[k]]," "];
c[k_]:=1/T Integrate[fktInt[var]  E^(-I k ω var),{var,start0Int,start0Int+perT}];  If[druck==1, Print["c[k] = ",c[k]]," "];
ff[tInt_,znInt_]:=a[0]/2+Sum[a[nInt] Cos[nInt ω tInt]+b[nInt] Sin[nInt ω tInt],{nInt,1,znInt}];
 If[druck==1, Print["Fourierreihe[",var,", ",n,"]  = ",ff[var,n]]," "];
 If[druck==1, Print["Num. Fourierreihe[",var,", ",n,"]  = ",ff[var,n]//N]," "];
ff[tInt_]:=a[0]/2+Sum[a[nInt] Cos[nInt ω tInt]+b[nInt] Sin[nInt ω tInt],{nInt,1,Infinity}];
 If[druck==1, Print["Unendliche Fourierreihe[",var,"]  = ",ff[var]]," "];
ffExp[tInt_]:=ExpToTrig[a[0]/2+Sum[a[nInt] Cos[nInt ω tInt]+b[nInt] Sin[nInt ω tInt],{nInt,1,Infinity}]];
 If[druck==1, Print["Unendliche Fourierreihe komplex[",var,"]  = ",ffExp[var]]," "];
ffKomplexTrig[tInt_,znInt_]:=ExpToTrig[Sum[c[nInt] E^(I nInt ω  tInt),{nInt,-znInt,znInt}]];
 If[druck==1, Print["Komplexe Fourierreihe wieder trigonometrisch[",var,", ",n,"]  = ",ffKomplexTrig[var,n]]," "];
ffKomplexExp[tInt_,znInt_]:=TrigToExp[Sum[c[nInt] E^(I nInt ω  tInt),{nInt,-znInt,znInt}]];
 If[druck==1, Print["Komplexe Fourierreihe[",var,", ",n,"]  = ",ffKomplexExp[var,n]]," "];
ffKomplex[tInt_]:=Sum[c[nInt] E^(I nInt ω  tInt),{nInt,-Infinity,Infinity}];
 If[druck==1, Print["Komplexe Fourierreihe[",var,"]  = ",ffKomplex[var]]," "];
If[druck==1, Print["Plot"];
Plot[Evaluate[{fktInt[var],ff[var,n]}],{var,start0Int,start0Int+perT}];," "]
];
four[f,t,T,t0,6,0]

f[t_]:=Abs[t-Pi]+Sin[t/2];
T=2Pi;
t0=-Pi;
(*  four[fkt_,var_,perT_,start0Int_,n_,druck_] *)
four[f,t,T,t0,6,1]

Plot[f[t],{t,-Pi,Pi}]

Plot[Evaluate[ff[t,4]],{t,-Pi,Pi},PlotPoints->50]

7

Remove["Global`*"];

a

f1[x_]:=1/2 E^(-2x^2);
fTransf1[Ω_]:=1/(2 Pi) Integrate[f1[λ] E^(-I λ Ω),{λ,-Infinity,Infinity}];
fTransf1[Ω]

f2[x_]:=f1[x]/Sqrt[2Pi];
fTransf2[Ω_]:=1/Sqrt[2 Pi] Integrate[f2[λ] E^(-I λ Ω),{λ,-Infinity,Infinity}];
fTransf2[Ω]

1/Sqrt[2 Pi] Integrate[Evaluate[fTransf2[Ω] E^(I Ω x)],{Ω,-Infinity,Infinity}]

1/Sqrt[2 Pi] Integrate[Evaluate[fTransf2[Ω] E^(I Ω x)],{Ω,-Infinity,Infinity}]==f2[x]

FourierTransform[f1[t],t,Ω]

FourierTransform[f2[t],t,Ω]

b

Plot[Evaluate[fTransf1[Ω]],{Ω,-6,6}]

Plot[Evaluate[fTransf2[Ω]],{Ω,-6,6}]

c

Plot[Evaluate[{f1[x],fTransf1[x]}],{x,-6,6}]

Plot[Evaluate[{f1[x],f2[x],fTransf1[x],fTransf2[x]}],{x,-6,6},PlotRange->{0,1}]

{f1[x],f2[x],fTransf1[x] ,fTransf2[x]}

fTransf1[x] ==fTransf2[x]

Bemerkenswert: Alles Gauss-Glocken.