plotting Fourier series periodic signal ?

1 view (last 30 days)
i have this homewrok which asked me to plot a fourier series
the issues:
  1. i don't know how to change it from unit step function
  2. i don't know how to plot it to the 2nd period

Accepted Answer

Chandra
Chandra on 2 May 2022
Edited: Chandra on 4 May 2022
Hi,
For plotting x(t) use stem function
T1 = 2;
T0 = 8;
x1 = ones(1,2*T1); % 1 i.e., 0<t<T1
x2 = -1*ones(1,T0/2-T1); %-1 i.e., T1<t<T0/2
x = [x2 x1 x2];
%x = [x x x];
%t = linspace(-12,12,length(x));
t = linspace(-4,4,length(x)); %comment this line if 6 and 7 lines are uncommented
stem(t,x);
axis([-15 15,-2 2]);
for fourier series of x, refer to this link
  7 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by