Post Go back to editing

simulating jitter

Category: Software
Product Number: LTspice

i need to simulate a pulse with  jitter on rising/ falling time : i use the Voltage source  with the following sintax :

PULSE(0 5  90n 1n 1n  {50n +10n*RANDOM(time)} 900n 3)

but i have an error:

what did o do wrong ? 

thnaks 

  • Hi !
    I think you can't used variable into pulse generator.

    You have to used "behavioural source". => bv

  • thanks but in the bv it seems i can not use the PULSE syntax so i am stuck - unfortunately the user guide does not provide example ! 

    if i try to use "PULSE" in bv i have an error : 

  • The noise can be generated using a behavioral source based on the formula.
    A separate voltage source can be used for the pulse, and a third behavioral source can be used to combine the two with V=V(Vnoise)+V(Vpulse) ?

  • PULSE(0 5  90n 1n 1n  {50n +10n*RANDOM(time)} 900n 3)

    Hi  ,

    A voltage source pulse function requires defined values for each of its attributes, which themselves cannot be a function of "time", although, yes, it produces a function in time. If you want a arbitrary (not predefined) function of time, you would need a B source, as noted by  . You could use the rand() or random() functions in a B source to produce the jitter in your pulse:

    rand(x) Random number between 0 and 1 depending on the integer value of x.
    random(x) Similar to rand(), but smoothly transitions between values.

    B sources do support random number generation where time can act as the seed. Unfortunately the seed>result is actually deterministic. I played around with random() (which provides a smooth transitions (recommended)). The way to increase the seed frequency/generation frequency is to multiply time, namely:

    V = random(time*100)

    Nevertheless, you might be better off using the white(x) function, which directly produces negative values (handy for jitter), and even smoother transitions:

    white(x) Random number between -0.5 and 0.5 smoothly transitions between values even more smoothly than random().

    Now, you want a B source that produces pulses as defined by your V source:

    i need to simulate a pulse with  jitter on rising/ falling time : i use the Voltage source  with the following sintax :

    PULSE(0 5  90n 1n 1n  {50n +10n*RANDOM(time)} 900n 3)

    Note that you have not applied jitter to the rise and fall times, but instead to the on time. Assuming this is what you actually want.

    You would have a B source defined by white() which acts as the time jitter.

    V = white(time*100)

    You would use the jitter value in an absdelay function (with t = value + jitter) combined with a buf funtion to produce a pulse; I think that would work with appropriate multipliers. Will have to try it later.

    mike

  • Hi   and  ,

    As an academic exercise I attempted to produce white-noise based jitter using a pulsed source, a phase-shifted version of the source (set earlier than ideal by some set quantity) and a "white noise time" addition to the pre-pulse using absdelay(). Essentially, the solution that   proposes but the noise is in "time". I also added measurable readout of the jitter using state machines. You could play around with integrating the jitter, etc. Here are the files, and a screenshot showing how the white noise lines up with the measured jitter:
     Jitter Experiments.zip

  • Hi , Good job.

    Another example from /groups.io/g/LTspice : But the jitter acts only from the falling edge : 

    Jittered Clock.asc

  • Hi ,

    Wait, that's my version. :-)

    I did find the group.io version noisy_wav.asc. Very similar solution in concept, but clever use of A devices instead of B sources. You could probably modify noisy_wav to do leading and trailing edges using a prehistory duplicate of the wave, as I've done.

    mike

  • esabard38V2,

    Be careful to only use functions that are defined for the place where they are used.  All functions do not automatically work everywhere in LTspice.  RANDOM(time) can not be used as one of the parameters of a PULSE source since RANDOM() is not defined there; and PULSE can not be used as a parameter of a Bv source since PULSE is not defined there.  Check LTspice's Help to see what functions can be used in each case.

    One way to add jitter to a signal, is to start with a PULSE source that has somewhat slower Rise and Fall times (maybe 100n instead of 1n), and then send that perfect PULSE waveform into a comparator, whose other input is a voltage that jitters up and down semi-randomly.  Use a Bv source with a RAND(), RANDOM(), or WHITE() function to generate that varying "DC" voltage.  By varying the comparator's second input voltage up and down, it changes the exact time that the original PULSE waveform crosses it, and it gets jitter that way.  You can use LTspice's Diffschmitt (with Vt=0 and Vh=0) as the comparator.

    Note that RAND(x), RANDOM(x), and WHITE(x) change state only once for each whole number of its argument X.  If X = time, then it changes only once every second, which is much too slowly.  You probably want to change that to something like (1e8*time), so that it is certain to have a new value for every cycle of your 1.1 MHz PULSE signal.

    Also note that these "random" functions are deterministic, as Mike already noted, meaning that the jitter you get would be the same every time you run the simulation.  That might be desirable.  But I think you can randomize it by going into the Settings and click the checkbox for "Use the clock to reseed the MC generator".  Unless I'm mistaken, that affects RAND(), RANDOM(), and WHITE() as well.

    Regards,

    Andy