Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random pulse width square wave

Status
Not open for further replies.

Sa-Ro

Mechanical
Joined
Jul 15, 2019
Messages
279
Location
IN
I would like to create random pulse width square wave as follows:

ON time: 0.0 to 3.0 Milli second

OFF time: 0.1 to 10.0 Milli second

Voltage 5 VDC

Number of cycle: Continuous

Random pulse width square waves to be created from above conditions and save as CSV format to use as arbitrary waveform.

Example:

ON time--------OFF time
---1.1------------3.4
---0.5------------8.6
---2.8------------0.5
---1.6------------7.2
---2.2------------1.7

I have Tektronix AFG31000 series function generator and Tektronix MSO 4 series oscilloscope.

Any recommendations to create in MS Excel, AFG, MSO or online?

Thanks in advance
 
Try XL using the RAND or RANDBETWEEN function.
 
It gives only random numbers. Not able to create square wave.
 
Yes. Agreed.

But the time has to increase step by step.

100 us---0
200 us---0
300 us---5
400 us---5
500 us---0
600 us---5
700 7s---0

And so on...
 
I got one idea from last post. Tomorrow I will check and confirm.
 
Huh? You just use the stream of random numbers as the pulse durations and the time accumulates from that. If you need to limit the resolution to 100 us, you just round or truncate as needed.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! faq731-376 forum1529 Entire Forum list
 
I got the solution to create random square wave in excel.

Column A as time - Milli second (ms)

Column B as ON time with random number (randbetween)

Repeat the rows equal to ON time.

Ex: for random number 1 to 5

Say 3, hence ON time is 3 ms
Repeat three consecutive rows.

Column C as ON / OFF
If random number is changed, the column C value is changed from OFF to ON or vice versa

Column D as Voltage level
If column C value as ON, then column D value as 24

If column C value as OFF, then column D value as 0

This will create random square wave.
 
Geeze, now you want a column with a constant time step?

I didn't try to follow your explanation because it seemed way too convoluted.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top