# How to plot random impulse train?

How to plot a random impulse train with random height and space? From the following code, I was able to get a random height graph and a random interval space graph.

randHeights = Mod[{RandomVariate[NormalDistribution[5, 2], 20]}, 1];
randSpace = RandomVariate[NormalDistribution[5, 2]];
f[t_] := 1;

GraphicsRow[{
ListPlot[randHeights, Filling -> Axis, PlotStyle -> Red,
PlotRange -> All, AspectRatio -> .5],

ListPlot[Table[{t, f[t]}, {t, 0, 50, randSpace}], Filling -> Axis,
AspectRatio -> .5]
}]


You may get a different result from the one I have here, and I'm still unsure how to combine these two concepts.

I'm looking for a single graph that has different intervals & heights (with a maximum of 1) on every run. Any idea, anyone? Thanks for the help!
• randSpace = Table[RandomVariate[NormalDistribution[5, 2]], 1000]; and Sort[randSpace][[1 ;; 10]] can easily generate negative numbers. Usually random delay is specified around a base delay and is a fraction of a base delay.
– Syed
Dec 6, 2021 at 16:54
• @Syed I tried to use this code, but it's not generating any graph. Is it because of the Sort command? Dec 7, 2021 at 12:29
• This was to show that delays could be negative too (not just zero) if a UniformDistribution were chosen.
– Syed
Dec 7, 2021 at 14:03

Something like this?

n = 20;
t1 = RandomReal[{0, 1}, n];
t2 = RandomReal[{0, 1}, n];
t1 = Accumulate[t1];
dat = Transpose[{t1, t2}];
ListPlot[dat, Filling -> Axis]


• Almost, but I don't want to make it overlap or have a close interval from one to another, that is why I use NormalDistribution Dec 6, 2021 at 11:12
• I think you can adapt this yourself Dec 6, 2021 at 11:33
• Got it, I use RandomVariate[NormalDistribution[10, 2], n] for one of the t. Thanks! Dec 7, 2021 at 2:37
• 👍 Glad to hear this. You learn more if you do it yourself. Dec 7, 2021 at 9:25