I concur with @PlasmaHH's idea for the usage of PWL. If you only need a few data points, use the PWL source type directly. Otherwise, put the values into a text file and feed that to the PWL. Excel is nice for this, export as .csv file. That way, any kind of data you can imagine can be converted to a voltage.
This can also work for other primitives besides voltage. Say you wanted a wildly-varying resistance:
- Create a new voltage source, say V3. Ground one end of it.
- Create a new net label, say V3val, and wire it to the V3 source.
- Put the data points into the PWL file of V3 (use whole integers, not "10k".)
- Add a resistor say R5, and change it's "R" value to "R=V(V3val)".
Then R5's resistance will be modeled as the "voltage" generated by V3.
Spice models generally do not include noise in transient simulations. The "noise" model in spice is used only in AC sweeps, where the noise power is calculated as a function of frequency. While resistor (Johnson–Nyquist) noise is in the model, semiconductor models often do not have accurate noise models. The spice diode model does include flicker noise, but not other noise sources.
For your purposes, AC analysis may be sufficient assuming that your diode has a proper model, since what you want is to see if the noise power density is flat. But, I doubt that the Zener model includes accurate noise parameters. The spice model of the diode mentioned in this question (EDZV24B) does not include any noise parameters (which are the AF, KF, and FFE parameters).
Another option (for transient simulations) is to include a voltage sources controlled by a random number. For a description of using this approach to noise modeling, this website from Giorgio Vazzana has good information. But, to follow this approach, you have to know how much noise to expect. Also, the transient simulation would not normally include noise added by the transistor.
An example noise voltage source (from the above mentioned website) is:
Vn 1 n1 dc 0V ac 1mV trrandom (1 5us 0s 125m 0m)
Best Answer
Yes, you can inject noise using the arbitrary voltage (or current) source, then use things like the
random
orwhite
function to create some noise.Here is an example circuit (I separated the noise from the signal just to make things clearer - obviously you can combine them together in one function if you wish):
Simulation:
All the functions are detailed in the help under
circuit elements -> arbitrary behavioral voltage or current sources
.Noise simulation mode
Also, just in case you were not aware, SPICE has a noise simulation mode, to quote from the help files:
Basic example:
Simulation:
The above is rather boring as it only models the resistor noise (I stepped the resistor through various values to show how the Johnson noise increases with resistance). But it can be very useful with more complex circuits containing diodes/transistors/opamps/etc.