Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: May 7, 2008

Perform RF Streaming Successfully

0 ratings | 0.00 out of 5
Print | PDF

Overview

This document discusses RF streaming recording and playback as well as best practices for increasing signal integrity.

Perform RF Streaming Successfully

Overview

In the following document, several details about the hardware and software are analyzed to achieve best performance with the National Instruments RF Products.

At the end of this document, example code specific to each section will be also presented to facilitate integration of record and playback systems.

We assume the reader is already familiar with the streaming process in PXI. For new streaming users we recommend to read all the whitepapers from the following link since this document will specifically discuss RF record and playback systems considerations.

Introduction to Streaming http://zone.ni.com/devzone/cda/tut/p/id/6355

RF Record and Playback Systems

The ideal RF Record and Playback system can be modeled by:

p(t) = r(t) = s(t)

Where

s(t) is the signal we are trying to record

r(t) is the recorded signal

p(t) is the play-back signal

Since we are not working with perfect situations, the previous equation can be expressed as:

p(t) = r(t) + ns(t) = s(t) + n(t) + i(t)

Where

ns(t) is the system noise (acquisition and generation device)

n(t) is the environment noise

i(t) is the environment interference

This document will highlight some specific software/hardware implementations that will help you maximize correlation between p(t) and s(t). Even if some of the parameters are applicable to many RF systems, the system we refer to is the following:

Figure 1: System description. The NI PXI-5661 is composed of the NI PXI-5600 Downconverter and the NI PXI-5142 Digitizer. The NI PXIe-5672 is composed of the NI PXI-5610 Upconverter and the NI PXIe-5442 Arbitrary Waveform Generator.

 

Maximizing Dynamic Range

In this section we will address the dynamic range of the record and playback system. We will start with the dynamic range of the recorded signal and then finish with the dynamic range of the playback signal.

In this section we are most interested on the dynamic range of the NI PXI-5661 Vector Signal Analyzer (VSA). The NI PXI-5600 has larger dynamic range and therefore the digitizer dynamic range will define the dynamic range of the entire RF record and playback system.

Recording

The PXI-5142 IF Digitizer is 14 bits and we need to make sure we utilize every single bit. The input range is 2 Vpp when used with the PXI-5600 as a PXI-5661 and the NI-RFSA driver. The driver is designed for best distortion performance and therefore the approximated headroom (for crest factor) given by the driver is 10 dB.

 When recording the signal, we would like to minimize the headroom as much as possible so that we use full dynamic range of the digitizer. This is not a trivial task for modulated and burst signals since their power varies in time. Any prior knowledge of the input signal is very helpful since we can then adjust the headroom to optimize the dynamic range of the digitizer.  Ideally, the headroom should be the crest factor of the signal. However, the target signal may be in the presence of other  unwanted signals that will affect the recording. These signals will be called n(t) for noise and i(t) for interference.

We must first consider the bandwidth of the target signal s(t) and the target hardware we are using. If the hardware bandwidth is exactly the one of*Brian* s(t), then the SINAD will be much less than the SINAD of hardware with much larger bandwidth. This is further explained below.

Looking at the input path of the PXI-5661 recording device:

Figure 2: Path followed by the signal at record time

 

The power of the input signal s(t) + n(t) + i(t) will be limited by the fixed 20 MHz internal input bandwidth of the PXI-5600 regardless of the user requested bandwidth.  This can be seen in the PXI-5600 RF input path on Figure 3

Figure 3: Simplified block diagram of the NI PXI-5600 Downconverter

 

Once the IF signal is digitized, the OSP on the PXI-5142 will filter the section requested by the driver and the desired signal will be isolated in the recorded signal.

For example, let’s assume s(t) is an FM radio station signal at 91.5 MHz. By specification, this signal is 200 kHz wide. Let’s also assume that there are other radio stations across the 20 MHz bandwidth at varying power levels as shown in Figure 4

Figure 4: Example spectrum of the FM radio band

 

The input power at the RF input on the PXI-5600 will be the power of the entire 20 MHz band and not the power of s(t). This will affect the dynamic range of the recording since you will have to account for these larger signals:

 

Figure 5: Use of the dynamic range on the digitizer without any front end filtering.

 

To improve performance in this situation, we can use an external bandpass filter to isolate the signal of interest like is shown on Figure 6

Figure 6: Use of the dynamic range on the digitizer with front end filtering. The full dynamic range of the signal is digitized.

 

Since it is challenging to predict these unwanted signals in the spectrum, calculate the input power with precision, and set the exact reference level, we suggest using a test application to visualize these parameters and then set the correct recording parameters. We can do this by setting the reference level of the NI VSA much higher than the power of the acquired signal and then decrease the reference level until the ADC of the digitizer overflows. We then increase the reference level by a few dB to allow some headroom for small signal variations when recording.

National Instruments has created an example to visualize what is about to be recorded  (Set RFSA Record Settings.vi). This example contains an indicator of how saturated the ADC is. The code can be found below.

Datatype of Recorded Signal

The recorded waveform is the baseband representation of the passband signal. This is also referred to as the complex envelope or IQ data. The data can be saved in any format but in order to stream the data to disk, we need to be able to keep up with the acquisition speed. This is why the examples use the 16-bit raw Little-Endian format (byte-ordering based on processor architecture).  No other processing is performed on the data.

The IQ data is interleaved like this:

I0, Q0, I1, Q1, I2, Q2….. In, Qn

Where n is the number of acquired samples.

 Playback

The challenge in a record and playback system is reproducing the recorded signal at the same level at which it was recorded. This might be useful when we want to test the UUT in the lab under the same conditions that would be present in the field.

The following parameters are needed to playback an RF Signal using the NI-RFSG driver:

-          IQ Rate [S/s]

-          Carrier Frequency [Hz]

-          Output Peak Power [dBm]

We need information about the recording to obtain these values. If there is no information about the recording available, there is neither a reference of sampling speed nor power and therefore the recording cannot be reproduced accurately.

There are two important values used in the RFSA driver that will help us determine the correct output conditions:  Carrier Frequency and Waveform Information

To get the Carrier Frequency use the NI-RFSA property node to get the correct value.

Figure 7: How to get the exact niRFSA center frequency value

 

To get the Waveform Information, read the “wfm info” output parameter from the niRFSA_Fetch_IQ.vi.  Note that you must be using the “1D I16” instance of the polymorphic VI to have access to the “wfm info” cluster.

Figure 8: When Fetching raw binary data, the cluster named “wfm info” will be very useful to translate those numbers back into useful units.

Using the ”wfm info” cluster we can find the following parameters:

-          IQ Rate = 1/dt.

-          Waveform Info.Gain will be used in Analysis to convert from I16 data to Volts. This value will also be used to calculate the Peak Output Power in RFSG using the following formula:

 

Peak Power = 20*log((32767*Gain)/(10^-0.5))                   (1)

10^-0.5 is the result of translating 0 dBm to Vpeak.

National Instruments has example code to help make the record and playback architecture easier.

Figure 9: Portion on the Example code where we calculate the Peak Power. Part of “RF Header File.vi”

The attached code  creates a header XML file when a file is recorded. This XML file contains all these parameters required by the NI-RFSG driver. The attached example also makes use of this header to regenerate the signal as close to the original conditions as possible.

Digital Gain (Optional)

National Instruments NI-RFSG driver has two modes for configuring output power:

Average Power

Average power indicates the desired power averaged in time. The driver maximizes the dynamic range by scaling the IQ waveform so that its peak magnitude is equal to one.

Peak Power

Peak Power indicates the maximum power level of the RF signal averaged over one period of the RF carrier frequency (the peak envelope power). This setting requires that the magnitude of the IQ waveform must always be less than or equal to one. When using Peak Power, the power level of the RF signal matches the specified power level at moments when the magnitude of the IQ waveform equals one.

The default mode for NI-RFSG is Average Power but in streaming applications we need to set this property to Peak Power due to the fact that the file is too large to rescale the data.

If we have some knowledge of the maximum power value in the waveform, we can set the RFSG digital gain to maximize the dynamic range of the arbitrary waveform generator by rescaling the data so that its peak magnitude is close to one.

To get an approximate value of the required gain, you can use the Recording Configuration Test Panel (included with the examples below). Before recording, this program estimates the maximum acquired power and provides the gain that will be needed when the data is generated.

When  recording, the NI  PXI-5661 has 10 dB attenuation steps coercing the headroom to an amplitude that may be too high. One way to reduce the coarse attenuation is to change the digitizer  vertical range. The Recording Configuration Test Panel (included with the examples below) also lets the user set this parameter before recording.

Even after changing the digitizer  vertical range, the recorded I16 data has less headroom and will not use the full range possible, as seen in the example below .

Figure 10: Binary raw data usage of recorded data.

 

 Hence, your generation will not to use the full dynamic range of the DAC when regenerating the data. To bring the I16 data closer to the full range without post-processing the data, we can use the RFSG Digital Gain.

 

Figure 11: Use the OSP gain to use the full generation dynamic range.

 

For the PXI-5671 and PXI-5672 you need to obtain the FGEN session and use the CIC gain. This gain is commonly used to compensate for attenuation in the FIR filter. For this reason you will need to query the gain before writing the desired gain. The examples below also show this process.

The use of digital gain is actually a better practice than using the formula in Equation 1.

This is because the higher power we generate, the higher the signal’s noise density is. Ideally, we would like to have the parameter “Output Peak Power” the same as the “Input Reference Level”. This will assure that we use full dynamic range in both acquisition and generation.

The attached code is also able to calculate the correct digital gain, record it into the same header file but is not using it by default on the generation.

Figure 12: Part of the Example code where we record to file recording settings. Part of “Configure & Record data.vi”

Conclusions

We have seen how to use the recording parameters to ensure that the playback signal, p(t), represents the recorded signal,  r(t) as close  as possible.

This system, as any other, introduces some extra noise to the recording which is a cumulative of quantization noise (input and output) and cable loss (input and output).

 

Resources

What do I need to start programming my RF record and playback custom solution?

RF Record and Playback Reference Application

RF Record and Playback Reference Application

Components included:

  •  Configure record settings to maximize dynamic range:  Set RFSA Record Settings.vi
  •  Save record parameters on a XML header file:  RF Header File.vi
  •  Simple NI PXI-5661 Record:  niRFSA Simple Record.vi
  •  Simple NI PXIe-5672 Playback:  PXIe Simple Playback.vi
  •  Load, save and manage the header file:  RF Header File.vi

Test Panel

Record and Playback Test Panel. (This is not intended to be used as a reference application):

 

Streaming Documents

Alliance Solutions and Applications

 

0 ratings | 0.00 out of 5
Print | PDF

Reader Comments | Submit a comment »

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).