1. 函数的傅里叶级数展开
(1)矩形波: f ( t ) = { − 1 , − π ≤ t < 0 1 , 0 ≤ t ≤ π f(t)=\begin{cases}-1, -\pi \leq t<0 \\ 1, 0 \leq t \leq \pi \end{cases} f(t)={ −1,−π≤t<01,0≤t≤π
F[t_] := Which[-Pi <= t && t < 0, -1,
0 <= t && t < Pi, 1]
Plot[F[t], {
t, -4, 4}]
fw1 = FourierTrigSeries[F[t], t, 1]
fw5 = FourierTrigSeries[F[t], t, 5]
result1 = FullSimplify[Sqrt[2*Pi]*FourierTransform[F[t], t, w]]
振幅谱/\[Placeholder]
Plot[Abs[result1], {
w, -10, 10}]
相位谱/\[Placeholder]
ComplexExpand[Re[result1]]
ComplexExpand[Im[result1]]
Plot[Arg[result1], {
w