rfsystem
Perform circuit envelope simulation of RF system designed using
rfbudget
Description
Use the rfsystem
System object™ to perform circuit envelope simulation of
an RF system designed using an rfbudget
object. You
can use the rfsystem
object to generate an RF Blockset™ model. This object
supports vector inputs and has no frame-size limits.
Note
You can add or delete RF Blockset blocks to this model but you cannot modify the parameters of Inport and Outport blocks. After this update, the input
rfbudget
object to therfsystem
will be preserved and you can inspect thisrfbudget
object using the RF Budget Analyzer app.
To perform circuit envelope simulation of an RF system:
Create the
rfsystem
object and set its properties.Call the object with arguments, as if it were a function.
To learn more about how System objects work, see What Are System Objects?
Creation
Description
creates a System object from the RF system rfs
= rfsystem(rfb
)rfb
. Use the System
object, rfs
, to perform circuit envelope simulation.
The System object generates an untitled RF Blockset model of the RF system. Use Object Functions to open, save, close, or hide the RF Blockset model.
sets Properties using name-value
arguments. For example, rfs
= rfsystem(rfb
,Name=Value
)rfsystem(rfb,'ModelName'='rfmodel')
sets the
name of the RF Blockset model to rfmodel
.
Properties
Unless otherwise indicated, properties are nontunable, which means you cannot change their
values after calling the object. Objects lock when you call them, and the
release
function unlocks them.
If a property is tunable, you can change its value at any time.
For more information on changing property values, see System Design in MATLAB Using System Objects.
'ModelName'
— Name of RF Blockset model
'untitled'
(default) | string scalar | character vector
Name of the RF Blockset model, specified as a string scalar or character vector.
Example:
'ModelName','RFModel'
'InputFrequency'
— Input frequency
rfb.InputFrequency'
(default) | row vector
Input frequency applied to each input of the RF system, specified as a row vector in
Hz. This input frequency is derived from the RF system designed using an
rfbudget
object. Your RF system will have two inputs, I and Q, at
DC if the rfb.InputFrequency
is set to 0
.
Note
You can set InputFrequency
to be a vector if you want to
investigate the intermodulation of nearby signals going through the same
architecture after construction of the rfsystem
system
object.
'OutputFrequency'
— Output frequency
rfb.OutputFrequency(:,end)'
(default) | row vector
Output frequency to be computed at the output of the RF system, specified as a row
vector in Hz. This output frequency is derived from the RF system designed using an
rfbudget
object. Your RF system will have two outputs, I and Q, at
DC if the value of the rfb.OutputFrequency
is
0
.
'SampleTime'
— Time step for circuit envelope simulation
1/rfb.SignalBandwidth/8
(default) | positive scalar
Time step for circuit envelope simulation, specified as a positive scalar. This property sets the step size between simulations.
'Rx'
— Number of input chains
1
(default) | positive scalar
Number of input chains in a multiple-input single-output receiver system, specified as a positive scalar.
Note
You can set:
Either the
'Rx'
or the'Tx'
property when creating the System object.'Rx'
property only when creating the System object.
'Tx'
— Number of output chains
1
(default) | positive scalar
Number of output chains in a single-input multiple-output transmitter system, specified as a positive scalar.
Note
You can set:
Either the
'Rx'
or the'Tx'
property when creating the System object.'Rx'
property only when creating the System object.
'SLInputs'
— Number of optional Simulink inputs
0
(default) | positive scalar
Number of optional Simulink® inputs, specified as a positive scalar. The Simulink inputs are added as Inport (Simulink) block in the model.
By default, the Signal Type parameter in the Simulink
Inport blocks is set to complex
. To change
this complex signal to real, either add a Complex to Real-Imag (Simulink) block to your model, or in the Simulink
Inport block, on the Signal Attributes tab set
the Signal Type parameter real
.
'SLOutputs'
— Number of optional Simulink outputs
0
(default) | positive scalar
Number of optional Simulink outputs, specified as a positive scalar. The Simulink outputs are added as Outport (Simulink) blocks in the model.
By default, the Signal Type parameter in the Simulink
Outport block is set to complex
. To change
this complex signal to real, either add a Complex to Real-Imag (Simulink) block to your model, or in the Simulink
Inport block, on the Signal Attributes tab set
the Signal Type parameter real
.
'RFInputs'
— Number of RF inputs
nonnegative scalar
This property is read-only.
Number of RF inputs implemented as RF Blockset Inport blocks in the generated model, returned as a nonnegative scalar. The value of this property depends on the 'Rx' property and the first value in the 'InputFrequency' row vector.
'RFOutputs'
— Number of RF outputs
nonnegative scalar
This property is read-only.
Number of RF outputs implemented as RF Blockset Outport blocks in the generated model, returned as a nonnegative scalar. The value of this property depends on the 'Tx' property and the last value in the 'OutputFrequency' row vector.
Usage
Syntax
Description
creates
an RF Blockset circuit envelope simulation output out
= rfs(in
)out
using input
signal values in
. Pass in
as an input argument
to an automatically-generated RF Blockset model.
You can design four architectures, RF to RF, DC to RF, RF to DC, and DC to DC, using
the rfsystem
object. For more information, see Design RF-RF, IQ-RF, RF-IQ, and IQ-IQ Architectures.
Note
Passing multiple input vectors and concatenating the output vectors is equivalent to performing one long simulation with a vertically-concatenated input.
Input Arguments
in
— Time-domain input signal
column vectors
Time-domain input signal, specified as column vectors. Specify
in
as an array of N column vectors when
there are N
'InputFrequency' values.
If 'RFInputs' >
1
, 'SLInputs' >
1
, and both, then the inputs are passed to the step
method as arguments out =
rfs(RFin1,RFin2,...,SLin1,SLin2,...)
.
Output Arguments
out
— Time-domain output signal
column vectors
Time-domain output signal, returned as column vectors. out
is
returned as an array of N column vectors when there are
N
'OutputFrequency' values to be computed.
If 'RFOutputs' >
1
, 'SLOutputs' >
1
,and both, then the outputs are returned by the step
method is [RFout1,RFout2,...,SLout1,SLout2,...] =
rfs(in)
.
Object Functions
To use an object function, specify the
System object™ as the first input argument. For
example, to release system resources of a System object named obj
, use
this syntax:
release(obj)
Specific to rfsystem
open_system | Open RF Blockset model created using
rfsystem
|
save_system | Save RF Blockset model created using rfsystem
|
close_system | Close RF Blockset model window created using
rfsystem
|
hide_system | Hide RF Blockset model window created using
rfsystem
|
load_system | Load RF Blockset model to memory |
RF Budget Analyzer | Analyze gain, noise figure, IP2, and IP3 of cascaded RF elements and export to RF Blockset |
Examples
Perform Circuit Envelope Simulation on RF Receiver
Design an RF receiver to perform circuit envelope simulation.
Create fifth- and seventh-order bandpass RF filters.
f1 = rffilter('ResponseType','Bandpass','FilterOrder',5, ... 'PassbandFrequency',[4.85 5.15]*1e9); f2 = rffilter('ResponseType','Bandpass','FilterOrder',7, ... 'PassbandFrequency',[10 130]*1e6);
Create two amplifier objects with 3
dB and 5
dB gain, respectively.
a1 = amplifier('Gain',3,'NF',1.53,'OIP3',35); a2 = amplifier('Gain',5,'NF',8,'OIP3',37);
Create a modulator with a local frequency of 4.93
GHz.
d = modulator('Gain',0,'NF',4,'OIP3',50,'LO',4.93e9, ... 'ConverterType','Down');
Design an RF receiver with the budget elements at an input frequency of 5
GHz, an available input power of -30
dBm, and a bandwidth of 200
MHz.
rfb = rfbudget([f1 a1 d f2 a2],5e9,-30,200e6);
Create an RF system for the RF receiver using the rfbudget
object.
rfs = rfsystem(rfb);
Specify input time-domain signal for the RF system.
in = [1e-3*ones(8,1); zeros(8,1)] .* ones(1,10); in = in(:);
Calculate the output time-domain signal of the RF system.
out = rfs(in); out = [out; rfs(in)];
Specify the sample time of the RF system.
t = rfs.SampleTime*(0:length(out)-1);
Plot the simulated output.
plot(t,[in; in],'-o',t,abs(out),'-+') grid on
Release system resources and turn off fast restart.
release(rfs)
Open an RF Blockset model of the designed RF system using the open_system
object function.
open_system(rfs)
Design RF-RF, IQ-RF, RF-IQ, and IQ-IQ Architectures
Design four different chain architectures using an RF System object.
Create an input column vector.
in = (1:8)';
Design RF-RF Architecture
Create an rfbudget
object using an amplifier
object.
a = amplifier;
Calculate the RF budget of the amplifier at an input frequency of 5
GHz, an available input power of –30
dBm, and a bandwidth of 10
KHz.
rfb = rfbudget(a,5e9,-30,10e3);
Create an RF system using the rfbudget
object.
rfs = rfsystem(rfb);
Create an RF-RF architecture using the input column vector.
out0 = rfs(in);
Release system resources and turn off fast restart.
release(rfs)
Open an RF Blockset model of the RF system.
open_system(rfs)
Design IQ-RF Architecture
Use a modulator
object with an up converter to create an rfbudget
object.
u = modulator('ConverterType','Up','LO',1e9);
Calculate the RF budget of the modulator at an input frequency of 0
GHz, an available input power of –30
dBm, and a bandwidth of 10
KHz.
rfb2 = rfbudget(u,0,-30,10e3);
Create an RF system using the rfbudget
object.
rfs2 = rfsystem(rfb2);
Create an IQ-RF architecture using the input column vector.
inI = in; inQ = in; out = rfs2(inI,inQ);
Release system resources and turn off fast restart.
release(rfs2)
Open an RF Blockset model of the RF system.
open_system(rfs2)
Design RF-IQ Architecture
Use a modulator
object with a down converter to create an rfbudget
object.
d = modulator('ConverterType','Down','LO',1e9);
Calculate the RF budget of the modulator at an input frequency of 1
GHz, an available input power of –30
dBm, and a bandwidth of 10
KHz.
rfb3 = rfbudget(d,1e9,-30,10e3);
Create an RF system using the rfbudget
object.
rfs3 = rfsystem(rfb3);
Create an RF-IQ architecture using the input column vector.
[outI,outQ] = rfs3(in);
Release system resources and turn off fast restart.
release(rfs3)
Open an RF Blockset model of the RF system.
open_system(rfs3)
Design IQ-IQ Architecture
Create an rfbudget
object using an amplifier
object.
a1 = amplifier;
Calculate the RF budget of the amplifier at an input frequency of 0
GHz, an available input power of –30
dBm, and a bandwidth of 10
KHz.
rfb4 = rfbudget(a1,0,-30,10e3);
Create an RF system using the rfbudget
object.
rfs4 = rfsystem(rfb4);
Create an IQ-IQ architecture using the input column vector.
[outI2,outQ2] = rfs4(inI,inQ);
Release system resources and turn off fast restart.
release(rfs4)
Open an RF Blockset model of the RF system.
open_system(rfs4)
Model MISO Receiver and SIMO Transmitter Systems
Create a fifth-order bandpass RF filter.
f1 = rffilter('ResponseType','Bandpass','FilterOrder',5, ... 'PassbandFrequency',[4.85 5.15]*1e9);
Create an amplifier with 3 dB gain.
a1 = amplifier('Gain',3,'NF',1.53,'OIP3',35);
Create a modulator with a local frequency of 4.93 GHz.
d = modulator('Gain',0,'NF',4,'OIP3',50,'LO',4.93e9, ... 'ConverterType','Down');
Create a seventh-order bandpass RF filter.
f2 = rffilter('ResponseType','Bandpass','FilterOrder',7, ... 'PassbandFrequency',[10 130]*1e6);
Create another amplifier with a 3 dB gain.
a2 = amplifier('Gain',5,'NF',8,'OIP3',37);
Design an RF receiver with the budget elements at an input frequency of 5 GHz, an available input power of –30 dBm, and a bandwidth of 200 MHz.
b = rfbudget([f1 a1 d f2 a2],5e9,-30,200e6);
Duplicate the budget chain into a multiple-input single-output receiver (MISO) system with four branches.
rfs = rfsystem(b,Rx=4);
Open the underlying RF system model to inspect the MISO receiver
open_system(rfs)
set_param(bdroot,'ZoomFactor','FitSystem')
Create four inputs to the MISO receiver. The pulsed carrier square wave input is time-sliced into four pieces.
in1 = [1e-3*[1;1;0;0;0;0;0;0]; zeros(8,1)] .* ones(1,10); in1 = in1(:); in2 = [1e-3*[0;0;1;1;0;0;0;0]; zeros(8,1)] .* ones(1,10); in2 = in2(:); in3 = [1e-3*[0;0;0;0;1;1;0;0]; zeros(8,1)] .* ones(1,10); in3 = in3(:); in4 = [1e-3*[0;0;0;0;0;0;1;1]; zeros(8,1)] .* ones(1,10); in4 = in4(:); out = rfs(in1,in2,in3,in4);
Release system resources and turn off fast restart.
release(rfs) reset(rfs)
Plot the circuit envelope simulated result.
t = rfs.SampleTime*(0:length(out)-1); plot(t,in1+in2+in3+in4,'-o',t,abs(out),'-+') grid on
Type rfBudgetAnalyzer(rfs)
command at the command line to open the MISO receiver in the RF Budget Analyzer app to visualize the initial budget chain b
.
Duplicate the budget chain into a single-input multiple-output (SIMO) array system with sixteen branches.
rfs2 = rfsystem(b,Tx=16);
Open the underlying RF system model to inspect the SIMO receiver
open_system(rfs2)
Name Your RF Blockset Model
Create a fifth-order bandpass RF filter.
f1 = rffilter('ResponseType','Bandpass','FilterOrder',5,'PassbandFrequency',[4.85 5.15]*1e9);
Create an amplifier with the gain of 3
dB, noise figure of 1.53
dB, and OIP3 of 35
dBm.
a1 = amplifier('Gain',3,'NF',1.53,'OIP3',35);
Create an rfbudget
object using these elements at an input frequency of 5
GHz, an available input power of -30
dBm, and a bandwidth of 200
MHz.
rfb = rfbudget([f1 a1],5e9,-30,200e6);
Create an RF system using the rfbdget object. Name the model and save the RF Blockset model.
rfs = rfsystem(rfb,'ModelName','myRFSystem_Model') save_system(rfs);
rfs = rfsystem with properties: ModelName: 'myRFSystem_Model' SampleTime: 6.2500e-10 InputFrequency: 5.0000e+09 OutputFrequency: 5.0000e+09 RFInputs: 1 RFOutputs: 1
Perform HB Analysis on RF Receiver Designed Using rfsystem
Design an RF receiver using the rfsystem
system object. View the object in the the RF Budget Analyzer app to perform harmonic balance (HB) analysis.
Create fifth- and seventh-order bandpass RF filters.
f1 = rffilter('ResponseType','Bandpass','FilterOrder',5, ... 'PassbandFrequency',[4.85 5.15]*1e9); f2 = rffilter('ResponseType','Bandpass','FilterOrder',7, ... 'PassbandFrequency',[10 130]*1e6);
Create two amplifier objects with 3
dB and 5
dB gain, respectively.
a1 = amplifier('Gain',3,'NF',1.53,'OIP3',35); a2 = amplifier('Gain',5,'NF',8,'OIP3',37);
Create a modulator with a local frequency of 4.93
GHz.
d = modulator('Gain',0,'NF',4,'OIP3',50,'LO',4.93e9, ... 'ConverterType','Down');
Design an RF receiver with the budget elements at an input frequency of 5
GHz, an available input power of – 30
dBm, and a bandwidth of 10
MHz.
rfb = rfbudget([f1 a1 d f2 a2],5e9,-30,10e6);
Create an RF system for the RF receiver using the rfbudget
object.
rfs = rfsystem(rfb);
Open an RF Blockset model of the designed RF system using the open_system
object function.
open_system(rfs)
Type rfBudgetAnalyzer(rfs) command at the MATLAB® command line to open this RF system in the RF Budget Analyzer app.
To conduct HB analysis in the app, click the HB-Analyze button.
Version History
Introduced in R2021aR2022a: Enhancements to rfsystem
Updates to the rfsystem
System object now enable you to:
Model multiple-input and single-output (MISO) and single-input and single-output (SIMO) systems by specifying number of input and output RF chains using the 'Rx' and 'Tx' properties.
Add Simulink inports and outports to your RF Blockset™ model by specifying number of Simulink input and output ports using 'SLInputs' and 'SLOutputs' properties.
Export your RF system to the RF Budget Analyzer app, type
rfBudgetAnalyzer(rfs)
at the MATLAB® command line.Use the
load_system
function specific to the System object to add the system model to memory.Use the
close_system
function specific to the System object to close the system model window.
See Also
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)