This document analyzes NI RF hardware and software to help you achieve the best performance. It also contains example code specific to each section to help you integrate record and playback systems.
This document specifically examines RF record and playback system considerations. If you are not familiar with RF record and playback basics, refer to the Introduction to Streaming white papers.
2. RF Record and Playback Systems
The ideal RF record and playback system can be modeled by:
p(t) = r(t) = s(t)
s(t) is the signal you are trying to record
r(t) is the recorded signal
p(t) is the playback signal
Because you are not working with perfect systems, you can express the previous equation as:
p(t) = r(t) + ns(t) = s(t) + n(t) + i(t)
ns(t) is the system noise (acquisition and generation device)
n(t) is the environment noise
i(t) is the environment interference
This document highlights some specific software/hardware implementations to help you maximize the correlation between p(t) and s(t). Even if some of the parameters are applicable to many RF systems, you will need to reference the following two systems:
Figure 1. 2.7 GHz System Hardware: 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. The modules are controlled by an NI PXI-8106 embedded controller in an NI PXI-1065 18-slot hybrid PXI Express chassis.
Figure 2. 6.6 GHz System Hardware: The NI PXI-5663 is composed of the NI PXI-5601 downconverter, the NI PXI-5652 local oscillator module, and the NI PXI-5622 IF digitizer. The NI PXI-5673 is composed of the NI PXI-5611 downconverter, the NI PXI-5652 local oscillator module, and the NI PXI-5450 I/Q arbitrary waveform generator. The modules are controlled by an NI PXI-8130 embedded controller in an NI PXI-1075 18-slot PXI Express chassis.
3. Maximizing Dynamic Range
Because the dynamic range of the PXI-5661 signal analyzer is constrained by the 14-bit PXI-5142 IF digitizer, it is important to condition the input signal for optimum performance as it enters the digitizer. The input range of the digitizer is set to 2 Vpp when used with the PXI-5600 as a PXI-5661 and the NI-RFSA driver. Likewise, in the 6 GHz system, the dynamic range of the PXI-5663 is determined by the 16-bit PXI-5622 IF digitizer. Its input range can vary from 0.7 to 1.4 Vpp. In normal operation, the driver is designed for best distortion performance; therefore, the approximated headroom (for crest factor) given by the driver is 10 dB.
When recording the signal, minimize the headroom as much as possible so that you use the full dynamic range of the digitizer. This is not a trivial task for modulated and burst signals because their power varies in time. Any prior knowledge of the input signal is helpful so you can then adjust the headroom to optimize the dynamic range of the digitizer. Ideally, the headroom should be equal to the crest factor of the signal. However, the target signal may be in the presence of other unwanted signals that can affect the recording. These signals are called n(t) for noise and i(t) for interference.
First, consider the bandwidth of the target signal s(t) and the target hardware you are using. If the hardware bandwidth is exactly the bandwidth of s(t), then the SINAD is higher than the SINAD of hardware with much larger bandwidth. This is further explained below.
Looking at the input path of the PXI-5661 RFSA:
Figure 3. Path Followed by the Signal at Record Time
The power of the input signal s(t) + n(t) + i(t) is limited by the fixed 20 MHz internal input bandwidth of the PXI-5600 regardless of the user-requested bandwidth. You can see this in the PXI-5600 RF input path on Figure 4:
Figure 4. Simplified Block Diagram of the NI PXI-5600 Downconverter
Once the IF signal is digitized, the onboard signal processor (OSP) on the PXI-5142 filters the section requested by the driver, and the desired signal is isolated in the recorded signal.
For example, assume s(t) is an FM radio station signal at 91.5 MHz. By specification, this signal is 200 kHz wide. Also assume that there are other radio stations across the 20 MHz bandwidth at varying power levels as shown in Figure 5:
Figure 5. Example Spectrum of the FM Radio Band
The input power at the RF input on the PXI-5600 is the power of the entire 20 MHz band, not just the power of s(t). This affects the dynamic range of the recording because you have to account for these larger signals.
Figure 6. Using the Dynamic Range on the Digitizer without any Front-End Filtering
To improve performance in this situation, you can use an external bandpass filter to isolate the signal of interest, as shown in Figure 7:
Figure 7. Using the Dynamic Range on the Digitizer with Front-End Filtering: The full dynamic range of the signal is digitized.
Because it is challenging to predict these unwanted signals in the spectrum, calculate the input power with precision, and set the exact reference level, you should use a test application to visualize these parameters and then set the correct recording parameters. You can do this by setting the reference level of the NI vector signal analyzer much higher than the power of the acquired signal and then decrease the reference level until the analog-to-digital converter (ADC) of the digitizer overflows. Then increase the reference level by 2 to 3 dB to allow some headroom for small signal variations when recording. If your signal has a much higher peak-to-average ratio, increase the reference level even higher.
In the Record and Playback Reference Application, you have a VI (Set RFSA Record Settings.vi) that contains an indicator showing the saturation of the ADC.
Data Type of Recorded Signal
The recorded waveform is the baseband representation of the passband signal, also known as the complex envelope or I/Q data. You can save the data in any format, but, to stream the data to disk at high rates, you must minimize the amount of processing applied to the data during recording. For this reason, the examples store the data as an array of signed 16-bit integers. This is the format in which the data is stored in the digitizer memory; the only processing is simply copying the data from the digitizer to PC memory.
The I/Q data array is interleaved like this:
I0, Q0, I1, Q1, I2, Q2….. In, Qn
Where n is the number of acquired samples.
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 you want to test the unit under test (UUT) in the lab under the same conditions that would be present in the field.
You need the following properties to play back an RF signal using the NI-RFSG driver:
- I/Q rate [S/s]
- Carrier frequency [Hz]
- Output peak power [dBm]
You need information about the recording settings to obtain these values. If you do not have information about the settings, you have neither a reference of sampling speed nor power and, therefore, you cannot reproduce the recording accurately.
Two important values used in the RFSA driver can help us determine the correct output conditions: carrier frequency and waveform information.
To obtain the carrier frequency, use the NI-RFSA Property Node to get the correct value, as shown in Figure 8:
Figure 8. Obtaining 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, as shown in Figure 9:
Figure 9. When fetching raw binary data, the cluster named “wfm info” helps you translate those numbers back into useful units.
Using the “wfm info” cluster, you can find the following parameters:
- I/Q rate = 1/dt
- Waveform Info
Gain is used in analysis to convert from I16 data to volts. You also use this value to calculate the peak output power in RFSG using the following formula:
10^-0.5 is the result of translating 0 dBm to Vpk.
National Instruments offers example code to help make the record and playback architecture easier to navigate.
Figure 10. Portion of the Example Code Where Peak Power Is Calculated – Part of RF Header File.vi
The attached code creates a header XML file when a file is recorded. This XML file contains all of the 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)
The National Instruments NI-RFSG driver has two modes for configuring output power:
Average power: Indicates the desired signal power averaged in time. The driver maximizes the dynamic range by scaling the I/Q waveform so that its peak magnitude is equal to one.
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 I/Q 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 I/Q waveform equals one.
The default mode for NI-RFSG is average power, but in record and playback applications, you need to set this property to peak power due to the fact that the file is too large to rescale the data.
If you have some knowledge of the maximum power value in the waveform, you can set the RFSG digital gain to maximize the dynamic range of the arbitrary waveform generator (AWG) by rescaling the data in the AWG OSP 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 you need when the data is generated. In the Record and Playback Reference Application, this information is stored in the XML header file.
The PXI-5661 has attenuation adjustable in 10 dB steps. When recording, this may coerce the reference amplitude to a value that is too high. One way to compensate for this is to change the digitizer vertical range. With the Recording Configuration Test Panel (included with the examples below), the user can set this parameter before recording.
Even after changing the digitizer vertical range, the recorded I16 data might not use the full dynamic range, as seen in Figure 11.
Figure 11. Binary Raw Data Usage of Recorded Data
Hence, your generation does not use the full dynamic range of the digital-to-analog converter (DAC) when regenerating the data. To bring the I16 data closer to the full range without postprocessing the data, you can use the RFSG digital gain.
Figure 12. With the OSP gain, you can use the full-generation dynamic range.
For the PXI-5671 and PXI-5672, you need to obtain the FGEN session and use the controller-in-charge (CIC) gain. This gain is commonly used to compensate for attenuation in the finite impulse response (FIR) filter. For this reason, you 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 the power you generate, the higher the signal’s noise density is. Ideally, you want to have the parameter “Output Peak Power” be the same as the “Input Reference Level.” This ensures that you use full dynamic range in both acquisition and generation.
The attached code is also able to calculate the correct digital gain and record it into the same header file, but the code is not using the digital gain by default on the generation.
4. Storing RF Metadata
As mentioned above, you must use several properties of a recorded signal to accurately reconstruct the signal for playback. In the supplied code, these properties are stored in an XML header file. The following is a list of the properties stored in the header file as well as their use:
Waveform Info: This cluster is automatically generated by the niRFSA driver when fetching raw data. It contains the scaling information that the driver typically uses to return I/Q samples. Its contents are:
- Absolute Timestamp: This timestamp contains the absolute time of the first sample in the waveform in seconds. You can use it to compare start times between acquisitions.
- Relative Timestamp: This timestamp contains the difference in time between the first sample returned and the reference trigger location.
- dt: Time between samples. The inverse of this value is the I/Q sampling rate.
- Actual Samples Read: The actual number of I/Q samples in the returned data.
- Offset and Gain: Raw binary data from the RFSA is scaled to I/Q data using a linear scale of the form y = mx + b, where b is the Offset property and m is the Gain property. The RFSA driver accommodates for any attenuation by the downconverter or change in vertical range, so you can simply multiply each data point by the Gain value and add it to the Offset value to convert the data to volts.
- Reference Level: The RFSA acquisition reference level is stored in the file. However, you can more accurately determine the absolute power level of the signal by using the Gain property in the Waveform info cluster, so that is used for playback power level.
- Digital Gain for RFSG: As mentioned above, you can use the RFSG digital gain to compensate for a recorded signal that does not use the full dynamic range of the RFSA. The value is computed in the record program and stored here in the file.
- I/Q Rate: Although you can calculate the I/Q rate from the dt property of the Waveform info, it is stored here for convenience.
- Full Scale Reference Level: This property is calculated from the Gain property of the Waveform info cluster. It represents the absolute power level of a point in the signal whose magnitude is at the full range of the digitizer. For accurate signal reproduction, use this property as the generation power level.
- SMT Zoom Settings: The fast Fourier transform (FFT) settings for previewing the recorded signal in the included configuration utility are stored in this property. The Center Frequency property is used to configure the center frequency of the RFSG.
In the included code, the header file is accessed using a functional global VI (RF Header File.vi) to set and get properties. Figure 12 shows an example of setting several properties with that VI.
Figure 13. Part of the Example Code Where You Record to File Recording Settings – Part of the Configure & Record data.vi
The following is a list of RF Header File.vi functions.
- Init: Sets all properties stored inside the VI to an initial value. Currently all initial values are 0.
- Set Carrier Frequency: Sets the Center Frequency property of SMT Zoom Settings to the input value. Use this function only if the entire SMT Zoom Settings property is not being set.
- Set Waveform Information: Accepts the Waveform Info cluster from niRFSA Fetch I16 and stores it inside the VI. This function also sets the Full Scale Reference Level property based on the waveform gain, and it sets the I/Q Rate property based on the inverse of the dt property.
- Set Reference Level: Sets the Reference Level property. There is no corresponding “get” function for the Reference Level property in this VI because the Full Scale Reference Level property is actually used to set the generation power level.
- Set Digital Gain: Sets the Digital Gain property in the VI.
- Set SMT Parameters: Use this function to store the SMT Zoom Settings cluster used to configure the NI Spectral Measurements Toolkit.
- Save File: Takes the property values stored in the VI and writes them to the specified XML file path.
- Read File: Reads property values from an XML file and stores them in the VI for retrieval.
- Get I/Q Rate: Retrieves the I/Q Rate property.
- Get Full Scale Reference Level: Retrieves the Full Scale Reference Level property. Use this property to set the power level for generation.
- Get Digital Gain: Retrieves the Digital Gain property.
- Get Carrier Frequency: Retrieves the Center Frequency from the SMT Zoom Settings property.
- Get Gain: Retrieves the Gain property from the Waveform Info cluster. This is not necessary for generation, but you can use it to scale raw data to real units for analysis.
- Get SMT Settings: Retrieves the entire SMT Zoom Settings cluster.
You have seen how to use the recording parameters to ensure that the playback signal, p(t), represents the recorded signal, r(t), as closely 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).
RF Record and Playback Reference Application
- 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
Record and Playback Test Panel (This is not intended to be used as a reference application.)
Record and Playback Documents
NI Alliance Partner Solutions and Applications