RF Blockset 2.5
Power in Simulink® Sources and Signals
In general, signals in Simulink® are dimensionless amplitudes instead of voltages or powers. However, in an RF system, power rather than dimensionless amplitude is the quantity of interest. When you use blocks from the RF Blockset™ Physical library in a Simulink model, you must specify how the blockset interprets the Simulink signals that exist outside the bounds of the Input Port and Output Port blocks. RF Blockset provides two options to interpret the Simulink signal: power wave or voltage. It is important to know how to set the amplitude of a source in Simulink to achieve the desired signal power level and how to display the signal power and power spectrum. This demo uses several models to show the relationship between signal amplitude and power level.
All the models used in this demo interpret the Simulink signal as a power wave with dimensions of
. This means for an RF system, the source signal generated by regular Simulink blocks is treated as the incident power wave to the RF system, and the RF output signal is the transmitted power wave of the RF system. If you choose to interpret the Simulink signal as a voltage, you need to modify the models by considering the impedance effects when you calculate the powers. For more details, see the documentation page Converting to and from Simulink Signals.
Contents
White Noise Source
This part of the demo shows how to create a complex baseband-equivalent White Noise Source. This type of source is useful, for example, as a stimulus for visualizing the frequency response of an RF system.
Use a Random Source block from the Signal Processing Blockset™ Signal Processing Sources sublibrary to create this source. In the Random Source block dialog box, set the Complexity parameter to "Complex" and the Variance parameter using the following expression:
sqrt(power_in_watts)
... where power_in_watts is the desired noise power in watts.
To calculate a signal power in dBm, use an RMS block (from the Signal Processing Blockset Statistics sublibrary), followed by a dB Conversion block (from the Signal Processing Blockset Math Functions/Math Operations sublibrary).
In the dB Conversion block dialog box, set Convert to to "dBm", Input Signal to "Amplitude", and Load resistance (ohms) to 1.
open('rfb_power_examples_white_noise.mdl')
To display the power spectrum of a signal, use the Spectrum Scope block (from the Signal Processing Blockset Signal Processing Sinks sublibrary). In the Spectrum Scope block dialog box ("Scope Properties" tab), set the Spectrum type: parameter to "Two-sided((-Fs/2...Fs/2])". This is the desired frequency range because the complex baseband-equivalent representation translates the carrier frequency to zero hertz. The real-world frequencies above and below the carrier (i.e. higher and lower sidebands) are represented as positive and negative frequencies, respectively.
sim('rfb_power_examples_white_noise')
In addition, note that the selected Spectrum Scope Window Type can affect how the power is distributed amongst the channels closest to the actual frequency. For example, if a pure sine wave falls between two channels, you may need to sum the power in one or two channels either side of the actual frequency to determine the exact total power.
Complex Sine Source
The next model, of a Complex Sine Wave, shows how to use power to set the amplitude of a complex sine wave source block for an RF system.
Complex sine wave sources are often used in baseband-equivalent Simulink models. These sources have the following time-domain output:
signal(t) = amplitude * (cos(2*pi*f*t+phi)+j*sin(2*pi*f*t+phi))
The mean square power of the output, signal, is amplitude^2.
By contrast, the time-domain output of a real sine wave source is:
signal2(t) = amplitude * sin(2*pi*f*t+phi)
... and the mean square power of signal2 is amplitude^2/2 i.e. half that of a complex sine wave with the same amplitude.
open('rfb_power_examples_cis_wave.mdl')
Use the Sine Wave block to create a complex sine source. In the block dialog box, set the Output complexity parameter to "Complex" and the Amplitude parameter to:
sqrt(power_in_watts)
By default, the Spectrum Scope displays power spectral density normalized to the unit sampling frequency in units of dBW/Herts. However, for a sinusoid we want to display the mean square power in dBm. To do this, set the Spectrum units: parameter to "dBm" in the "Scope Properties" tab. The Spectrum Scope displays the tone as a positive frequency (upper side band).
sim('rfb_power_examples_cis_wave')
Two-Tone Input to Non-linear Mathematical Amplifier
The third model, of a Two-Tone Input to a Non-linear Mathematical Amplifier, shows how the Amplifier block in the RF Blockset Mathematical sublibrary affects the signal.
In the Amplifier block dialog box set the IIP3 (dBm) parameter to 20dBm. In the Sine Wave block dialog box, set Amplitude to:
sqrt(10^((power_in_dBm - 30)/10))
Setting power_in_dBm = -10 in the model workspace results in -10dBm per tone. Note that we must use a Matrix Sum block with the Sum along parameter set to "Rows" after the source block to sum the two-channel output of the source. Without the Row Sum, a two-channel signal would be created, all blocks downstream would have two independent channels, and no mixing would occur.
open('rfb_power_examples_two_tone_math_amp.mdl')
sim('rfb_power_examples_two_tone_math_amp')
The Spectrum Scope displays the power level in each intermodulation tone. The power level of each is:
-10dBm - 2*(20dBm - -10dBm) = -70dBm.
Two-Tone Input to Non-linear Physical Amplifier
Like the third model, the fourth model, of a Two-Tone Input to a Non-linear Physical Amplifier, shows how an Amplifier block affects the signal. However, this time we use the Amplifier block from the Physical sublibrary of RF Blockset. Unlike the Mathematical blocks, the physical blocks allow you to set the Center frequency and impedances. Thus, if you want to model an RF system at real RF frequencies, the loading and reflection effects, we recommend these physical blocks.
In this model, we set several parameters to Z0:
- Source impedance parameter of the Input Port block dialog box
- Reference impedance parameter of the S-Parameters Amplifier block dialog box
- Load impedance parameter of the Output Port block dialog box
open('rfb_power_examples_two_tone_physical_amp.mdl')
In the Input Port block, set the Center frequency (Hz) parameter to 2e9 (2GHz). The baseband frequencies of the two-tone complex Simulink signal are 200kHz and 300kHz. Thus, in the RF system (the physical blocks connected between the Input Port and Output Port blocks), the real RF two-tone frequencies are 2.0002GHz and 2.0003GHz. By default, the Spectrum Scope displays in baseband. To display the desired tones at 2.0002GHz and 2.0003GHz (-10dBm each) and the intermodulation tones at 2.0001GHz and 2.0004GHz (-70dBm each), set the Frequency display offset: parameter in the "Axis Properties" tab to the value of the Center frequency, in this case it is 2e9 (2GHz).
sim('rfb_power_examples_two_tone_physical_amp')
Displaying Power Spectrum within a Cascade of RF Physical Blocks
The Output Port block lets you create a link budget plot for multi-block cascades. This feature allows you to visualize the characteristics of the cascade non-intrusively. Therefore, it is not usually necessary to tap a cascade of RF physical blocks. However, it is sometimes useful to do so, for example to see the modulated spectrum at an intermediate point. The final model, of a Tap Cascade of Physical Blocks in RF Blockset, achieves this with a subsystem that approximately models a real-world directional coupler. As with its real-world counterpart, the tapping is intrusive in that it presents a load impedance to the downstream part of the cascade and it drives the upstream part with a source impedance.
Double click on the subsystem "Pseudo 30dB Directional Coupler" to open it and see how the model works. The Output Port and Input Port blocks correspond to the input and output impedance of the mainline of a real-world directional coupler, respectively. However, the phase behavior of a real-world directional coupler is not modeled here.
open('rfb_power_examples_tap_cascade.mdl') sim('rfb_power_examples_tap_cascade') h = []; h(1) = findall(0, 'type', 'figure', 'name', ... ['rfb_power_examples_tap_cascade/Spectrum',sprintf('\n'),'Scope 1']); h(2) = findall(0, 'type', 'figure', 'name', ... ['rfb_power_examples_tap_cascade/Spectrum',sprintf('\n'),'Scope 2']); set(h,'Visible','off');
set(h(1),'Visible','on');
The first Spectrum Scope shows the intermodulation tones after one amplifier. Note that the power is 30dB down because of the characteristics of the "Pseudo 30dB Directional Coupler" subsystem. You could calibrate this out with a gain block, or even modify the subsystem to model a 0dB-loss "active" directional coupler.
set(h(2),'Visible','on');
The second Spectrum Scope shows an increased level of intermodulation tones after a cascade of two non-linear amplifiers.
bdclose('rfb_power_examples_white_noise'); bdclose('rfb_power_examples_cis_wave'); bdclose('rfb_power_examples_two_tone_math_amp'); bdclose('rfb_power_examples_two_tone_physical_amp'); bdclose('rfb_power_examples_tap_cascade');
Store