Fourier Transforms

Square Wave

f[x_]:=Piecewise[{{HeavisideTheta[x+1],x<0},{HeavisideTheta[-x+1],x>0}}]
f3D[x_,y_]:=HeavisidePi[x,y]

Plot[{f[x/4],2f[x]},{x,-8,8},PlotRange->{0,3},PlotStyle->{Thick}]

F1[p_]:=FourierTransform[f[x/4],x,p]
F2[p_]:=FourierTransform[2 f[x],x,p]

Plot[{F1[ p],F2[p]},{p,-8,8},PlotRange->All,PlotStyle->{Thick}]

Gaussian

Clear["Global`*"]

g[x_]:=Exp[-(((x/4))^2)]

Plot[{g[x],g[4 x]},{x,-8,8},PlotStyle->Thick]

G1[p_]:=FourierTransform[g[x],x,p]
G2[p_]:=FourierTransform[g[4 x],x,p]

Plot[{G1[p],G2[p]},{p,-8,8},PlotStyle->Thick,PlotRange->All]

g3D[x_,y_]:=Exp[-(((x/4))^2)-(((y/4))^2)]

Plot3D[{g3D[x,y]},{x,-10,10},{y,-10,10},PlotRange->All,Mesh->False]

G[p_,q_]:=FourierTransform[Exp[-(((x/4))^2)-(((y/4))^2)],{x,y},{p,q}]

Plot3D[G[p,q],{p,-10,10},{q,-10,10},PlotRange->All,Mesh->False]

Fourier Decomposition - Square Wave

Sq[k_,t_]:=(4/(π k))Sin[k t]

Plot[Sq[1,t],{t,-10,10},PlotStyle->Thick]

Plot[Sum[Sq[k,t],{k,1,5,2}],{t,-10,10},PlotStyle->Thick]

Plot[Sum[Sq[k,t],{k,1,21,2}],{t,-10,10},PlotStyle->Thick]

Plot[Sum[Sq[k,t],{k,1,51,2}],{t,-10,10},PlotStyle->Thick]

Plot[{Sum[Sq[k,t],{k,1,51,2}],Sum[Sq[k,t],{k,1,1,2}],Sum[Sq[k,t],{k,1,5,2}],Sum[Sq[k,t],{k,1,9,2}]},{t,-10,10},PlotStyle->Thick]