| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Communications Toolbox |
| Contents | Index |
| Learn more about Communications Toolbox |
You attach a system to the Error Rate Test Console to run simulations and obtain error rate data. When you attach the system under test, you also register specific information to the test console in order to define the system's test inputs, test parameters, and test probes.
Creating a communications system for use with the Error Rate Test Console, involves the following steps.
Writing a system class, extending the testconsole.SystemBasicAPI class.
Writing a registration method
Registration is test related
Defines items such as test parameters, test probes, and test inputs
Writing a setup method
Writing a reset method
Writing a run method
Methods allows the system to communicate with the test console.
You can see an example of a system file by opening MPSKSYSTEM.m, which resides in the following location:
matlab\toolbox\comm\comm\+commtest
Using the register method, you register test inputs, test parameters, and test probes to the Error Rate Test Console. You register these items to the Error Rate Test Console using the registerTestInput, registerTestParameter, and registerTestProbe methods.
Write a register method for every communication system you create.
If you do not implement a register method for a system, you can still attach the system to the Error Rate Test Console. While the test console runs the specified number of iterations on the system, you cannot control simulation parameters or retrieve results from the simulation.
In order to run simulations, the system under test requests test inputs from the Error Rate Test Console. These test inputs provide data, driving simulations for the system under test.
A system under test cannot request a specific input type until you attach it to the Error Rate Test Console. Additionally, the specific input type must be registered to the test console.
Inside the register method, you call the registerTestInput(sys,inputName) method to register test inputs.
sys represents the handle to a user-defined system object.
inputName represents the name of the input that the system registers. This name must coincide with the name of an available test input in the Error Rate Test Console or an error occurs.
'NumTransmissions' - calling the getInput method returns the frame length. The system itself is responsible for generating a data frame using a data source.
'RandomIntegerSource' - calling the getInput method returns a vector of symbols with a length the Error Rate Test Console FrameLength property specifies. If the system registers this source type, then it must also register a test parameter named 'M' that corresponds to the modulation order.
Test parameters are the system parameters for which the Error Rate Test Console obtains simulation results. You specify the sweep range of these parameters using the Error Rate Test Console and obtain simulation results for different system conditions.
The system under test registers a system parameter to the Error Rate Test Console, creating a test parameter. You register a test parameter to the Error Rate Test Console using the registerTestParameter(sys,name,default,validRange) method.
sys represents the handle to the user-defined system object
name represents the parameter name that the system registers to the Error Rate Test Console
default specifies the default value of the test parameter – it can be a numeric value or a string
validRange specifies a range of input values for the test parameter — it can be a 1x2 vector of numeric values with upper and lower ranges or a cell array of chars (an Enum).
A parameter of type char becomes useful when defining system conditions. For example, in a communications system, a Channel parameter may be defined so that it takes values such as ‘Rayleigh', ‘Rician', or ‘AWGN'. Depending on the Channel char value, the system may filter transmitted data through a different channel. This allows the simulation of the system over different channel scenarios.
If the system registers a test parameter named ‘X' then the system must also contain a readable property named ‘X'. If not, the registration process issues an error. This process ensures that calling the getTestParameter method in debug mode returns the value held by the corresponding property.
Test probes log the simulation data the Error Rate Test Console uses for computing test metrics, such as: number of errors, number of transmissions, and error rate. To log data into a probe, your communications system must register the probe to the Error Rate Test Console.
You register a test probe to the Error Rate Test Console using the registerTestProbe(sys,name) method.
sys represents the handle to the user-defined system object
name represents the name of the test probe
You can define an arbitrary number of probes to log test data at several points within the system.
The Error Rate Test Console calls the setup method at the beginning of simulations for each new sweep point. A sweep point is one of several sets of simulation parameters for which the system will be simulated. Using the getTestParameter method of the system under test, the setup method requests the current simulation sweep values from the Error Rate Test Console and sets the various system components accordingly. The setup method sets the system to the conditions the current test parameter sweep values generate.
Writing a setup method for each communication system you create is not necessary. The setup method is optional.
Use the reset method to reset states of various system components, such as: objects, data buffers, or system flags. The Error Rate Test Console calls the reset method of the system:
at the beginning of simulations for a new sweep point. (This condition occurs when you set the ResetMode of the Error Rate Test Console to "Reset at new simulation point'.
at each simulation iteration. (This condition occurs when you set the ResetMode of the Error Rate Test Console to 'Reset at every iteration'.)
Writing a reset method for each communication system you create is not mandatory. The reset method is optional.
Write a run method for each communication system you create. The run method includes the core functionality of the system under test. At each simulation iteration, the Error Rate Test Console calls the run method of the system under test.
When designing a communication system, ensure at run time that your system sets components to the current simulation test parameter sweep values. Depending on your unique design, at run time, the communication system:
requests test inputs from the test console using the getInput method
logs test data to its test probes using the setTestProbeData method
logs user-data to the test console using the setUserData method
Although it is recommended you do this at setup time, the system can also request the current simulation sweep values using the getTestParameter method.
![]() | Introduction to Error Rate Test Console | Methods Allowing You to Communicate with the Error Rate Test Console at Simulation Run Time | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |