Monday, August 29, 2011

Simulating Jitter with an Arbitrary Waveform Generator Part 2

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.

   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];

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.

   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];

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:
  1. 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.
  2. 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.
  3. 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.
  4. 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

Monday, August 22, 2011

Simulating Jitter with an Arbitrary Waveform Generator Part 1

The Arbitrary Waveform Generator (AWG) is an instrument you will probably find on the bench of most electrical engineers. It allows you to produce a variety waveforms from built in functions like square and sine to arbitrary user defined waveforms. As AWG technology progresses, it opens the door for new applications. In this two part blog post we will look how to use an AWG to simulate jitter on digital clock and communication signals. This is extremely useful when doing noise immunity and BER testing on digital circuits.

AWGs have always been a great way to create serial data or clock signals as you have the ability to produce accurate signals with very precise edge placements. Usually you can place an edge crossing to better than 1/100th of the sample interval of the AWG. With this accuracy you are able to add sub-nanosecond timing error to clock or data signals to test your systems susceptibility to jitter. With basic AWG waveform memories now in the millions of points, you are now able to add jitter to longer pulse patterns in more interesting ways.

Jitter is defined as the deviation in or displacement of some aspect of the pulses in a digital signal. What is most often characterized is the Time Interval Error (TIE) which is the timing deviation of the edge crossing of the serial data signal relative to a clock. This can also be the timing deviation of a clock relative to an ideal clock.

Jitter and TIE can end up on a signal through a variety of mechanisms. For example, jitter can be the result of spurious coupling from a switching power supply to the digital systems clock signal. A designer would be prudent to test his systems vulnerability to such an occurrence. While there are many more expensive solutions for injecting jitter onto a clock signal, most AWGs are perfectly capable of simulating this kind of jitter.

You can change the edge crossing position of an arbitrary waveform very precisely in steps on the order of the sample period of the AWG (1/sample rate) divided by its vertical resolution in bits. You also want to pay close attention to the AWG's jitter spec, which specifies the amount of jitter error that the AWG will add to your "ideal" digital signal. Modern AWGs will have jitter specs < 100 ps, for instance Agilent's 33521/22A AWGs have a jitter spec of < 40 ps. Now we need a mathematical algorithm that allows us to easily create our digital pulses and allows us to easily manipulate the pulse edges to simulate jitter. Lets first start out with creating the pulses using the error function (ERF), which is the integral of the Gaussian or Normal Distribution. The ERF is defined and plotted as (click to enlarge):

The ERF gives a positive step from -1 to 1 with the zero crossing at t0. In the Gaussian distribution σis the variance or the measure width of the distribution. The correlation of σ to the width of the rising edge in the error function gives a 10-90 risetime of about 2σ. The negative step or falling edge is defined as the ERF function multiplied by -1. The only limitation is that σ needs to be greater than 2 AWG sample periods in order to ensure adequate oversampling.

That will do it for part 1. In part 2 we will see how we can use the ERF to simulate jitter on a digital signal. We will go over some examples using Matlab code and Agilent's 33522A. 

Tuesday, August 16, 2011

Simple Way to Use the Power of the Cloud for Test and Measurement

In today's economy technology companies have their resources spread across the globe. These global engineering resources have to work closely together throughout the design and testing life cycle of a product. One major challenge these global engineering teams face is sharing real test data access or control of testing resources across thousands of miles and country borders. In this blog post we will look at a simple but secure example of how to use cloud computing or the cloud to share test data and test resource control across the globe.

Cloud computing refers to using hardware and software computing resources in a computer network, such as the internet, for computation and storage, instead of just on a local computer. I am going to use the term “cloud” in this article to refer to computing assets on the internet that are provided by a third party such as Google or Amazon. The cloud can provide three main benefits to test:

1. Share test data across global engineering teams that can be accessed anywhere at any time without a company firewall getting in the way.

2. To serve as an always connected intermediary between your test software and your computing device. Imagine starting or stoping a test from your smart phone at the airport.

3. You can leverage the massive computing capability of the cloud for test applications that require a lot of computing power for post processing measurement data.

In this post we will focus on cloud benefits for bullets 1 and 2. For our cloud test example we will use a popular and free cloud service called "Dropbox." Dropbox allows you to set up a folder or file directory on your computing device, such as a PC or smart phone, that is sync'd to the cloud (Dropbox server) for backup. When you change or add a file on one computing device Dropbox will automatically sync the change or addition on any other computing device you have Dropbox installed. For security Dropbox is password protected, for more info on Dropbox click here.

For storing, sharing, and viewing test data Dropbox is a great tool for 3 main reasons:

  1. It allows you to securely back up your test data on the cloud 
  2. It allows you to easily share test data among geographically separated teams and companies, such as if you are using a CM that does not have access to your companies intranet.
  3. It allows you to access test data from almost anywhere securely without having to deal with a VPN, such as if you wanted to check the outcome of a test on your smart device at an airport in India.
Now getting the test data to Dropbox is fairly easy since all major software development environments like Labview, Matlab, or Visual Studio have easy to use APIs that allow you to write data to various file types such as an Excel Spreadsheet. The way we incorporate Dropbox into the test mix is by having our test program write to files that are located in a Dropbox folder. Then as long as the computer running your test program is connected to the internet Dropbox will automatically send your test data to the cloud and sync it to other computing devices sharing that same Dropbox account. Now the test data is safely back-upped and securely shared.

We can even go a step further and add certain types of remote control aspects to our test using Dropbox. If instead of just writing data to a file on Dropbox, we have our test program also read from a file we could could control our test from the cloud too! We could do something as simple as use a small section of the test data file for changing basic test settings to something as complex as using a scripting language to change entire test routines. 

As a proof of concept for this post I setup an example cloud test using Agilent's 34972A DAQ / Switch Unit, VEE programming language, and Dropbox. The example cloud test was created to simulate a long term DAQ type testing environment. It makes temperature, voltage, fan rotation, and irradiance measurements on a DUT. I added two simple settings controls to the test data Excel file that allow you to turn on or off a fan and heater on the DUT. The VEE program reads the settings from the Excel file periodically and uses the control features on the 34972A to change the DUT settings. Below is a screen shot of the excel spread sheet from my example cloud test program (click to enlarge). You can also get your own read-only version of my test data file using the Dropbox link I provided below.

To conclude Dropbox provides an easy to use secure way to leverage the power of the cloud to back up, access, and share test data easily and securely. We even looked at a way to use Dropbox and the cloud to control a test remotely from anywhere without the hassle of VPNs. If you have a test example where you use the power of the cloud I would love to hear about please share as a comment or shoot me an email.

Monday, August 8, 2011

Power Supply Constant Voltage (CV) and Constant Current (CC) Modes

Young engineers and technicians often have trouble understanding constant voltage (CV) and constant current (CC) settings on a variable power supply when testing. Also they sometimes get confused why a power supply is only delivering 0.634 A to the load and not the 1 A that they set it for. The following video is made by a colleague of mine and it explains CV and CC modes on a power supply and how the load characteristics determine which mode the power supply is in. The first video explains from a theoretical point of view and the second one demonstrates it on a power supply and DC electronic load.

Tuesday, August 2, 2011

Getting Up Close And Personal With Your Local Oscillator

Recently I had an article published that discusses using a counter with gap-free measurement capability to perform signal analysis on local oscillators in communication, radar, and electronic warfare designs. Below you will find the intro to the article and a link to the article in its entirety. The article appears in Electronic Military & Defense.

A local oscillator (LO) is the heart of any modern radar, electronic warfare or communication system. LOs produce carrier signals for our transmitters and reference signals for our receivers. With more and more data being squeezed into small bandwidths and the continual need to resolve targets accurately in crowded areas,  ensuring an LO has high stability and spectral quality is a critical part of modern transmitter and receiver design.

To verify stability and spectral quality, instruments like signal analyzers provide a great wide-area view of the noise and spectral content around the LO carrier signal. Where they fall short is providing a clear picture of the phase noise close to the carrier. Modern frequency counters can pick up where instruments like signal analyzers leave off. This article discusses how the high resolution and gap-free measurement capability found in modern counters can be used to get you closer to your LO signal.