0
\$\begingroup\$

I have a clock with a time period of 1 ms. I want to generate a signal which has the following characteristics:

Some \$\hat a = 3.7, \delta = 0.1\$ . At a particular clock cycle, the signal must have a voltage which is from the uniform distribution \$[\hat a -\delta,\hat a + \delta]\$. Say this value is \$a_1\$. At the next clock cycle, the voltage \$a_2\$ must be such that \$a_2=2\hat a-a_1\$. This will give the average voltage in two clock cycles always equal to \$\hat a\$, which helps me a lot with my analysis

The first part of getting a value from uniform distribution is easy. How do I do the second part? Is there any way to write a loop in PWL such that the first voltage will be chosen randomly from the interval, and the second will be as given in the above condition, and this is repeated forever? I have no idea about the concept of memory in LTspice.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Your best bet is to generate a PWL time/value file externally in something like Excel/R/Python/Text Editor or whatever you are most comfortable using. Note that you need to specify finite rising and falling edge times for your clocks by having two points associated with each edge.

If you look at the Importing & Exporting PWL Data documentation at Linear Technology's site, it describes using a file of time/value pairs to drive a PWL voltage source.

enter image description here

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.