Generate a pulse waveform using the fourier series expansion.

2 ビュー (過去 30 日間)
Kevin Ryan
Kevin Ryan 2017 年 10 月 8 日
回答済み: Gautam 2025 年 2 月 7 日
Hello, this is another MATLAB question that I am not sure how to begin. Could someone help with this?... thanks in advance.

回答 (1 件)

Gautam
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)

カテゴリ

Help Center および File ExchangePulse and Transition Metrics についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by