# SPICE QUESTION

Discussion in 'Electronic Design' started by rush3k, Feb 2, 2007.

1. ### rush3kGuest

Hello,

I have a 3 nodes in circuit, and I'll like to apply a signal to each
of them in a random manner while observing the output.

Is there a way to make the SPICE RND function do this?

Thanks.

2. ### D from BCGuest

I posted a similiar question some time ago:
See

I did a short cut and just stung together a bunch of sine generators
at strategic frequencies and amplitudes.
D from BC

3. ### Tom BruhnsGuest

I'm not quite clear on what you mean by "in a random manner." Do you
mean each signal is a (pseudo)random value, or that each signal is on
or off at a point in time determined by a random draw? Or perhaps you
mean something else.

I use LTSpice; its random function is certainly up to either task,
though the second is easier, especially if you are willing to divide
time into equal segments. You get a different random number,
uniformly distributed between 0 and 1, from LTSpice's rand(x)
function, for each different value of integer(x). That is to say, if
you get y1 for rand(x), you will get y1 if you ask for rand(x) again
with the same x, or with any x with the same integer part. You will
get a different y for each different integer value of the argument.
So you can do something like rand(1e6*time) to get a new random value
each microsecond of your simulation. You can use SW components and
boolean functions to generate on and off states of the switches as you
desire--or you can multiply your signals by some function of the
random value--or.... For example, "B 0 1 V=rand(1e6*time)>0.4"
generates 1 volt 60% of the time, and 0 volts 40% of the time, divided
into microsecond long chunks. Repeating the simulation gives the same
result; add a large integer to the argument for rand to get a
different set of random values.

Cheers,
Tom

4. ### habib.bouaziz-vialletGuest

Le Fri, 02 Feb 2007 13:32:52 -0800, rush3k a écrit :
Random word should neer used at random.
Time-dependent or Frequency-dependent sources is merely achieved with
spice
Habib

5. ### rush3kGuest

Yes, the link sheds some light on another way I could run the
simulation and still get desired effects. Thanks!