Re: [問題] 傅立葉級數問題

作者: Frobenius (▽.(▽×▽φ)=0)   2014-04-24 20:43:22
※ 引述《sweetycool (tina)》之銘言:
: http://ppt.cc/QKcl
: 想問一下這樣的分段週期函數,可以用mathmatica算出來嗎?
: 謝謝
Clear[f, a0, an, bn]
f[t_] = UnitStep[t] - UnitStep[t - 1];
a0 = f[0]
an = FourierCosCoefficient[f[t], t, n,
FourierParameters -> {-1, \[Pi]}]
bn = FourierSinCoefficient[f[t], t, n,
FourierParameters -> {-1, \[Pi]}]
m = 11;
F[t_] = a0/2 + \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(m\)]\(an\ Cos[
n\ \[Pi]\ t]\)\) + \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(m\)]\(bn\ Sin[
n\ \[Pi]\ t]\)\)
Plot[{f[t], F[t]}, {t, -2, 3}, AspectRatio -> Automatic]
作者: sweetycool   2014-04-25 15:02:00
感恩,不過我設m=∞時顯示出的數值還是亂碼

Links booklink

Contact Us: admin [ a t ] ucptt.com