# Plot periodic function from Dirac delta function [duplicate]

Sorry for my bad english. I need to plot periodic function from dirac delta: δT(t)=∑δ(t–n*T), where T - is a constant, and n=-20..20 And after them, plot new function fd=f(t)*δT(t) - discrete signal of signal f(t)

I tried to solve it:

betta[t_] := Piecewise[{{1, t == 0}}]
bettaT[t_] := Sum[betta[t - n*T], {n, -20, 20}]
Plot[bettaT[t], {t, -10, 10}]


but graphic is always on 0 level. I suspect that it is precision of the comparison t==0, but a don't know how to solve it right

-

## marked as duplicate by m_goldberg, Pickett, Sjoerd C. de Vries, belisarius, Michael E2Feb 23 at 20:34

Related: 42393, 39445 –  Michael E2 Feb 23 at 15:20
What you are describing as your new discrete function is essentially a sampling of the function f[t] at specific (integer-valued) time points. Is this what you are trying to accomplish, or do you really need to do the plots? –  bill s Feb 23 at 15:57
yes, i have continuous function f(t)=cos^(Pi/2 * t) and i should sampling it. For this I create periodic function bettaT and multiply it to my f(t). And I should get fd(t)=f(t) if bettaT(t)=1, else null –  Venzo Feb 23 at 16:04

You can accomplish the sampling of your function much more easily than the route you describe. The following defines the function in the first line, and then samples it at all integer locations (in the Table) and then plots using ListPlot.
f[t_] := Cos[t Pi/2];