Main Content

exportRFBlockset

Export RF budget object to RF Blockset Model

Description

exportRFBlockset(rfobj) exports the RF budget object robj to an RF Blockset™ Circuit Envelope model.

example

exportRFBlockset(rfobj,Name=Value) exports the RF budget object to an RF Blockset model using one or more name-value arguments. For example, exportRFBlockset(rfobj,Library='IdealizedBaseband') exports the RF budget object to an RF Blockset Idealized Baseband model. (since R2025a)

example

sys = exportRFBlockset(___) returns the system name.

Note

You need an RF Blockset license to use the exportRFBlockset function.

Examples

collapse all

Create an amplifier with a gain of 4 dB.

a = amplifier(Gain=4);

Create a modulator with an OIP3 of 13 dBm.

m = modulator(OIP3=13);

Create an RF element with a gain of 10 dB.

r = rfelement(Gain=10);

Calculate the RF budget of a series of RF elements at an input frequency of 2.1 GHz, an available input power of –30 dBm, and a bandwidth of 10 MHz.

rfobj = rfbudget([a m r],2.1e9,-30,10e6);

Create RF Blockset™ model from the RF budget object.

exportRFBlockset(rfobj)

rfb1.png

Select Run from the Simulate section to run your RF Blockset model.

rfb2.png

Since R2023a

Simulate a chain of two-port elements in RF Blockset using Idealized Baseband Library blocks to take advantage of the shorter simulation times by assuming perfect impedance matching and a nominal impedance of 1 ohm.

Create an amplifier with a gain of 4 dB.

a = amplifier(Gain=4);

Create a modulator with an OIP3 of 13 dBm.

m = modulator(OIP3=13);

Calculate the RF budget of a series of RF elements at an input frequency of 2.1 GHz, an available input power of – 30 dBm, and a bandwidth of 10 MHz.

rfobj = rfbudget([a m ],2.1e9,-30,10e6);

Export the RF budget object to an RF Blockset model created using Idealized Baseband library blocks.

exportRFBlockset(rfobj,Library='IdealizedBaseband')

Click Run on the Simulate tab to run your RF Blockset model.

Since R2025a

This example shows you how to account for mismatch loss between two elements in an RF chain.

To model RF chain you can either:

  • Use the RF Budget block in your model that contains an RF chain.

  • Use the rfbudget object to generate an RF chain. Then, use the exportRFBlockset function to export your model with RF Budget block to account mismatch loss between elements in an RF chain.

This example shows you how to account for mismatch losses using the rfbudget object and export to RF Budget block using the exportRFBlockset function.

To do this:

  • First, define system parameters and construct RF elements.

  • Second, create an rfbudget object to construct an RF chain with the elements that you have designed in the first step and compute its RF budget.

  • Finally, input this rfbudget object to an exportRFBlockset function to export your model with a RF Budget block to account mismatch loss between elements in an RF chain.

Define System Parameters

Define input frequency, signal bandwidth, and input power.

fin = 4e9;
bw = 5e6;
in_dBm = -30;

Create RF Elements

Create an amplifier, n-port device, modulator, and RF filter.

a = amplifier( ...
    Gain = 31, ...
    Zin = 41+15i, ...
    Zout = 92+65i);
s = nport('passive.s2p');
m = modulator( ...
    LO = 1e9, ...
    Gain = 42, ...
    Zin = 35+89i, ...
    Zout = 79+32i);
r = rffilter( ...
    PassbandFrequency = fin+1e9-bw/2, ...
    Zin = 38, ...
    Zout = 38);

Create RF Budget and Construct RF Chain

Create an rfbudget object and calculate its RF budget.

rfobj = rfbudget([a s m r],fin,in_dBm,bw);

Export RF Chain to RF Budget Block

Simulate your RF chain using idealized baseband simulation. This allows you to analyze a cascade of mathematical models of RF components within the MATLAB® environment. Idealized Baseband System objects assume perfect impedance matching. However, by using Mismatch in the exportRFBlockset function, you can account for the mismatch loss between two elements in an RF chain in your simulation.

exportRFBlockset(rfobj,'Library','IdealizedBaseband','Mismatch',true);

Select the RF Budget block and copy it to a new Simulink® canvas. In the new canvas, click the Edit System button, and then click the Expand System button. Replace the Inport block with a 5G NR baseband input signal. Replace the Outport block with a Spectrum Analyzer block to observe the output.

open_system("mismatch.slx")

Simulate the system.

sim("mismatch.slx")
ans = 

  Simulink.SimulationOutput:
                   tout: [30721x1 double] 

     SimulationMetadata: [1x1 Simulink.SimulationMetadata] 
           ErrorMessage: [0x0 char] 

Input Arguments

collapse all

RF budget object, specified as a rfbudget object.

Note

You cannot export an RF budget object to an RF Blockset Idealized Baseband model if one of the elements in the object is an rfelement. (since R2023a)

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: Library='IdealizedBaseband'

Since R2025a

RF Blockset libraries, specified as one of the following:

  • 'CircuitEnvelope' — Export your model with Circuit Envelope library blocks to perform circuit envelope simulation. (since R2025a)

  • 'IdealizedBaseband' — Export your model with Idealized Baseband library blocks to perform idealized baseband simulation. (since R2023a)

Since R2025a

Model impedance mismatch loss between idealized baseband elements and export the RF chain into an RF Budget block, specified as logical false(0) or true(1).

Dependencies

To set this name-value argument, you must first set Library='IdealizedBaseband'.

Version History

Introduced in R2017a

expand all