main content

create custom rf blockset models -凯发k8网页登录

this example shows how to write your own rf blockset™ circuit envelope model in simscape® language for complex baseband simulation. an rf circuit envelope complex baseband signal resides on a carrier with specified frequency. this baseband signal will modulate with other signals when the system is nonlinear. the example nonlinearity is implemented with a simscape component block and includes a simscape ssc-file to describe the nonlinear voltage polynomial.

system architecture

the system consists of:

  • an input voltage signal, linearly increasing in time and generated with a simulink ramp block.

  • an rf blockset inport block to specify the carrier frequencies (input_freq) of the input voltage signal. this setup allows observation of the system nonlinear behavior for different input settings.

  • a custom nonlinear voltage amplifier (polynomial voltage controlled voltage source), modeled with a simscape component block. the device equations are written in passband (time) domain and assume instantaneous voltage v(t) and current i(t) values. these equations are interpreted by rf blockset envelope solver in both passband and baseband domains (zero and nonzero carrier frequencies).

  • an outport block to specify output carrier frequencies (output_freqs). the output carrier frequencies are higher order harmonics (integer multiples) of the inport frequency resulting from the amplifier nonlinearity.

  • a scope to display the magnitudes of the output voltages at output_freqs frequencies as specified in the outport block.

  • load resistors and ground nodes needed to make the circuit electrically sound. by construction, the resistor values do not affect the output voltage.

  • a configuration block to control the system carrier frequencies required for accurate simulation and other simulation properties.

model = 'simrfv2_custom_polynomial';
open_system(model);

examine model

double-click the "custom nonlinearity" block or type open_system([model '/custom nonlinearity']) in the command window to open the custom nonlinearity block mask.

the file simrfv2_custom_vcvs.ssc describes the custom device. view the source code by clicking the block mask "source code" link or typing edit simrfv2_custom_vcvs at the command prompt.

copy the file simrfv2_custom_vcvs.ssc to a directory where you have write permission to rename and modify the file. click the block mask "choose source" button to replace the current device implementation with yours. use the mask help button for additional information.

the above method uses the simscape component block from the simscape utilities library to avoid the library build process. for more information, see .

run model using default settings

for this example, default input and output frequencies are set to 0 and the result is a passband simulation. the input voltage magnitude is linearly increasing in time, vin(t) = t, and the custom nonlinearity relationship vout(vin) is shown in the scope.

the model is simulated after entering the following into the command window

sim(model);

observe the response produced by the cubic polynomial specified in the 'custom nonlinearity' model. the saturated output voltage occurs at time 0.7 seconds and corresponds to the input voltage of 0.7 v.

run model with non-zero input carrier

set the input carrier frequency to 1 ghz and the output frequencies to the first five harmonics of the input. for non-zero carrier input frequency, rf blockset interprets the input as a complex baseband signal. this complex baseband signal only has a in-phase part specified.

type the following at the command prompt:

input_freq = 1e9;
output_freqs = (1:5)*input_freq;
sim(model);

since the coefficients c0 and c2 are zero, the output has only odd harmonics (1 ghz, 3 ghz and 5 ghz) until the output voltage reaches saturation. other harmonics are introduced for large values of input voltage because of saturation effects.

the relationship between the output curves, polynomial coefficients and ip2/ip3/p1db coefficients is well-studied in the literature [1,2].

conclusion

an rf blockset model can be written as a time-domain electrical model in the simscape language. the model equation can include many types of characteristics, such as derivatives and history (not shown in this example). as with any other model description language, the modeler is responsible for the validity of the model:

  • the equations are consistent.

  • the equations cannot be degenerate, unstable, or discontinuous. avoid negative resistances, large nonlinearities and sharp transitions.

  • the model does not produce convergence errors during the simulation.

bibliography

  1. kundert, ken. "accurate and rapid measurement of ip2 and ip3." the designers guide community, version 1b, may 22, 2002.

  2. chen, jesse. "modeling rf systems." the designers guide community, version 1, 6 march 2005.

bdclose(model)

see also

| |

related topics

网站地图