syms y(x)
y(x) = piecewise(-0.5<x<0,(2+4*x),0<=x<+0.5,(2-4*x), 0);
figure; %tmin=-6;tmax=6;N=100; want these limits -6<=x<=6
fplot(y);

 채택된 답변

Dimitris Kalogiros
Dimitris Kalogiros 2018년 9월 7일
편집: Dimitris Kalogiros 2018년 9월 7일

1 개 추천

clear; clc;
syms t g(x) x(t)
g(t) = piecewise(-0.5<t<0,(2+4*t),0<=t<+0.5,(2-4*t), 0)
x(t)=sym(0);
for k=-6:1:6
x(t)=x(t)+g(t-k);
end
subplot(2,1,1); fplot(g, [-6 6 ]);
grid on; zoom on; ylim([-0.1 2.1])
xlabel('t'); ylabel('g(t)'); title('one period')
subplot(2,1,2); fplot(x, [-6 6 ]);
grid on; zoom on; ylim([-0.1 2.1])
xlabel('t'); ylabel('x(t)'); title('signal x(t)')
...and if you run it:

댓글 수: 6

yie don
yie don 2018년 9월 7일
Can we able to find the complex fourier Series represtation of x(t)and mathamatical expression for xfs(t).
clear; clc;
%%definition of periodic signal
syms t g(x) x(t)
g(t) = piecewise(-0.5<t<0,(2+4*t),0<=t<+0.5,(2-4*t), 0)
x(t)=sym(0);
for k=-6:1:6
x(t)=x(t)+g(t-k);
end
subplot(2,1,1); fplot(g, [-6 6 ]);
grid on; zoom on; ylim([-0.1 2.1])
xlabel('t'); ylabel('g(t)'); title('one period')
subplot(2,1,2); fplot(x, [-6 6 ]);
grid on; zoom on; ylim([-0.1 2.1])
xlabel('t'); ylabel('x(t)'); title('signal x(t)')
%%fourier coefficients
syms a0 T k
syms a(k)
% in our example T=1 and -1/2<t<1/2
a_0=int(g(t),t,-1/2,1/2)
a(k)=int(g(t)*exp(-1i*k*(2*pi)*t),t,-1/2,1/2)
% we are able to evaluate fourier coefficients for every k we like
a(1)
a(-1)
a(3)
a(-3)
Adam
Adam 2018년 9월 7일
Please don't use flags where a comment or voting for an answer is more appropriate. Flags are for reporting spam or inappropriate questions/answers/comments, not just for adding a comment about an answer.
Moved from flag:
"Flagged by yie don about 4 hours ago. Best anser"
yie don
yie don 2018년 9월 8일
sorry it was a mistake , and im a beginner
yie don
yie don 2018년 9월 8일
편집: yie don 2018년 9월 8일
@Dimitris Kalogiros so i have to plot the fourier coefficinets for -101<= k<= +101 for the evaluation of the fourier series can we do it on the same graph with changing the above k limits for new limits or do we have to define a new k value for -t<= t <= 1 ??
Dimitris Kalogiros
Dimitris Kalogiros 2018년 9월 8일
This is my last contribution...
Keep in mind that for your example fourier coefficients are, after all, real numbers and are not zero for add index or 0.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

릴리스

R2017b

질문:

2018년 9월 7일

편집:

2018년 9월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by