What's the Best Way to Symbolically Define the Periodic Extension of a Finite Duration Signal?
18 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Paul
on 23 Oct 2021
2 Comments
Martin
on 23 Feb 2022
Edited: Martin
on 23 Feb 2022
@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?
See Also
Categories
Find more on Assumptions 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!