This is part 2 of a two part post on simulating jitter with an AWG, to check out part 1 click here. In part 1 we discussed what jitter on a digital signal is, namely mistimed edge crossings. With larger arbitrary waveform memory capacity and superb signal integrity, we discussed how modern AWGs make a great low cost solution for simulating complex jitter patterns on digital communication and clock signals for noise immunity and BER testing purposes. Finally we were introduced to the error function (ERF) which we can use to build digital pulses with edge events that we can easily and quantitatively vary to simulate jitter. In this post we will build on the ERF concept and put an algorithm together for adding complex jitter patterns to our digital pulses.

In the following examples we will use Matlab to build the arbitrary waveform, the Agilent 33522A dual channel AWG to output it, and the Agilent 54833D oscilloscope to view the waveform. Initially, we will build a 500 Kbps clock signal as an arbitrary waveform using Matlab and its built in ERF feature. We will be using a 250 MSa/s sample rate so the waveform points will be spaced 4ns apart. Let's first start out by building a waveform consisting of two pulses and adding a small value to the edge crossing time of the second pulse's falling edge to simulate jitter. The inner loop is where the pulse is created using a positive and negative ERF function. The first loop consists of two iterations to create two pulses. Notice the highlighted section in the negative ERF function. This term is what will cause the edge shift in the second pulse. Notice the term will be 0 for the first iteration and 150e-12 for the second, causing the edge to crossing to shift 150 ps.

The waveform was saved to a CSV and then loaded onto the 33522A AWG. The output waveform from the 33522A was then captured using the scope. The image below is a zoomed in view from the scope showing the falling edge of the two pulses. Notice that the shift between the pulses is ~ 150 ps (click image to enlarge).

We can use this method to produce pulses with any variety of edge crossing times and add them to our arbitrary waveform. In this way we can generate a clock signal with a precise amount of jitter on each pulse. We can add as many of these precisely defined pulses up to the limit of the waveform memory. In this example, I am using the Agilent 33522A with a waveform memory of 1 MSa and each pulse is defined by 500 samples allowing up to 2000 pulses per waveform. With the 33522A’s optional waveform memory of 16 MSa we could get up to 32k pulses per waveform.

Let’s use this capability to simulate the jitter we might expect from a power supply coupling to the clock line. For this example I will inject 200 ps of periodic jitter at 5 kHz.

Here is the result.

Just by looking at the color graded display of the oscilloscope capture you can see the periodic nature of the jitter. The sine wave spends more time near its maximum amplitude than it does near its zero crossing, this is shown on the oscilloscope as pink being the greatest density of samples, followed by blue and with green being the lowest density near the center. In this example we used a simple sine wave at a given frequency to define our jitter pattern. We could make the jitter pattern more complex by using a random number generator with a normal distribution to represent random Gaussian jitter or we could have added together multiple sine waves at various frequencies to represent multiple spurious coupled jitter sources.

So lets review and explicitly write out the algorithm we just went over for generating an arbitrary waveform that consists of a long series of digital pulses with an added jitter pattern to the edge crossings:

In the following examples we will use Matlab to build the arbitrary waveform, the Agilent 33522A dual channel AWG to output it, and the Agilent 54833D oscilloscope to view the waveform. Initially, we will build a 500 Kbps clock signal as an arbitrary waveform using Matlab and its built in ERF feature. We will be using a 250 MSa/s sample rate so the waveform points will be spaced 4ns apart. Let's first start out by building a waveform consisting of two pulses and adding a small value to the edge crossing time of the second pulse's falling edge to simulate jitter. The inner loop is where the pulse is created using a positive and negative ERF function. The first loop consists of two iterations to create two pulses. Notice the highlighted section in the negative ERF function. This term is what will cause the edge shift in the second pulse. Notice the term will be 0 for the first iteration and 150e-12 for the second, causing the edge to crossing to shift 150 ps.

pulse=[];

for r=0:1:1;

for i = 5.04E-7:4E-9:2.5E-6;

y = erf((i-1E-6)/10E-9)+erf(-(i-2E-6+r*150E-12)/10E-9)-1;

pulse=[pulse y];

end

end

We can use this method to produce pulses with any variety of edge crossing times and add them to our arbitrary waveform. In this way we can generate a clock signal with a precise amount of jitter on each pulse. We can add as many of these precisely defined pulses up to the limit of the waveform memory. In this example, I am using the Agilent 33522A with a waveform memory of 1 MSa and each pulse is defined by 500 samples allowing up to 2000 pulses per waveform. With the 33522A’s optional waveform memory of 16 MSa we could get up to 32k pulses per waveform.

Let’s use this capability to simulate the jitter we might expect from a power supply coupling to the clock line. For this example I will inject 200 ps of periodic jitter at 5 kHz.

pulse=[];

for r=2*3.1415/100:2*3.1415/100:2*3.1415;

for i = 5.04E-7:4E-9:2.5E-6;

y = erf((i-1E-6)/10E-9)+erf(-(i-2E-6+sin(r)*100E-12)/10E-9)-1;

pulse=[pulse y];

end

end

So lets review and explicitly write out the algorithm we just went over for generating an arbitrary waveform that consists of a long series of digital pulses with an added jitter pattern to the edge crossings:

- Determine your signal rate, how many points per pulse, and how many pulses are in the waveform. These settings are highly dependent on the AWG you are working with and the jitter characteristics you want to simulate.
- Create a loop that builds your ideal pulse with a positive and negative ERF using the example above. Remember the rise / fall times of the pulse is limited by the AWG's sample rate.
- Add the jitter pattern function and jitter magnitude you want to simulate to the desired edge or edges of the signal. This is done by adding the jitter pattern and magnitude inside the ERF function.
- Create the outer loop which controls the number of digital pulses created and if necessary steps the jitter pattern variable through the appropriate values.

The examples and the algorithm discussed so far in this post apply mainly to clock signals. Of course the same concepts could be applied to simulate jitter on digital communication signals like SPI and CAN for BER and noise immunity testing. There is just the added complexity of plugging in 1s and 0s at the right spot in the waveform to simulate meaningful data.

I posted the code to a Matlab function that creates a user specified digital clock signal with jitter on it on Matlab central. Click here to download

To check out Agilent's AWGs click here

I posted the code to a Matlab function that creates a user specified digital clock signal with jitter on it on Matlab central. Click here to download

To check out Agilent's AWGs click here