What's the Best Way to Symbolically Define the Periodic Extension of a Finite Duration Signal?
조회 수: 18 (최근 30일)
이전 댓글 표시
Suppose I have a finite duration signal:
syms s(t)
s(t) = triangularPulse(0,1,1.5,t);
fplot(s(t))
Now I want to define the periodic extension of this signal from t = -inf to inf. I can extend it over a finite duration. For example, with a period P
syms n P real
assumeAlso(n,'integer');
assumeAlso(P,'positive');
sp(t,P) = symsum(s(t - n*P),n,-5,5)
fplot(sp(t,3),[-20 20])
And I can evaluate it as well:
sp(1,3)
But extending to infinity doesn't seem to work so well
sp(t,P) = symsum(s(t - n*P),n,-inf,inf)
% fplot(sp(t,3),[-20 20]) % code took too long to run
sp(1,3)
Is there a way to define a periodic extension that can be evaluated, integrated, etc.? I feel like there should be a way to do it using rem or mod or something similar ....
댓글 수: 0
답변 (1개)
Paul
2021년 10월 23일
댓글 수: 2
Martin
2022년 2월 23일
편집: Martin
2022년 2월 23일
@Paul How could I calculate the fourier transform of the signals I created with the mod function? Is there a way to do this with a specified intervall for showing the frequency spectrum of the infinite periodic signal?
For example, if I try this:
syms s(t)
s(t) = rectangularPulse(-1,1,t);
syms p
sp(t,p) = s(mod(t,p));
T = 3;
nexttile(1);
fplot(sp(t,T));
abs_ft = abs(fourier(sp(t,T)));
nexttile(2);
fplot(abs_ft);
I get the following error:
The following error was reported evaluating the function in FunctionLine update: Unable to convert expression containing remaining symbolic function calls into double array. Argument must be expression that evaluates to number.
Do you know a way to handle this?
참고 항목
카테고리
Help Center 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!