Message Boards Message Boards

0
|
5844 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Generating a train of short duration pulses

Posted 3 years ago

I need to generate a pulse train where the time duration of the pulse td<<T the period of the pulse. Ideally I would like to use something analogous to the SquareWave function. The problem with SquareWave is that it is a square wave and by definition has 50% duty cycle. I can construct a couple of pulses using combination of UnitStep functions, but for a string of many pulses, it is an awkward approach.

POSTED BY: Jesse Sheinwald
Posted 3 years ago

See here:

https://community.wolfram.com/groups/-/m/t/440741

Edit:

I have a solution of myself:

Sum[UnitBox[k (x - T j)], {j, -10, 10}]

UnitBox gives a top hat centered at 0, width 1. The k makes it with a shorter width. The T is the periodicity.

When k=1/T, you get a straight line.

And when k<1/T you get a different thing than the one you asked for.

But if k>1/T, you get this pulse train.

You can also add a phase, to make the function start where you want:

Sum[UnitBox[k (x - T j+phi)], {j, -10, 10}]

With a phi that runs from 0 to T.

Change the values for j to get the number of pulses. Number of pulses=2j+1.

I hope it helps!

POSTED BY: Ehud Behar
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract