Clear Filters
Clear Filters

i need to plot equation w(t) = symsum(dir​ac(t-k*Ts)​,k,-Inf,In​f) in discrete time signal.

6 views (last 30 days)
i need to write this equation in matlab and plot them as well as discrete time signal. i already coded them with:
t=-5:0.25:5;
syms k
w(t) = symsum(dirac(t-k*Ts),k,-Inf,Inf);
Unrecognized function or variable 'Ts'.
stem(t,w(t))
but i didnt get the answer

Accepted Answer

檮杌
檮杌 on 4 Oct 2023
That must be a pulse train with interval of Ts. You need to decide your Ts. An example can be like below.
t=-5:0.25:5;
Ts = 1;
syms k
w = symsum(dirac(t-k*Ts),k,-Inf,Inf);
w = double(w);
idx = w == Inf;
w(idx) = 1;
stem(t,w)
  5 Comments
Paul
Paul on 4 Oct 2023
t = -5:0.25:5 does not define a discrete time signal. A discrete-time signal would be of the form
w[n] = ...
where the right hand side depend on n, and n in integer in the range -inf < n < inf.
If w(t) is a continuous-time signal, a discrete-time signal could be formed by sampling
w[n] = w(n*T) where T is a constant.
but sampling continuous-time signals that contain Dirac's may be a tricky business, and probably doesn't make any sense at all in this particular problem if T = Ts.

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 4 Oct 2023
Dirac delta is a distribution rather than a function.
It can be treated as a distribution in an integration, in which case the integral of C*dirac(X) over an interval is C if the interval includes X and is otherwise 0.
But you are not doing integration, you are doing summation. And when you do summation, the function C*dirac(X) is infinity * sin(C ) if X is exactly equal to 0 in the summation and is otherwise 0.
Hence, the summation w(t) is infinite if t-kTs is exactly 0 anywhere for integer k, and otherwise w(t) is 0. But you cannot plot infinity...
For continuous t and rational Ts then over t from -inf to +inf there would be an infinite number of those infinities. After all, if Ts = p/q for integer p and integer q, then when k becomes a multiple of q, k=r*q then the q would cancel, and k*Ts would be p*r for integer p and r and that would be satisfied when t becomes that p*r . If Ts is irrational then with continuous time you could still satisfy at selected irrational t.
With discrete time over an infinite interval, the p*r logic still works, and if the discrete time is according to a rational frequency you would get infinities with large enough times.
With discrete times over a finite interval (such as you have), there very well might not be any locations where w(t) is infinite... it might well be all zero.
  1 Comment
Paul
Paul on 4 Oct 2023
Hi Walter,
I'm not following this statement:
"But you are not doing integration, you are doing summation. And when you do summation, the function C*dirac(X) is infinity * sin(C ) if X is exactly equal to 0 in the summation and is otherwise 0."
In the context of this statement, integration is referring to integration over the independent variable of the signal, but the summation in the Question is not over the independent variable, so I'm not sure why summation is being contrasted against integration. Regardless, where does infinity*sin(C) come from?

Sign in to comment.

Categories

Find more on Mathematics 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!