Generate a pulse waveform using the fourier series expansion.
2 ビュー (過去 30 日間)
古いコメントを表示
Hello, this is another MATLAB question that I am not sure how to begin. Could someone help with this?... thanks in advance.



0 件のコメント
回答 (1 件)
Gautam
2025 年 2 月 7 日
Hello Kevin,
In this problem too, you are given the coefficient of the sine term of the Fourier series expansion for the function g(x). All you have to do is take the sum of the first N sine terns multiplied by their coefficients.
Here's the code that does it for the first 16 terms. You can modify the code according to you requirement and format the output using the fommands mentioned in the problem statement.
N = 16;
x = linspace(0,2,80);
F=0;
a=1/8;
bn = @(n) (4/pi)*(1/n)*sin(n*pi/4)*sin(n*pi*a);
for n = 1:N
F = F + bn(n)*sin(n*pi*x);
end
plot(x,F)
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
