Main Content

Acquire I/Q Data from Vector Signal Transceiver Using NI-RFSA Instrument Driver

This example shows how to connect to a simulated NI PXIe-5841 Vector Signal Transceiver (VST) and acquire a finite amount of I/Q data from it.

Connect to Instrument

Connect to a simulated VST instrument using the ividev function. For this example, specify the driver name as niRFSA, the resource name as PXI1Slot2, and the IVI driver setup name-value argument as Model:5841. Alternatively, you can leave the resource name unspecified ("") for simulated hardware. The driver setup is also optional. If you do not specify a name-value argument for the driver setup, ividev uses default setup values. For more information about default argument values, see ividev.

dev = ividev("niRFSA", "PXI1Slot2", Simulate=true, DriverSetup="Model:5841")
dev = 
  niRFSA with properties:

                    Model: "NI PXIe-5841" 
             Manufacturer: "National Instruments" 
             SerialNumber: "" 
             ResourceName: "PXI1Slot2" 
             VendorDriver: "niRFSA" 
                 Simulate: 1 

               ChannelIDs: "0" 
          FIFOEndpointIDs: "FIFOEndpoint0" 
            UserSourceIDs: "usersource0" 

                 Vertical: [1x1 Vertical] 
               SignalPath: [1x1 SignalPath] 
              Acquisition: [1x1 Acquisition] 
                 Clocking: [1x1 Clocking] 
                 Triggers: [1x1 Triggers] 
                   Events: [1x1 Events] 
    DeviceCharacteristics: [1x1 DeviceCharacteristics] 
               PeerToPeer: [1x1 PeerToPeer] 
        ConfigurationList: [1x1 ConfigurationList] 
    InherentIVIAttributes: [1x1 InherentIVIAttributes] 
              Deembedding: [1x1 Deembedding] 
          SelfCalibration: [1x1 SelfCalibration] 
       FactoryCalibration: [1x1 FactoryCalibration] 
        ExternalAlignment: [1x1 ExternalAlignment] 
           DeviceSpecific: [1x1 DeviceSpecific] 
          AcquisitionType: IQ 

Show all functions

Configure Acquisition Properties

Configure the VST to acquire IQ data on channel "0" . For single channel devices, you can leave the channel specified (""). Set the following parameters to the specified value:

  • Reference clock — onboard clock

  • Acquisition type — I/Q data

  • The reference level — 0 dB

  • Carrier frequency — 1 GHz

  • Acquisition rate — 1 MHz

Explore different options by using tab completion in the Live Editor.

ch = "0";
configureRefClock(dev, "OnboardClock", 1e7);
configureAcquisitionType(dev, "IQ");
configureReferenceLevel(dev, ch, 0);
configureIQCarrierFrequency(dev, ch, 1e9);
configureIQRate(dev, ch, 1e6);

Acquire Finite Number of Samples

Acquire 1000 samples of I/Q data from channel "0" and additional information about the acquired waveform.

finiteSamples = true;
numSamples = 1000;
configureNumberOfSamples(dev, ch, finiteSamples, numSamples);
[data, waveformInfo] = readIQSingleRecordComplexF64(dev, ch, 10, numSamples);

Extract Waveform Information

Extract information related to the plot from the waveform information.

t0 = waveformInfo.relativeInitialX;
tincr = waveformInfo.xIncrement;
n = double(waveformInfo.actualSamples);
t = t0 + tincr.*(0:n-1);

Plot Acquired Samples

Display the I data and Q data in related subplots and indicate the average power across a simulated load of 50 ohms.

R = 50; % ohms
dBm = 10*log(1000*abs(data)/(2*R));

subplot(2,1,1)
plot(t, real(data))
title(compose("Average power = %.2f dBm", mean(dBm)));
ylabel("I data")
subplot(2,1,2)
plot(t, imag(data))
ylabel("Q data")
xlabel("time(s)")

Clean Up

Disconnect and clear the ividev object from the workspace.

clear dev

See Also

| |

Related Topics