A guide to the methodology of signal capture and generation from MHz to GHz
DataQuest Solutions have built up years of experience related to the requirements for ultra high-speed signal capture and waveform generation. Our customers look to us to provide PC instrumentation cards, most usually for an installation inside a PC, but also the industrial chassis. We also offer a complete solution with cards and software installed. To capture or generate signals at MHz and GHz speeds need not be a complicated process, certainly no more complicated than at slower sampling speeds, however it does bring with it extra considerations. What follows now is an explanation of these for someone new to this field, or for a person who wishes for an update as to the associated technology.
When using analogue to digital (A/D) conversion the binary data that represents the captured signal needs to be transferred, stored and processed. With a large enough memory on the card, data can simply be stored on that hardware until signal capture is complete. The data can then be processed after transfer to the host computer. In this situation the transfer speed is less critical unless one capture period is to follow very shortly after another. The second alternative is to stream directly to the computer, but this requires careful consideration as to the bandwidth limitations of the computer's interface with the card. This applies equally to where the programmer needs to do the reverse (i.e. generate a waveform), or indeed when using a digital I/O card and thus work with logic signals. Streaming data associated with relatively low sampling speeds of a few MHz is well within the capabilities of many types of interface including USB; however once the waveform frequency dictates that sampling needs to be faster, then hardware with and internal computer fitment is the most commonly used and effective interface. This interface is of the type that will be considered here.
Data exchange with the computer
DataQuest Solutions tackles the demands of very high-speed data transmission with the PC by using a range of "Spectrum" instrumentation cards which are suitable for the PCI-Express, PCI-X and PCI and slot interfaces. The newest interface, PCI-Express, offers the greatest opportunities in terms of higher speeds for new applications, indeed with our Spectrum range of cards PCIe provides the advantage of allowing multiple cards to be used in the same PC without having to share available motherboard transfer bus bandwidth. Data transfer is by serial communication, however many of these communication lanes can be placed in parallel to increase overall transfer performance.
By comparison the PCI interface has been around for many years and may now be considered obsolete, however the PCI-X version, essentially an enhanced PCI bus with higher clock speed, does offer over twice the bandwidth of standard PCI for data transmission. Hence it still offers some operational value. It is generally only found on server computer motherboards. PCI and PCI-X use purely a parallel communications bus.
The ability of the chosen slot interface to have sufficient bandwidth is an important point to investigate. Here are some typical transmission speeds for the Spectrum range of cards:
PCIe (eight lane): 3 giga bytes/sec (waveform capture), 2 giga bytes/sec (waveform generation)
Note this is not the theoretical maximum, which is higher, but takes into effect the current interface chip performance and system overheads. Also in PC operating systems, the memory management is based on memory pages, normally 4 kilo byte (4096 bytes). During continuous data transfer, data is allocated into these pages and different addresses have to be accessed, this slows down the process of streaming data. There is a easy way to improve this, by utilising a driver setting for the Spectrum range of high-speed cards, so raising the aforementioned transmission speeds by about 25%. Our engineers at DataQuest Solutions will be pleased to provide more information about this.
To calculate how much bus bandwidth your application will require, start by deciding the number of samples per second you wish to record, then note your preferred cards A/D or D/A converter resolution. For example to digitise a waveform with an 8 bit (1 byte) converter at 100 million samples per second, a quick estimate of the bus transfer bandwidth is simply:
At the risk of complicating things a little, in the computer world one million bytes is usually referred to as a mega byte and can be interpreted as having two values; 1,000,000 bytes, or 1,048,576 bytes
The answer is that computers work in binary and multiples thereof, so the computer mega byte is 202, which = 1024*1024 bytes, which = 1,048,576 bytes!
So if we use the computer's mega byte and modify the earlier calculation; (sample rate * converter bytes) / 1048576 we get:
In reality the first (simpler) method is fine for most scenarios, as it gives a safety margin as to how much bandwidth the interface can handle.
Logically a 16 bit converter (2 bytes) would double the resulting bandwidth and it is the same for the 12 bit or 14 bit converter, as these too need a 16 bit "word" to hold the complete digitised value. A bandwidth of around 100 mega bytes per second is well within the bandwidth capabilities of all interface types. However taking the result of using a higher resolution converter (12, 14 or 16 bits, would certainly require the capabilities of the multi-lane PCI-Express or PCI-X bus to allow constant data streaming. It is important to note that the above presumes constant streaming. It could be that all the data can fit into the cards on-board memory in which case the sampling rate can be as fast as desired, or the programmer simply set the card to capture in bursts, controlled by a repeating trigger (e,g, an external repeating pulse). These triggers can be very close together as the Spectrum cards can rearm very quickly. These times are shown in the relevant datasheets.
When data is transferred to or from a card using one the interfaces just mentioned, one of the problems is coping with the temporary effects of PC operating system "housekeeping", where it grabs priority over the card data transfer. To handle this, memory installed on the cards is used as a temporary FIFO (First In First Out) buffer, so that if a brief interruption does occur during data transfer with the PC, no loss of data will occur. This FIFO buffer holds the extra data until the card has full access again to the PC bus and memory again.
Signal capture and data transfer route to PC RAM and Hard Disk.
|Click here for more information about PCI-Express.|
|Click here for more information about PCI-X.||Print version PDF|
|DataQuest Solutions Ltd. | Phone: 01526 830387 | Email: firstname.lastname@example.org|
Images courtesy of Spectrum GmbH and modified for this article
Labview, DASYlab and LabWindows/CVI are trademarks of the National Instruments Corporation
MATLAB is a trademark of the MathWorks Corporation
© DataQuest Solutions 30.01.08. Updated 14.05.18