How should I plot a square wave signal by utilising fourier series?

조회 수: 4 (최근 30일)
Tan
Tan 2024년 9월 24일
댓글: Star Strider 2024년 9월 29일
How should I code this square wave by utlising fourier series signal? I do not have any idea how to do so.
The amplitude and period of the graph is both 1.
  댓글 수: 2
Saurabh
Saurabh 2024년 9월 24일
Hi @Tan,
I guess you have provided the wrong screenshot, can you check it once.
Tan
Tan 2024년 9월 29일
Could you check this question and see? Sorry for the inconveniences caused and thanks for helping.

댓글을 달려면 로그인하십시오.

답변 (1개)

Star Strider
Star Strider 2024년 9월 24일
A relatively straightforward approach to creating a square wave pulse train from sinusoids is to do something like this —
Fs = 1000;
L = 10;
t = linspace(0, Fs*L, Fs*L+1).'/Fs;
fv = 1:2:100;
s = sum(sin(2*pi*t*fv) ./ fv,2);
figure
plot(t, s)
grid
axis('padded')
Adapt it to your requirments.
.
  댓글 수: 5

댓글을 달려면 로그인하십시오.

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by