Está en la página 1de 143

Lesson 8.

2
NI-RFSA

Comfortably use driver to acquire data through SFP and API.


Given set of parameters or known signal, know how to acquire
Spectrum mode decision matrix and proper settings

A. Soft Front Panel


B. Basic Configuration
C. Acquisition Types
D. Triggers and Events
E. List Mode
F. Synchronization

15 ni.com

15
RFSA : What is your quest?
 RF Signal Acquisition
 Control PXI VSA
 Two Modes
 Spectral
 Basic SpecAn with no measurements
 IQ
 Think SCOPE for RF
 Sample Rate
 Input Range
 Triggering

 Does NO analysis
 Only delivers data

16 ni.com

• The primary quest of RFSA is RF signal acquisition – we are acquiring the data, not doing
any processing on it, yet!

16
Kick the tires, and light the fires! - RFSA Getting Started
 Has traditional SpecAn layout and
NI-RFSA Soft Front Panel options

 No IQ mode or demodulation

 Some features not available in RFSA


API
Makes traditional SpecAn users
feel all warm and fuzzy.  Performs some measurements

 Limited ability to debug already


initialized session

17 ni.com

• NI is not a box instrument company, we excel at automated measurements


• The RFSA SFP makes new customers that are used to using boxes feel more comfortable
moving to our platform
• Also, this a great getting started and debugging tool

17
RFSA SFP Survival Guide
 Primary Control Set
 90% of functionality under these 6
 Menu System
 Dynamic menu for setting configuration
 Markers = Cursors
 But you can’t sniff cursors
 Triggering Options
 Think like a oscilloscope
 System Configuration
 Choose Target HW
 Big Green Return to Safety Button

18 ni.com

• The SFP was built to mimic the typical GUI found on a traditional spectrum analyzer
• Existing SpecAn users should feel comfortable navigating the UI

18
RFSA SFP Survival Guide

 Device & Type

 Reference Level

 Frequency Range
 Start / Stop OR Center / Span

 Acquisition Settings

 Multiple Traces

19 ni.com

• Whenever requesting screen shots from a customer, make sure they always include the
acquisition settings box at the bottom

19
Exercise 8.2.1
Play with the RFSA SFP

Open the Generate Random Waveform executable from the exercise folder and run it.
Try to find the RF signal and display it properly.
Can you identify the signal?

20 ni.com

• Skip this exercise if the class is already familiar with the RFSA SFP

20
Why Use RFSA API?
Spectral Analysis
• Spurs
• Occupied BW
• Channel Pwr.
• Etc.

Getting Raw RF Data to


Continue Processing

Time Domain Analysis


• Modulation Accuracy
• Power vs. Time
• Streaming
• Etc.

21 ni.com

• There are two modes of RFSA, IQ and Spectrum


• The uses for each one will depend on the application or measurement to be made
• Unlike some other box instruments, no measurement processing happens on the
instrument itself – we rely on the host for that

21
RFSA API Flows

Center
Spectrum Frequency RBW Fetch
& Span

Spectrum
Initialize Reference Reference
Triggering* or Close
Session Clock Level
IQ?

Carrier Sample Acquisition


IQ Fetch
Frequency Rate Length

* Trigging spectrum acquisitions has some caveats


that will be discussed later in the presentation

• This diagram gives a high level flow of the API


• It should be clear to see the commonalities and differences in using IQ/Spectrum modes

22
RFSA API Getting Started

 Depending on HW, certain features


possible / restricted

 User explicitly chooses Spectral or IQ


mode

 Spectral mode is nice but restricts


usage of HW/Driver features
 Performs multiple acquisitions in
background

23 ni.com

• RFSA was designed to be compatible with all NI VSAs (exception some legacy devices,
like the 5660)
• With that in mind, some properties in RFSA are only supported by some instruments

23
Center
Comparing the API Flows Frequency RBW Fetch
& Span

Spectrum

Close
Initialize Reference Reference
Session Clock Level

IQ

Carrier Sample Acquisition


Fetch
Frequency Rate Length

24
Initializing the Instrument Session

 Opens RFSA session to the instrument

 Only one session per instrument can be open


at a time

 Option string allows for advanced settings


 Specify FPGA bitfile
 Enable SFP access
 etc.

25 ni.com

25
Choosing the Acquisition Type
 Simple enumeration specifies the acquisition type
 What is your quest?

26 ni.com

26
Setting the Reference Clock

 Defaults to the instrument onboard clock

 Other clock sources can be selected

 Most common options are Onboard Clock,


RefIn, and PXI_CLK

27 ni.com

27
RFSA Basic Configuration

 For both IQ and Spectrum types, you will almost always want to configure:

Center Frequency Reference Level

28 ni.com

28
RFSA Basic Configuration

 For the IQ acquisition type, you will almost always want to configure:

Bandwidth Acquisition Length

29 ni.com

29
RFSA Basic Configuration

 For the spectrum acquisition type, you will almost always want to configure:

Span
30 ni.com

30
Starting and Stopping an Acquisition

Aborts any running acquisitions.

31 ni.com

31
Exercise 8.2.2
Getting started with the RFSA API

Setup “Getting Started [IQ / Spectrum].vi” to acquire signal found in exercise 8.2.1.

32 ni.com

32
Configuring Sample Rate to set Bandwidth
 Analyzer bandwidth is determined by:
 Analog Bandwidth
 Anti-aliasing Filter
 OSP Digital Filters
 Some analyzers use fractional resampling to
specify IQ rate
 Front end ADCs always run at full rate
 The flat part of the filter is 80% of the bandwidth
 Canon law is to configure the IQ rate = 1.25 * 80%
Bandwidth
 Sample Rate = IQ Rate

10% 10%
33 ni.com

• The 1.25x rule only applies to NI instrumentation – other instrumentation may be


different

33
Exercise 8.2.3
Calculate IQ Rate

What is the minimum IQ rate required to capture a 10MHz wide signal?

34 ni.com

10 × 1.25 = 12.5 /

34
RFSA IQ Acquisition Types
 A record is a collection of samples
 Can configure RFSA for single record or multiple record acquisitions
 Records have configurable lengths
 Can configure RFSA records for finite or infinite length
 Different combinations of numbers of records and samples per record result in
different acquisition types

Sample Streaming Record Streaming Single Record Multi-Record


Number of Records 1 Infinite 1 Multiple
Samples per Record Infinite Finite Finite Finite
Acquisition Type Continuous Continuous Single Shot Finite Continuous

35 ni.com

• There are a few different ways to set up the instrument to acquire the data you need
• Figuring out what method to use requires some decision making on the programmers
part to decide how they want the data formatted and what is the best approach for the
application in question

35
Scenario
Choosing Acquisition Type

“I need to acquire some RF bandwidth and log it to a RAID drive. I plan to analyze the data offline later. I’m
thinking that I will need to acquire data for about 5 minutes. Don’t worry, I’m not capturing a very wide
bandwidth.”

Sample Streaming Record Streaming Single Record Multi-Record

36 ni.com

• Have the class choose which one they would use.

36
RFSA Sample Streaming
 One record of infinite size
 Can’t have multiple records if you are
acquiring infinite samples per record

 Start and reference triggers can be used


to start acquisition
 Analyzer will not listen for any more triggers
after the first reference trigger
Parameter Value
“number of samples is finite” false
 User intervention is required to abort
samples per record ignored
acquisition

 Fetch fast and often! – Overflow hazard


37 ni.com

• In sample streaming, the VSA acquires IQ samples forever until told to stop
• There is no concept of multiple records here

37
Scenario
Choosing Acquisition Type

“I’m writing an application that continuously acquires and plots some time and frequency domain data. I’d like
for the user to be able to configure it to use a digital edge or power edge trigger. The application should run
forever until told to stop by the user.”

Sample Streaming Record Streaming Single Record Multi-Record

38 ni.com

• Have the class choose which one they would use.

38
RFSA Record Streaming
 Multiple records of finite size

 New record is captured at the reference


triggers
Parameter Value
 Start trigger can be used to start acquisition “number of records is finite” false
number of records ignored

 User intervention is required to abort


acquisition

 Fetch fast and often! – Overflow hazard

Parameter Value
“number of samples is finite” true
samples per record >0
39 ni.com

• It is also possible to have an immediate reference trigger, which means that the analyzer
will acquire data in chunks without waiting on a reference trigger

39
Scenario
Choosing Acquisition Type

“I’ve noticed, by using my Record Streaming application, that occasionally some unknown signal is showing up
in my spectrum. I’d like to set up my analyzer to capture this signal to I can gain some insight on what it
might be. I need to be able to reduce my bandwidth and capture it once when it shows up.”

Sample Streaming Record Streaming Single Record Multi-Record

40 ni.com

• Have the class choose which one they would use.

40
RFSA Single Shot Acquisition
 One record of finite size

 Start and reference triggers can be used


to start acquisition
Parameter Value
“number of records is finite” true
 Analyzer stops after the record is acquired number of records 1

 This is the default acquisition type

 Specify the number of samples to acquire


with “niRFSA Configure Number of
Samples” Parameter Value
“number of samples is finite” true
samples per record >0
41 ni.com

• This is a very commonly used acquisition


• Typically we have some trigger that is known, such as digital or power edge, that we use
to capture a signal of interest

41
Scenario
Choosing Acquisition Type

“My DUT is generating a bursty signal. I’d like perform some averaging with some measurements that I am
performing on the burst. I’d like to specify the number of averages I need. It would also make my life a lot
easier if each waveform shared the same reference point.”

Sample Streaming Record Streaming Single Record Multi-Record

42 ni.com

• Have the class choose which one they would use.

42
RFSA Multi-Record Acquisition
 Multiple records of finite size

 New record is captured at the reference


triggers Parameter Value
 Start trigger can be used to start acquisition “number of records is finite” true
number of records >1

 Analyzer stops after the last record is


acquired

 Specify the number of samples to acquire


per record with “niRFSA Configure
Number of Samples” Parameter Value
“number of samples is finite” true
samples per record >0
43 ni.com

• A good use case for this acquisition type is for averaging

43
Configuring Acquisition Length
 RFSA wants the acquisition length in terms of samples

 Use the actual IQ rate to specify acquisition length in time

 Customers are used to using time and you should get used to it too

44 ni.com

• It is almost always easier to think about acquisition time in terms of seconds rather than
number of samples, especially since the sample rate can change

44
Exercise 8.2.4
Filter Roll-off

Characterize the filter roll-off by sweeping the passband of an analyzer across a tone.

{go to next slide}

45 ni.com

45
Exercise 8.2.4
1. Open the exercise VI already provided for you
2. Fill in the areas marked with #student
3. Generate a pure tone with the RFSG SFP
4. Run the VI - The final graph should resemble the graph below

Questions:
 What is actually happening here?

 Does the flat part of the passband


match our bandwidth / sample rate claim?
 Is that consistent across bandwidths?

 How could this VI be improved?

46 ni.com

46
Triggering with RFSA
 Trigger types:
 Start
 Reference
 Advance

 Trigger sources:
 Digital
 Software
 IQ Power Edge
The “None” trigger type can be used
 Trigger VI is polymorphic to disable previously configured triggers.

47 ni.com

• We will discuss each trigger type in a little more detail

47
Trigger Types Explained
 Start Trigger
 Starts the analyzer
 If no reference trigger is specified, a record is captured immediately
 Happens only once per initiate

 Reference Trigger
 Specifies when to capture a record
 Can come from a power edge, digital edge, or software edge
 Only trigger that allows ‘pre-trigger samples’ to be acquired

 Advance Trigger
 Specifies when the analyzer should prepare to capture another record
 Think “advance to the next record”
 Prevents another reference trigger to be armed until advance trigger met

48 ni.com

48
IQ Power Edge Triggers
 Triggers the device when the RF power passes a set threshold

 Edge can be either rising or falling

49 ni.com

49
Additional Triggering Parameters
Edge of interest Edge of interest
 Minimum Quiet Time
 Reference trigger is not rearmed until
there are no reference events in the

What we care about

What we care about


specified time window

Trigger Level

 Trigger Delay
 Amount of time the analyzer waits to
assert a trigger event after it occurs
 Can also be negative

Multiple points crossing trigger level

50 ni.com

• Minimum quiet time is useful for signals that have a lot of power fluctuation since these
signals can assert the power edge trigger at an undesirable time

50
Additional Triggering Parameters

 Pretrigger Samples
 Specifies number of samples to acquire
before the reference event

 Trigger Holdoff
 Amount of time the analyzer stops
listening for triggers after a trigger
event occurs

51 ni.com

51
Scenario
Choosing a Trigger Type and Source

“I have a bursty signal. I need to acquire the data that lies 1ms and 3ms after the start of the burst.”

Start Reference Advance


Digital Software Power Edge
52 ni.com

52
Scenario
Choosing a Trigger Type and Source

“I have a 6570 set up to send several MIPI-RFFE commands to my FEM. I want my analyzer to acquire data
after I send each burst of commands. I have an event exported from my 6570 to the PXI backplane.”

Start Reference Advance


Digital Software Power Edge
53 ni.com

• It’s possible a start trigger could have been used if only 1 record was needed.

53
Discussion
Choosing a Trigger Type and Source

What other scenarios can you think of and what kind of trigger would they need?

Start Reference Advance


Digital Software Power Edge

54 ni.com

54
RFSA Events

 Physical signals that can be exported


from the instrument

 Typically occur during state


transitions within the instrument

 Most useful for synchronization

55 ni.com

• It is easiest to think of events as signals that are asserted by the instrument and triggers
as signals that the instrument listens for
• The state diagram will be covered in a few slides

55
Routing Signals
 Triggers and Events can be exported to various terminals
 Front facing PFI lines
 PXI backplane

56 ni.com

56
RFSA State Diagram
5668R Specific State Diagram

Less commonly used


“Arm Reference Trigger”

“Found in RFSA Help File”


57 ni.com

• Some devices don’t have a state diagram, namely the VST 1


• While it is mostly safe to assume the VST follows the same state diagram as the others,
caution should be used
• Always verify behavior if you are not sure

57
Retrieving the Acquired Data
 There are two options for retrieving data, reading and fetching
 Which one to use depends on the application

Read
Fetch
58 ni.com

• Most often, fetch is used over read

58
Reading vs. Fetching

Read Fetch

Intrinsic call to RFSA Initiate. This RFSA Initiate must be invoked


means a new record will be fetched manually

Blocks until record is available or Blocks until record is available or


timeout timeout

Allows multiple records to be fetched


Single record fetching only
at multiple times

Fetches entire records only Supports fetching subsets of records

59 ni.com

59
Reading vs. Fetching Continued
In both examples below, the same number of records will be fetched

Required Initiate

Analyzer never stops running Analyzer stops and restarts every


This will be the faster option iteration of the loop

• Read is provided as a convenience and should only be used for Single Shot acquisitions
• Every read can be replaced with Initiate + Fetch

60 ni.com

• Now is a good time for the instructor to talk about this topic more in depth.

60
Interpreting the Fetched Data
 The complex cluster has the following attributes:
 x0 – Time of the first sample relative to the trigger in seconds
 dt – Sample interval in seconds
 Y – Complex data array of I and Q

 I and Q are in volts


 The magnitude of I and Q is the envelope of the carrier in volts peak
 0dBm = 0.32Vp

 Calculating power from I and Q:

+ 50
= = 10 log = 20 log + + 10
2 1

61 ni.com

61
Exercise 8.2.5
Multi-Record Acquisition

Practice triggering with multi-record acquisition in loopback

{go to next slide}

62 ni.com

Ideally, they should set max sample rate in IQ mode since it’s a fast rising edge
They should experiment to get the number of points which shows the noise, rising and top
of the signal w/ out overwhelming the memory of the system (IOW don’t capture 100M
samples and try to display them)
They might have to wrestle with the timeout on the fetch.
They should use the SFP to determine frequency and threshold levels
Pre-trigger samples might trip them up since they need to use a property node

62
Exercise 8.2.5
1. Open the exercise VI already provided for you
2. Fill in the areas marked with #student
3. Generate a signal with the RFSG SFP
4. Capture the rising edge of a signal by switching the RF on/off in the SFP

 Questions, Notes, Observations


 If the rising edge is going to happen really really fast, how much relative BW is that?
 If I desire to see a rising edge, but that implies that I would want to see the signal
before and after the trigger for a nominal period of time without taking too many
samples
 Don’t ignore the inputs of the fetch (hint: Record #)
 If you are going to run ‘fetch’ FOR 3 records…what kind of loop should that fetch be
in?

63 ni.com

63
RFSA List Mode
 Allows for hardware timed sequencing of RFSA properties
 Center Frequency, Reference Level, etc.

Set No
More
Create List Create Step Done
Properties Steps?

Yes
64 ni.com

64
RFSA List Mode Behaviors

 Control sequencing of list steps with the advance trigger


 Analyzer will pause at a step until an advance trigger is received
 If no advance trigger is used the analyzer will automatically advance

 Analyzer will return to the beginning of the list after the last step
 The number of records you capture determines how many steps you use
 Control when to stop sequencing by specifying the number of records to capture

 List mode always starts at the first step


 Currently no support for starting at a specified list step

65 ni.com

65
Execise 8.2.6
RFSA List Mode

Repeat exercise 8.2.4 using list mode.

{go to next slide}

66 ni.com

66
Exercise 8.2.6
1. Open the exercise VI already provided for you
2. Fill in the areas marked with #student
3. Generate a pure tone with the RFSG SFP
4. Run the VI - The final graph should resemble the default XY graph

Questions:
 What is actually happening here?

 How does that differ than what we were


doing before?
 How could this VI be improved?

67 ni.com

• One way this VI could be improved would be to move the power calculation to a
separate thread.

67
RFSA Property Node
 Some low level and advanced properties are accessed via property nodes
 Common properties to use:
 Center Frequency Offset

68 ni.com

68
Where Does the Data Go?
 RFSA data is cached in memory and can be fetched multiple times

 RFSA is NOT measurement software

 Feed the IQ or Spectral data to other measurement algorithms for analysis


 RFmx
 Modulation Toolkit
 Spectral Measurement Toolkit
 etc.

 Log to disk

69 ni.com

69
More on RFSA Streaming
 IQ data is stored in memory as “raw” data

 Data has to be scaled during a fetch


 Slows fetching down!

 Another option is the fetch the raw data and


scale it later
 Faster!

 RF streaming applications typically involve the


FPGA
 One example is spectral monitoring (Real Time
Spectral Analysis)

70 ni.com

70
RFSA Synchronization
 Always have the options to
synchronize with triggers and events

 Most VSAs support TCLK

 VST 1 doesn’t support TCLK


 VST 2 does support TCLK

 RFSA help details how to manually


perform TCLK synchronization with
VST1

71 ni.com

71
Useful Utility VIs

 Commit
 Commits hardware configuration to the
device

 Reset
 Resets all settings to their defaults

72 ni.com

72
Useful Utility VIs
 Check Acquisition Status
 Check for hardware errors and whether the acquisition is complete

73 ni.com

73
Closing the Session
 RFSA Close
 Releases RFSA session.

 Easy!

74 ni.com

74
Benefits of Spectrum Mode over IQ
 Spectrum can always be calculated from the IQ data
 So why use Spectrum mode in the first place?

 Removes the extra hassle of converting to frequency domain if we don’t need


time domain data

 Spectrum mode performs some neat tricks, such as LO leakage avoidance and
spur dodging
 This also makes it incompatible with certain features such as list mode

 Spectrum mode allows the RBW to be specified, which is an otherwise extra


step when converting to frequency domain from the time domain

75 ni.com

75
Choosing Your Quest
So, how should you decide which RFSA mode to use?
Question If yes, then..
Do I need time domain data? IQ
Do I need advanced triggering or
IQ
synchronization?
Do I need to perform streaming? IQ
Am I using the acquired data with a Depends on what the toolkit wants!
toolkit or measurement suite? Most likely IQ
Do I need to use list mode? IQ

If you answered no to any of these questions, then Spectrum mode might work for you!
Not all applications are created equally, though.

76 ni.com

76
RFSA Summary: Just like the rest of PXI … ish

 Same old stuff:  It’s a special snowflake:


 Quite possible to overwhelm backplane
 Close the handle, lose all settings with data
 Like turning power off and on for a box  1GHz BW = 5GBytes/sec!!

 Receive and send PXI backplane  Certain RFSA targets have missing or
triggers custom properties/functions
 VST is a super special snowflake
 Don’t forget to route in MAX
 Multi-mode driver can be confusing on
 Can receive and export triggers when to use what
 Very similar to scope trigger system  What if I want a triggered spectrum?

 Installing RFSA will also install RFSG


 Why? VSAs use a CW Generator as the LO.

77 ni.com

77
RFSA Help
Great resource for all things VSA and RFSA

“C:\Program Files (x86)\IVI Foundation\IVI\Drivers\niRFSA\documentation\English\nirfsa.chm”

78 ni.com

• When in doubt, refer to the help

78
Questions?

79 ni.com

79
Lesson 8.3
NI-RFSG

Comfortably use the RFSG driver to generate RF waveforms.

A. Soft Front Panel


B. General Configuration
C. Generation Modes
D. Managing Memory
E. Triggers and Events
F. RFSG Playback Library

80 ni.com

80
RFSG : What is your quest?
 RF Signal Generation
 Control PXI VSG and CW
 Three Generation Modes
 CW
 Single tone generation
 Arb Waveform
 IQ waveforms
 Multiple waveforms / wfm segments
 Script
 All Arb Waveform functionality
 Wfm linking and looping with (script)
triggers for dynamic signal generation Generating RF Waveforms
 Hardware and software script triggers

81 ni.com

81
RFSG Getting Started

 NI-RFSG Soft Front Panel

 Intuitive, interactive GUI for RF signal


generation
Makes traditional CW/VSG users
 CW, multitone, analog modulation, feel all warm and fuzzy
and IQ waveform files

 Simple frequency and power sweeps

82 ni.com

82
RFSG SFP Survival Guide
 Primary Controls
 Frequency / Power / Output Enabled

 Menu System
 Dynamic menu for setting configuration

 Arb Wfm and Multitone


 Upload an IQ file or configure multitone

 Analog Modulation
 Configure an AM/FM/PM signal

 System Configuration
 Choose Target HW
 Big Green Return to Safety Button

83 ni.com

83
Exercise 8.3.1
Play with the RFSG SFP

Generate a two tone signal and an AM-modulated sine wave.

Observe the RF output with an analyzer using the RFSA SFP.

84 ni.com

• Skip this exercise if the class is already familiar with the RFSG SFP

84
RFSG Session Control

85 ni.com

85
Initializing and Closing a Session
 Only one session per instrument can be open at a time

86 ni.com

86
Initialize With Options

 Simulate hardware
 “Simulate=True”

 Specify an external Arb / LO


 “DriverSetup=LO:<external>”

 Specify a bitfile for an FPGA


extension
 “DriverSetup=Bitfile:path.lvbitx”

87 ni.com

87
Reset
 Use to return the hardware to a known state

Similar to “rewinding” the session to just after Similar to closing the session and re-opening it
niRFSG Initialize.vi with “reset device” option set to true

88 ni.com

88
Scenario
Configuration Overhead

“I’ve noticed that initiating generation on my box generator takes less time to complete than your PXI
generator. Is there a way to reduce the time from configuration to generation?”

89 ni.com

89
Commit

 Pushes the configuration to the


instrument

 Occurs any time a property is read

 Use during the initialization part of a


test routine to remove hardware
configuration overhead during test
time

90 ni.com

90
RFSG Generation Control

91 ni.com

91
Starting and Stopping Generation

Moves the generator from the Moves the generator from the running
configuration state to the running state state to the configuration state
92 ni.com

92
Scenario
Turning Off the Output

“I have a switching network and I’d like to turn off the output of my signal generator while changing my switch
paths. I was told that this is a good idea since hot switching can result in power reflected back into my
generator, possibly damaging it. Is there a faster way other than aborting generation and starting it again?”

93 ni.com

93
Turning the Output On and Off

 When set to false, attenuates the


output

 Some very low power signal may still


be present at the output if currently
generating

 Calling abort and turning off the


output is best guarantee to no power
at the output

94 ni.com

94
RF Blanking
Good blanking locations
 Enable or disable the output via
hardware timing

 Useful for when you need to have


silent times in an arbitrary waveform

 An RFSG Marker Event is used to


control the output state of the
generator

95 ni.com

• This is an advanced topic that is introduced slightly early

95
RFSG Generation Modes

96 ni.com

96
Scenario
Generating a Pure Tone

“I’d like to use my brand new NI vector signal generator to generate a CW. How should I configure the driver?”

97 ni.com

97
Generating CW

98 ni.com

98
Generating CW

Set the generation mode to CW

99 ni.com

99
Generating CW – What else is happening?

Poll the instrument for errors

100 ni.com

100
Exercise 8.3.2
RFSG CW Mode

• Use the RFSG Getting Started Single Tone example and view in the RFSA SFP.
• Extend the example to allow the frequency of the CW to be changed from the Front Panel while the
code is running.
• Further extend the example to allow the output to be turned on and off from the FP while the VI runs.
• Generation should not stop unless the stop button is pressed. Validate your code with the RFSA SFP.

101 ni.com

• Students should remove the wait statement and add an event structure with a timeout
to the while loop.
• When the center frequency control is changed, set the frequency property of RFSG.
• Add a control to turn output on and off. Handle button presses in a new event case.
• Good practice would be to add an event case for the stop button as well – see solution.

101
Scenario
Generating an Arbitrary Waveform

“My company has some modulated waveforms that we have developed. I’d like to play them out of my new NI
vector signal generator in our test script. Can you show me how?”

102 ni.com

102
Arbitrary Waveform Generation – Ready the Data
 First step will always be to make sure the complex waveform data is available
in one of the NI accepted formats
 Complex array
 Complex cluster
 Complex waveform
 Individual I-Q arrays
 Interleaved I16

 IQ rate will also need to be known

103 ni.com

103
Arbitrary Waveform Generation – Knowing Your Generator

 Minimum waveform size

 Maximum waveform size

 Maximum number of waveforms

 Waveform Quantum
 Integer number
 The size of the waveform must be a
multiple of this number

104 ni.com

104
Arbitrary Waveform Generation – Setting the IQ Rate

 There is not a VI for setting the IQ


Rate in RFSG

 RFSG assumes you will provide the


IQ Rate in the Complex Cluster or
Complex Waveform Types

105 ni.com

105
Arbitrary Waveform Generation – Setting the IQ Rate

 There is not a VI for setting the IQ


Rate in RFSG

 RFSG assumes you will provide the


IQ Rate in the Complex Cluster or
Complex Waveform Types

 IQ Rate can be set manually via a


property node as well

106 ni.com

106
Arbitrary Waveform Generation – Resampling
 Generator will coerce IQ rate to a value that it can achieve
 Will always be greater than or equal to requested value
 The requested IQ rate vs. actual IQ rate might be different!
 If requested and actual are different the actual bandwidth of the signal will be
different than expected – see lesson 2
 Solution is to resample the waveform
 Beware! The algorithms in these VIs may introduce undesired artifacts

107 ni.com

107
Arbitrary Waveform Generation – Writing to Instrument

 RFSG Write Arb Waveform


 Accepts multiple data structures
 Polymorphic
 Waveforms can be given a name for
use with other features, namely scripts

 Complex Cluster and Waveform


variants default to using dt
 Watch out for this!

108 ni.com

• Too often this input is overlooked and the actual IQ rate of the generator will be
different than you expected

108
Configuring the Bandwidth

 Does not actually cause any filtering


to be performed in hardware

 Is used to optimally set the Center


Frequency to minimize phase noise

 You won’t use this VI in most cases

109 ni.com

109
Arbitrary Waveform Generation

110 ni.com

110
Arbitrary Waveform Generation

Set the generation mode


to Arb Waveform

111 ni.com

111
Arbitrary Waveform Generation

Write the waveform


to the instrument

112 ni.com

112
Arbitrary Waveform Generation

Poll the instrument for errors

113 ni.com

113
Exercise 8.3.3
RFSG Arbitrary Waveform Mode

Create an arbitrary waveform that chirps a single tone up and down in frequency.
View the signal with the RFSA SFP.
#todo: provide waveform in the form of a csv file

114 ni.com

Signal from 0 Hz for 10 us.

114
Scenario
Dynamic Generation

“I’d like to generate a more complex sequence of waveforms. For instance, I need to generate a pure tone
followed by an arbitrary waveform. I need this sequence to continue forever until told to stop.”

115 ni.com

115
Scripting script
repeatingwavefrm
 Allows for advanced waveform sequencing
 Text based configuration generate
waveform0

repeat until
scripttrigger0

generate
waveform1

generate
waveform2

end script
See the NI-FGEN training for a detailed review of scripting.
116 ni.com

116
Scripting Basics
 generate <Waveform Name>
 Generates the named waveform
 “generate myModulatedWaveform”

 repeat <# of times or “forever”>


 Repeats the nested commands until the
“end repeat” statement
 “repeat 3”
 “repeat forever”
Generates two waveforms in sequence until
 end <“script” or “repeat”> the abort VI is called.
 Specifies the end of a “script” or
“repeat” statement

117 ni.com

117
NI Script Editor

 Tool for developing scripts for use


with FGEN / RFSG

Very useful if you forget what scripting commands are available

118 ni.com

118
Building a Decision Framework
 Before doing anything you will almost always want to configure:
 Center Frequency
 Power Level

119 ni.com

119
This is where you choose your quest..

Simple
Moderate
Advanced
120 ni.com

120
Which RFSG Generation Mode?

CW
RF Carrier
Sine tones only

Arb Waveform
Modulated RF Carrier(s)
IQ waveform arrays

Script
Modulated RF Carrier(s)
IQ waveform arrays
with playback ‘script’ Dynamic wfm changes, adv triggers

121 ni.com

121
Which RFSG Power Level Type?
 How to translate IQ samples to RF power?
 IQ data written to RFSG with polar magnitude ≤ 1.0

 RFSG Power Level Type defines how IQ magnitude is interpreted

 Average Power
 RFSG will autoscale IQ data to maximize DAC dynamic range
 User simply uploads waveform, configures desired output average power

 Peak Power
 RFSG won’t autoscale IQ data
 User controls correct combination of IQ sample magnitude and Power Level attribute
 Required for Script generation mode
122 ni.com

122
Peak Power vs Average Power

Peak Power

Average Power

Peak to Average Power Ratio = Peak Power – Average Power = 10dBm – 3.909 = 6.091dB

123 ni.com

123
Peak Power Adjustment

 Allows the power of the waveform to be expressed as average power while the
generator is in peak power mode

 Will set the actual peak power to the average power + PAPR

124 ni.com

124
Waveform Runtime Scaling
 In order to avoid DSP overflow in waveforms with high PAPR, headroom needs
to be applied to the waveform beforehand
 Two ways this is accomplished:
1. Keep the waveform as is and use the RFSG Pre-filter Gain property
2. Apply the headroom in software (only works for peak power mode!)

1.5dB

Peak to average power ratio hasn’t changed,


but the average power is now lower!
125 ni.com

125
Peak Power Adjustment with Headroom
 Use Peak Power Adjustment to set the actual peak power to the average power
+ PAPR + Headroom

 Or, just normalize the waveform to +/- 1 and use Pre-filter Gain

126 ni.com

126
Exercise 8.3.4
Peak Power Mode

Create and generate a CW that sweeps up and down in power.


Have controls for max power, min power, and sweep time.
Don’t forget we are in a log scale!
Validate with the RFSA SFP in zero span mode.

127 ni.com

Signal from 0 Hz for 10 us.

127
Managing RFSG Waveform Memory

128 ni.com

128
Managing Waveform Memory

 Waveform memory can be allocated ahead of time


with the Allocate Arb Memory VI

 Allows data to be written to the device in chunks by


specifying “more data pending” during writes

129 ni.com

129
Managing Waveform Memory

 Waveforms can be deleted from the device by


specifying the waveform name to delete
 Beware of memory fragmentation

 Alternatively, all waveforms can be removed from


the device’s onboard memory

130 ni.com

130
Managing Waveform Memory

 RFSG allows you to choose which


waveform to generate if more than
one is in memory
 Select Arb Waveform VI

131 ni.com

131
RFSG Triggers and Events

132 ni.com

132
Triggering with RFSG

 Trigger Types:
 Start
 Script
 Configuration Step

 Trigger Sources
 Software
 Digital Edge
 Digital Level
The “None” trigger type can be used
to disable previously configured triggers.
 Trigger VI is polymorphic

133 ni.com

133
Software Edge Triggers
 Ties a trigger to an event that is invoked in software

 Can be used as a Start Trigger or tied to a specific Script Trigger

134 ni.com

134
Digital Level Triggers

 Invokes a trigger when a digital line is


in either a high or low state

 Use case: Switch generation on and


off using external relay

135 ni.com

135
Script Triggers
 Allow hardware triggers to be applied to script logic

Generates wfm1 until a trigger occurs on


PXI_Trig0, then generates wfm2

Tie the hardware trigger to a script trigger

scriptTrigger0
136 Waveform finishes before moving to the next ni.com

• Note that in this scenario the waveform finishes generation before switching to the next
waveform.

136
Other RFSG Triggers

 Start Trigger
 Starts the generator
 Happens only once per initiate

 Configuration Step Trigger


 Used in conjunction with list mode
 Allows for hardware control of list sequencing

137 ni.com

137
Scenario
Choosing Trigger Type and Source

“I need to generate a CW until my generator receives a trigger on the backplane, at which point it needs to
switch to generating a modulated waveform.”

Start Script Configuration Step


Software Digital Edge Digital Level
138 ni.com

138
Scenario
Choosing Trigger Type and Source

“I’ve set up a configuration list on my generator to sweep frequency and power level. I’d like for the generator
to wait until my analyzer is ready to acquire the data. I’m going to export a ready event from my analyzer.”

Start Script Configuration Step


Software Digital Edge Digital Level
139 ni.com

139
Scenario
Choosing Trigger Type and Source

“I’d like for my generator to start generating when I press a button on the Front Panel of my LabVIEW
Application.”

Start Script Configuration Step


Software Digital Edge Digital Level
140 ni.com

140
Discussion
Choosing Trigger Type and Source

What other scenarios can you think of and what kind of trigger would they need?

Start Script Configuration Step


Software Digital Edge Digital Level
141 ni.com

141
Script Markers
 Allows hardware events to be invoked by the script
 Markers events occur at the specified sample number
 “generate myWaveform marker(3)”
 Generates myWaveform with a marker event at sample 3

Sample Clock Updates Tell the driver where


to export the marker

Ch0 Output

4 Samples
PFI 0 (marker)
Marker Pulse Width

142 ni.com

142
More Advanced Scripting Commands
 Wait – Wait for an event to occur or for a number of sample clock cycles to
elapse
 “wait until scriptTrigger0”, “wait 32”

 Clear – Clear previously asserted scriptTrigger


 “clear scriptTrigger0”

 If/Else – Basic flow control


 “if scriptTigger0”

 Break – End execution of sequence when trigger occurs


 “break on scriptTrigger0”

143 ni.com

143
Exercise 8.3.5
Scripting with RFSG

Use scripting to allow you to switch between two arbitrary waveforms by pressing a button on a
LabVIEW front panel. Try switching between single tone generation and multitone generation.

144 ni.com

144
RFSG List Mode
 Allows for hardware timed sequencing of RFSG properties
 Center Frequency, Power Level, etc.
 Steps:
 Create configuration list specifying which properties to sequence
 Add a list step
 Set aforementioned properties to desired values
 Can step through a list with the help of the RFSG Configuration Step Trigger
 Generator will loop through the list until finished
 List mode always starts at the first step
 Currently no support for starting at any list step

145 ni.com

145
List Mode Example

 Create configuration list


 Specify names and properties

 Loop
 New configuration list step
 Set defined properties

146 ni.com

146
Configuration Step Triggers

 Provides control over when the


generator advances to the next list
step

 The step trigger can come from


various places, including the script!

147 ni.com

147
Exercise 8.3.6
List Mode

Using RFSG CW mode, sweep the frequency between two arbitrary frequency points using list mode. View
the behavior in the RFSA SFP. Use the RFSG timer event to configure the dwell time at each step.

148 ni.com

148
RFSG Playback Library

149 ni.com

149
RFSG Playback Library Basics
 Instrument abstraction built on top of RFSG for easier waveform playback
 Most of the functions require the RFSG handle as input

 Interfaces easily with waveforms created with RFmx Waveform Creator (tdms)

 Parses the tdms header for waveform properties, such as sample rate,
headroom, etc.

150 ni.com

150
RFSG Playback Library Example

• Most of the same stuff we’re already used to


• Initialize, set sample rate and center frequency
• Initiate and poll for instrument errors
• Disable and close session
151 ni.com

151
RFSG Playback Library Example

Write the waveform to


the generator from file

152 ni.com

152
RFSG Playback Library Example

Specify which waveform


to generate

153 ni.com

153
Exercise 8.3.7
RFSG Playback Library

Synthesis and save a TDMS waveform from the RFmx Waveform Creator.
Using the RFSG Playback Library, load the waveform into LabVIEW and view it with the RF probes.
Using the RFSG Playback Library, play the waveform with the generator and validate with RFSA SFP.

154 ni.com

154
RFSG: Just like the rest of PXI … ish
 Same old stuff  It’s a special snowflake

 Close the handle, lose all settings  Quite possible to overwhelm backplane
 Like turning power off and on for a box with data
 1GHz BW = 5GBytes/sec!!
 Receive and send PXI backplane
triggers  Certain RFSG targets have missing or
 Don’t forget to route in MAX custom properties/functions
 VST Scripting capabilities have limitations
on complexity
 Can receive and export triggers  2 level nested loop
 Very similar to fgen trigger system  Etc.

155 ni.com

155
Questions?

156 ni.com

156
Exercise 8.3.8
RFSA and RFSG Synchronization

Modulate a signal and synchronize RFSA and RFSG to transmit the signal from the generator to the
analyzer.

157 ni.com

157

También podría gustarte