What is the Fourier Series Coefficient of F=exp(sin(x))?
5 ビュー (過去 30 日間)
古いコメントを表示
syms x
T=2;
w0=2*pi/T;
f=exp(sin(x));
a0_sym=1/T*int(f,x,0,T);
a0_sym=double(a0_sym);
for n=1:3
a_sym(n)=2/T*int(f*cos(n*w0*x),x,0,T);
b_sym (n)=2/T*int(f*sin(n*w0*x),x,0,T);
a(n)=double(a_sym(n));
b(n)=double(b_sym(n));
end
s = a0_sym + sum(a.*cos((1:3).*w0.*x),2) + sum(b.*sin((1:3) .* w0.*x),2)
x_num = (-10:0.01:10).';
s_num = double(subs(s,x,x_num));
plot(x_num,s_num)
This is what I did but I'm not getting the desired result...
Please help
6 件のコメント
Torsten
2022 年 10 月 20 日
I have no experience with FFT, but
should be the correct tool for this task.
回答 (1 件)
Bjorn Gustavsson
2022 年 10 月 21 日
編集済み: Bjorn Gustavsson
2022 年 10 月 21 日
Might I be so bold as to suggest (physicist writing about calculus here...) that this task ought to have some clever analytical solution method that is easier to do by hand than with help of computer. If you write the exponential as its series expansion:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1164273/image.png)
For the first few terms we can easily rewrite (sin(t))^n into simple sin(n*t) and cos(n*t) terms, and there are trogonometric power-formulas: Trigonometric Power Formulas. If you use those you will get some gnarly expressions for the higher (or arbitrary) powers of (sin t)^k. If you plug those expression into matlab's symbolic tools you might get it to clean them up such that you can recognize the coefficients before the sin(k*2*pi*t) and cos(k*2*pi*t) terms. Those should be your Fourier-coefficients.
HTH
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!